aws_policy_create | R Documentation |
Create a policy
aws_policy_create(name, document, path = NULL, description = NULL, tags = NULL)
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 |
see docs https://www.paws-r-sdk.com/docs/iam_create_policy/
a tibble with policy details
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()
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.