This function simply constructs a string, then checks that the ARN is valid using get_policy
Arguments
- name
(character) a policy name or arn
- local
(logical) if
TRUE
use your AWS account for your own managed policies. IfFALSE
, AWS managed policies- path
(character) if not
NULL
, we add the path into the ARN before thename
value
See also
Other policies:
aws_policies()
,
aws_policy_attach()
,
aws_policy_create()
,
aws_policy_delete_version()
,
aws_policy_delete()
,
aws_policy_detach()
,
aws_policy_exists()
,
aws_policy_list_entities()
,
aws_policy_list_versions()
,
aws_policy()
Examples
if (FALSE) {
as_policy_arn("ReadOnlyAccess")
as_policy_arn("arn:aws:iam::aws:policy/ReadOnlyAccess")
as_policy_arn("AmazonRDSDataFullAccess")
# as_policy_arn("Blarp")
# as_policy_arn(letters)
# as_policy_arn(5)
as_policy_arn("MyTestPolicy", local = TRUE)
# returns an arn - and if given an arn returns self
as_policy_arn("MyTestPolicy", local = TRUE) %>%
as_policy_arn()
# path = Job function
as_policy_arn("Billing", path = "job-function")
# path = Service role
as_policy_arn("AWSCostAndUsageReportAutomationPolicy",
path = "service-role"
)
}