aws_policy_create: Create a policy

aws_policy_createR Documentation

Create a policy

Description

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

Details

see docs https://www.paws-r-sdk.com/docs/iam_create_policy/

Value

a tibble with policy details

See Also

Other policies: as_policy_arn(), aws_policies(), aws_policy(), aws_policy_attach(), aws_policy_delete(), aws_policy_delete_version(), aws_policy_detach(), aws_policy_exists(), aws_policy_list_entities(), aws_policy_list_versions(), aws_policy_update()

Examples


if (aws_policy_exists("MyPolicy123")) {
  aws_policy_delete("MyPolicy123")
}

# Create policy document
st8ment1 <- aws_policy_statement("iam:GetUser", "*")
st8ment2 <- aws_policy_statement("s3:ListAllMyBuckets", "*")
doc <- aws_policy_document_create(st8ment1, st8ment2)

# Create policy
aws_policy_create("MyPolicy123", document = doc)

# cleanup - delete policy
aws_policy_delete("MyPolicy123")


sixtyfour documentation built on April 3, 2025, 8:22 p.m.