aws_policy_update | R Documentation |
Update a policy
aws_policy_update(arn, document, default = FALSE)
arn |
(character) policy arn. required |
document |
(character) the policy document you want to use as the content for the new policy. required |
default |
(character) set this version as the policy's default version?
optional. When this parameter is |
see docs https://www.paws-r-sdk.com/docs/iam_create_policy_version/
a tibble with policy version details:
VersionId
IsDefaultVersion
CreateDate
Other policies:
as_policy_arn()
,
aws_policies()
,
aws_policy()
,
aws_policy_attach()
,
aws_policy_create()
,
aws_policy_delete()
,
aws_policy_delete_version()
,
aws_policy_detach()
,
aws_policy_exists()
,
aws_policy_list_entities()
,
aws_policy_list_versions()
if (aws_policy_exists("polisee")) {
aws_policy_delete("polisee")
}
# Create policy document
st8ment1 <- aws_policy_statement("iam:GetUser", "*")
st8ment2 <- aws_policy_statement("s3:ListAllMyBuckets", "*")
doc <- aws_policy_document_create(st8ment1, st8ment2)
# Create policy
invisible(aws_policy_create("polisee", document = doc))
# Update the same policy
new_doc <- aws_policy_document_create(st8ment1)
arn <- as_policy_arn("polisee", local = TRUE)
aws_policy_update(arn, document = new_doc, default = TRUE)
aws_policy_list_versions("polisee")
# cleanup - delete the policy
aws_policy_delete_version("polisee", "v1")
aws_policy_delete("polisee")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.