Why is this an issue?
Shared conventions allow teams to collaborate effectively. This rule allows to check that all tag keys match a provided regular expression.
Noncompliant code example
With default provided regular expression ^([A-Z]:)([A-Z][A-Za-z]*)$:
AWSTemplateFormatVersion: 2010-09-09
Resources:
S3Bucket:
Type: 'AWS::S3::Bucket'
Properties:
BucketName: "mybucketname"
Tags:
- Key: "anycompany:cost-center" # Noncompliant
Value: "Accounting"
- Key: "anycompany:EnvironmentType" # Noncompliant
Value: "PROD"
Compliant solution
AWSTemplateFormatVersion: 2010-09-09
Resources:
S3Bucket:
Type: 'AWS::S3::Bucket'
Properties:
BucketName: "mybucketname"
Tags:
- Key: "Anycompany:CostCenter"
Value: "Accounting"
- Key: "Anycompany:EnvironmentType"
Value: "PROD"
Resources