Skip to contents

Delete a user managed policy

Usage

aws_policy_delete(name)

Arguments

name

(character) a policy name. required. within the function we lookup the policy arn which is what's passed to the AWS API

Value

invisibly returns nothing

AWS managed policies

You can not delete AWS managed policies.

Deleting process (adapted from paws docs)

Before you can delete a managed policy, you must first detach the policy from all users, groups, and roles that it is attached to. In addition, you must delete all the policy's versions. The following steps describe the process for deleting a managed policy:

References

delete_policy

Examples

if (FALSE) { # interactive()
doc <- aws_policy_document_create(
  region = "us-east-2",
  account_id = "1234567890",
  resource_id = "*",
  user = "jane_doe",
  action = "rds-db:connect"
)
aws_policy_create("RdsAllow456", document = doc)
aws_policy_delete("RdsAllow456")
}