Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the example for resources that do not support the Tags property #285

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

scottschreckengaust
Copy link

Issue #, if available:
Tests "FAIL" for CloudFormation resources that do not support the Tags property.

Description of changes:
Add resources that do not support the Tag property as an exclusion. Also, remove the example from other examples.

Each region's CloudFormation resource specification can be found at https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html.

Example of resources in us-east-1 that do not support the Tags property:

curl https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json|gunzip | jq -r '.ResourceTypes | keys_unsorted[] as $resourceKey | { "name": "\($resourceKey)", "tags": ."\($resourceKey)".Properties.Tags } | select( ."tags" == null)|.name' | sort -u

Any resource in any region that did not support the Tags property has been added.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

* AWS::KMS::Alias
* AWS::SageMaker::NotebookInstanceLifecycleConfig
* AWS::Lambda::Permission
* AWS::Athena::NamedQuery
* AWS::Athena::PreparedStatement
* AWS::S3::BucketPolicy
Not all resources have a Tags property, this guard belongs in a
separate rule unrelated to encryption for Dynamo.
There are four regions without Tags property for IoT::TopicRule
There are four regions without Tags property for Logs::LogGroup
@scottschreckengaust
Copy link
Author

FYI: List was generated by this script:

#!/bin/sh

set -e

# The locations are derived from https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html
curl https://dnwj8swjjbsbt.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                       | gunzip  > CloudFormationResourceSpecification.njson;
curl https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                      | gunzip >> CloudFormationResourceSpecification.njson;
curl https://d68hl49wbnanq.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                       | gunzip >> CloudFormationResourceSpecification.njson;
curl https://d201a2mn26r7lk.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                      | gunzip >> CloudFormationResourceSpecification.njson;
curl https://cfn-resource-specifications-af-south-1-prod.s3.af-south-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json            | gunzip >> CloudFormationResourceSpecification.njson;
curl https://cfn-resource-specifications-ap-east-1-prod.s3.ap-east-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json              | gunzip >> CloudFormationResourceSpecification.njson;
curl https://cfn-resource-specifications-ap-southeast-3-prod.s3.ap-southeast-3.amazonaws.com/latest/CloudFormationResourceSpecification.json                  >> CloudFormationResourceSpecification.njson;
curl https://d2senuesg1djtx.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                      | gunzip >> CloudFormationResourceSpecification.njson;
curl https://d2zq80gdmjim8k.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                      | gunzip >> CloudFormationResourceSpecification.njson;
curl https://d1ane3fvebulky.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                      | gunzip >> CloudFormationResourceSpecification.njson;
curl https://doigdx0kgq9el.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                       | gunzip >> CloudFormationResourceSpecification.njson;
curl https://d2stg8d246z9di.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                      | gunzip >> CloudFormationResourceSpecification.njson;
curl https://d33vqc0rt9ld30.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                      | gunzip >> CloudFormationResourceSpecification.njson;
curl https://d2s8ygphhesbe7.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                      | gunzip >> CloudFormationResourceSpecification.njson;
curl https://cfn-resource-specifications-cn-north-1-prod.s3.cn-north-1.amazonaws.com.cn/latest/gzip/CloudFormationResourceSpecification.json         | gunzip >> CloudFormationResourceSpecification.njson;
curl https://cfn-resource-specifications-cn-northwest-1-prod.s3.cn-northwest-1.amazonaws.com.cn/latest/gzip/CloudFormationResourceSpecification.json | gunzip >> CloudFormationResourceSpecification.njson;
curl https://d1mta8qj7i28i2.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                      | gunzip >> CloudFormationResourceSpecification.njson;
curl https://d3teyb21fexa9r.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                      | gunzip >> CloudFormationResourceSpecification.njson;
curl https://d1742qcu2c1ncx.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                      | gunzip >> CloudFormationResourceSpecification.njson;
curl https://d2d0mfegowb3wk.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                      | gunzip >> CloudFormationResourceSpecification.njson;
curl https://diy8iv58sj6ba.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                       | gunzip >> CloudFormationResourceSpecification.njson;
curl https://cfn-resource-specifications-eu-south-1-prod.s3.eu-south-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json            | gunzip >> CloudFormationResourceSpecification.njson;
curl https://cfn-resource-specifications-me-south-1-prod.s3.me-south-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json            | gunzip >> CloudFormationResourceSpecification.njson;
curl https://d3c9jyj3w509b0.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json                                                      | gunzip >> CloudFormationResourceSpecification.njson;
curl https://s3.us-gov-east-1.amazonaws.com/cfn-resource-specifications-us-gov-east-1-prod/latest/CloudFormationResourceSpecification.json                    >> CloudFormationResourceSpecification.njson;
curl https://s3.us-gov-west-1.amazonaws.com/cfn-resource-specifications-us-gov-west-1-prod/latest/CloudFormationResourceSpecification.json                    >> CloudFormationResourceSpecification.njson;

cat CloudFormationResourceSpecification.njson | jq -r '.ResourceTypes | keys_unsorted[] as $resourceKey | { "name": "\($resourceKey)", "tags": ."\($resourceKey)".Properties.Tags } | select( ."tags" == null)|.name' | sort -u;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant