aws_policy_exists: Check if a policy exists

aws_policy_existsR Documentation

Check if a policy exists

Description

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

See Also

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

Examples


# 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")


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