cfn-guard 3.2.0

AWS CloudFormation Guard is an open-source general-purpose policy-as-code evaluation tool. It provides developers with a simple-to-use, yet powerful and expressive domain-specific language (DSL) to define policies and enables developers to validate JSON- or YAML- formatted structured data with those policies.
Documentation
---
- name: Pass
  input:
    Resources:
      newServer:
        Type: AWS::New::Service
        Properties:
          BucketPolicy:
            PolicyText: '{"Version":"2012-10-17","Statement":[{"Sid":"DenyReducedReliabilityStorage","Effect":"Deny","Principal":"*","Action":"s3:*","Resource":"arn:aws:s3:::s3-test-123/*","Condition":{"StringEquals":{"s3:x-amz-storage-class-123":["ONEZONE_IA","REDUCED_REDUNDANCY"]}}}]}'
  expectations:
    rules:
      SOME_RULE: PASS

- name: Fail
  input:
    Resources:
      newServer:
        Type: AWS::New::Service
        Properties:
          BucketPolicy:
            PolicyText: '{"Version":"2012-10-17","Statement":[{"Sid":"DenyReducedReliabilityStorage","Effect":"Allow","Principal":"*","Action":"s3:*","Resource":"arn:aws:s3:::s3-test-123/*","Condition":{"StringEquals":{"s3:x-amz-storage-class-123":["ONEZONE_IA","REDUCED_REDUNDANCY"]}}}]}'
  expectations:
    rules:
      SOME_RULE: FAIL

- name: Skip
  input:
    Resources: {}
  expectations:
    rules:
      SOME_RULE: SKIP