Skip to content

Invalid policy error when running a documentation example #9026

Answered by ajkerrigan
entrustgabri asked this question in AWS
Discussion options

You must be logged in to vote

In a Cloud Custodian policy file, policies show up under a top-level policies key.

Some documentation examples (like the write your first policy section of getting started) include that policies key, while others include only the policy body.

For your example, the assumption is that an individual policy:

- name: ec2-underutilized
  resource: ec2
  filters:
    - type: metrics
      name: CPUUtilization
      days: 4
      period: 86400
      value: 5
      op: less-than

would be part of a policy file that could potentially contain multiple policies:

policies:

  - name: ec2-underutilized
    resource: ec2
    filters:
      - type: metrics
        name: CPUUtilization
        days: 4

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@entrustgabri
Comment options

Answer selected by entrustgabri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
AWS
Labels
None yet
2 participants