generated from terraform-linters/tflint-ruleset-template
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add additional resources as-per README instructions
- Loading branch information
1 parent
bf97eec
commit 526d22f
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# aws_resource_invalid_tags | ||
|
||
Require tags to be assigned to a specific set of values. | ||
|
||
## Example | ||
|
||
```hcl | ||
rule "aws_resource_invalid_tags" { | ||
enabled = true | ||
tags = { | ||
Department = ["finance", "hr", "payments", "engineering"] | ||
Environment = ["sandbox", "staging", "production"] | ||
} | ||
exclude = ["aws_autoscaling_group"] | ||
} | ||
provider "aws" { | ||
... | ||
default_tags { | ||
tags = { Environment = "sandbox" } | ||
} | ||
} | ||
resource "aws_s3_bucket" "bucket" { | ||
... | ||
tags = { Project: "homepage", Department = "science" } | ||
} | ||
``` | ||
|
||
``` | ||
$ tflint | ||
1 issue(s) found: | ||
Notice: aws_s3_bucket.bucket Received 'science' for tag 'Department', expected one of 'finance,hr,payments,engineering'. | ||
on test.tf line 3: | ||
3: tags = { Project: "homepage", Department = "science" } | ||
``` | ||
|
||
## Why | ||
|
||
Enforce standard tag values across all resources. | ||
|
||
## How To Fix | ||
|
||
Align the provider, resource or autoscaling group tags to the configured expectation. |
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