github-actions[bot] f15fa27234
SONARIAC-1869 Create rule S7452 AWS resource tags should have valid format (#4821)
* Create rule S7452

* SONARIAC-1869 Create rule S7452 AWS resource tags should have valid format

---------

Co-authored-by: petertrr <petertrr@users.noreply.github.com>
Co-authored-by: Peter Trifanov <peter.trifanov@sonarsource.com>
2025-03-25 15:32:07 +00:00

51 lines
1.1 KiB
Plaintext

include::../description.adoc[]
== How to fix it
=== Code examples
==== Noncompliant code example
[source,yaml,diff-id=1,diff-type=noncompliant]
----
AWSTemplateFormatVersion: 2010-09-09
Resources:
S3Bucket:
Type: 'AWS::S3::Bucket'
Properties:
BucketName: "mybucketname"
Tags:
- Key: "anycompany;cost-center" # Noncompliant, semicolon is not allowed
Value: "Accounting"
- Key: "anycompany:~EnvironmentType~" # Noncompliant, tilde is not allowed
Value: "PROD"
----
==== Compliant solution
[source,yaml,diff-id=1,diff-type=compliant]
----
AWSTemplateFormatVersion: 2010-09-09
Resources:
S3Bucket:
Type: 'AWS::S3::Bucket'
Properties:
BucketName: "mybucketname"
Tags:
- Key: "anycompany:cost-center"
Value: "Accounting"
- Key: "anycompany:EnvironmentType"
Value: "PROD"
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
endif::env-github,rspecator-view[]