Skip to contents

Create a policy

Usage

aws_policy_create(name, document, path = NULL, description = NULL, tags = NULL)

Arguments

name

(character) a policy name. required

document

(character) the policy document you want to use as the content for the new policy. required.

path

(character) the path for the policy. if not given default is "/". optional

description

(character) a friendly description of the policy. optional. cannot be changed after assigning it

tags

(character) a vector of tags that you want to attach to the new IAM policy. Each tag consists of a key name and an associated value. optional

Value

a tibble with policy details

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("RdsAllow123", document = doc)
# cleanup
aws_policy_delete("RdsAllow123")
}