![github-actions[bot]](/assets/img/avatar_default.png)
* 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>
51 lines
1.1 KiB
Plaintext
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[] |