Skip to contents

Checks for both customer managed and AWS managed policies

Usage

aws_policy_exists(name)

Arguments

name

(character) a policy name or arn

Value

single logical, TRUE or FALSE

Examples

if (FALSE) { # interactive()
# just the policy name
aws_policy_exists("ReadOnlyAccess")
# as an ARN
aws_policy_exists("arn:aws:iam::aws:policy/ReadOnlyAccess")
# includes job-function in path
aws_policy_exists("Billing")
# includes service-role in path
aws_policy_exists("AWSCostAndUsageReportAutomationPolicy")
}