aws_policy_delete_version {sixtyfour} | R Documentation |
Delete a policy version
Description
Delete a policy version
Usage
aws_policy_delete_version(name, version_id)
Arguments
name |
(character) a policy name. required. within the function we lookup the policy arn which is what's passed to the AWS API |
version_id |
(character) The policy version to delete. required. Allows (via regex) a string of characters that consists of the lowercase letter 'v' followed by one or two digits, and optionally followed by a period '.' and a string of letters and digits. |
Value
invisibly returns NULL
References
https://www.paws-r-sdk.com/docs/iam_delete_policy_version/
See Also
Other policies:
as_policy_arn()
,
aws_policies()
,
aws_policy()
,
aws_policy_attach()
,
aws_policy_create()
,
aws_policy_delete()
,
aws_policy_detach()
,
aws_policy_exists()
,
aws_policy_list_entities()
,
aws_policy_list_versions()
,
aws_policy_update()
Examples
if (aws_policy_exists("RdsAllow888")) {
aws_policy_delete("RdsAllow888")
}
# Create policy document
doc <- aws_policy_document_create(
aws_policy_statement(
action = "rds-db:connect",
resource = "*"
)
)
# Create policy
invisible(aws_policy_create("RdsAllow888", document = doc))
# Add a new version of the policy
st8ment1 <- aws_policy_statement("iam:GetUser", "*")
new_doc <- aws_policy_document_create(st8ment1)
arn <- as_policy_arn("RdsAllow888", local = TRUE)
aws_policy_update(arn, document = new_doc, defaul = TRUE)
# List versions of the policy
aws_policy_list_versions("RdsAllow888")
# Delete a policy version
aws_policy_delete_version("RdsAllow888", "v1")
# Cleanup - delete policy
aws_policy_delete("RdsAllow888")
[Package sixtyfour version 0.2.0 Index]