Invalid policy error when running a documentation example #9026
-
I am getting started with Cloud Custodian. I have taking a look at the AWS docs, and tried to reproduce an example found in the Filters documentation. It is a very simple policy:
For some reason, when I run
I have been trying to find the cause of the error, but I have not been successful. What am I missing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In a Cloud Custodian policy file, policies show up under a top-level Some documentation examples (like the write your first policy section of getting started) include that 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
period: 86400
value: 5
op: less-than
- name: ec2-other-policy
resource: ec2
filters:
- ...
...and potentially more policies... |
Beta Was this translation helpful? Give feedback.
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:
would be part of a policy file that could potentially contain multiple policies: