-
Notifications
You must be signed in to change notification settings - Fork 181
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
scottschreckengaust
wants to merge
9
commits into
aws-cloudformation:main
Choose a base branch
from
scottschreckengaust:resources-without-tags-property
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix the example for resources that do not support the Tags property #285
scottschreckengaust
wants to merge
9
commits into
aws-cloudformation:main
from
scottschreckengaust:resources-without-tags-property
+549
−9
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 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
FYI: List was generated by this script:
|
Updated script for eight more regions and storing output individually for deeper inspection and troubleshooting: #!/bin/sh
## 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_us-east-2.json"
curl "https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_us-east-1.json"
curl "https://d68hl49wbnanq.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_us-west-1.json"
curl "https://d201a2mn26r7lk.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_us-west-2.json"
curl "https://cfn-resource-specifications-af-south-1-prod.s3.af-south-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_af-south-1.json"
curl "https://cfn-resource-specifications-ap-east-1-prod.s3.ap-east-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_ap-east-1.json"
curl "https://cfn-resource-specifications-ap-south-2-prod.s3.ap-south-2.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_ap-south-2.json"
curl "https://cfn-resource-specifications-ap-southeast-3-prod.s3.ap-southeast-3.amazonaws.com/latest/CloudFormationResourceSpecification.json" > "CloudFormationResourceSpecification_ap-southeast-3.json"
curl "https://cfn-resource-specifications-ap-southeast-5-prod.s3.ap-southeast-5.amazonaws.com/latest/CloudFormationResourceSpecification.json" > "CloudFormationResourceSpecification_ap-southeast-5.json"
curl "https://cfn-resource-specifications-ap-southeast-4-prod.s3.ap-southeast-4.amazonaws.com/latest/CloudFormationResourceSpecification.json" > "CloudFormationResourceSpecification_ap-southeast-4.json"
curl "https://d2senuesg1djtx.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_ap-south-1.json"
curl "https://d2zq80gdmjim8k.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_ap-northeast-3.json"
curl "https://d1ane3fvebulky.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_ap-northeast-2.json"
curl "https://doigdx0kgq9el.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_ap-southeast-1.json"
curl "https://d2stg8d246z9di.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_ap-southeast-2.json"
curl "https://d33vqc0rt9ld30.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_ap-northeast-1.json"
curl "https://d2s8ygphhesbe7.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_ca-central-1.json"
curl "https://cfn-resource-specifications-ca-west-1-prod.s3.ca-west-1.amazonaws.com/latest/CloudFormationResourceSpecification.json" > "CloudFormationResourceSpecification_ca-west-1.json"
curl "https://cfn-resource-specifications-cn-north-1-prod.s3.cn-north-1.amazonaws.com.cn/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_cn-north-1.json"
curl "https://cfn-resource-specifications-cn-northwest-1-prod.s3.cn-northwest-1.amazonaws.com.cn/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_cn-northwest-1.json"
curl "https://d1mta8qj7i28i2.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_eu-central-1.json"
curl "https://d3teyb21fexa9r.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_eu-west-1.json"
curl "https://d1742qcu2c1ncx.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_eu-west-2.json"
curl "https://cfn-resource-specifications-eu-south-1-prod.s3.eu-south-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_eu-south-1.json"
curl "https://d2d0mfegowb3wk.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_eu-west-3.json"
curl "https://cfn-resource-specifications-eu-south-2-prod.s3.eu-south-2.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_eu-south-2.json"
curl "https://diy8iv58sj6ba.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_eu-north-1.json"
curl "https://cfn-resource-specifications-eu-central-2-prod.s3.eu-central-2.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_eu-central-2.json"
curl "https://cfn-resource-specifications-il-central-1-prod.s3.il-central-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_il-central-1.json"
curl "https://cfn-resource-specifications-me-south-1-prod.s3.me-south-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_me-south-1.json"
curl "https://cfn-resource-specifications-me-central-1-prod.s3.me-central-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_me-central-1.json"
curl "https://d3c9jyj3w509b0.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" | gunzip > "CloudFormationResourceSpecification_sa-east-1.json"
curl "https://s3.us-gov-east-1.amazonaws.com/cfn-resource-specifications-us-gov-east-1-prod/latest/CloudFormationResourceSpecification.json" > "CloudFormationResourceSpecification_us-gov-east-1.json"
curl "https://s3.us-gov-west-1.amazonaws.com/cfn-resource-specifications-us-gov-west-1-prod/latest/CloudFormationResourceSpecification.json" > "CloudFormationResourceSpecification_us-gov-west-1.json"
## Get all Resource and if there are Tags defined with their Region
find . -name "CloudFormationResourceSpecification_*-*.json" -print0 | xargs -0 -I{} jq -r '.ResourceTypes | keys_unsorted[] as $resourceKey | { "name": "\($resourceKey)", "tags": ."\($resourceKey)".Properties.Tags } | {"name": .name, "tags": (.tags == null), "region": (input_filename |match(".*\\/(.*)\\.json") | .captures[0].string)}' {} | jq --slurp > ResourceTagsByRegion.json
## Print all resources that have no tags defined in a format for https://github.com/aws-cloudformation/cloudformation-guard exclusions
jq -r '.[]|select(."tags" == false)|.name' ResourceTagsByRegion.json | sort -u | sed -e 's/^/ \//g' | sed -e 's/$/\/,/g' |
Based on October 24, 2024 review
Not ALL resources must have tags, just the DynamoDB Tables.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theTags
property: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