-
Notifications
You must be signed in to change notification settings - Fork 72
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
aws_elasticache_replication_group #143
aws_elasticache_replication_group #143
Conversation
…ests fir aws_elasticache_replication_group # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # Date: Mon Jul 19 15:34:06 2021 -0400 # # On branch aws_elasticache_replication_group # Changes to be committed: # modified: docs/rules/aws_elasticache_cluster_default_parameter_group.md # new file: docs/rules/aws_elasticache_replication_group_default_parameter_group.md # new file: rules/aws_elasticache_replication_group_default_parameter_group.go # new file: rules/aws_elasticache_replication_group_default_parameter_group_test.go # new file: rules/aws_elasticache_replication_group_invalid_type.go # new file: rules/aws_elasticache_replication_group_invalid_type_test.go #
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
If you want to add a new rule, you need to register the rule in rules/provider.go
and update the docs/rules/README.md
. Please refer to #101
Also, You can use the generator to automate the work required to add new rules. See also here:
https://github.com/terraform-linters/tflint-ruleset-aws#add-a-new-rule
Thank you for your contribution :)
return project.ReferenceLink(r.Name()) | ||
} | ||
|
||
var defaultElastiCacheParameterGroupRegexp = regexp.MustCompile("^default") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The defaultElastiCacheParameterGroupRegexp
is already declared in here:
var defaultElastiCacheParameterGroupRegexp = regexp.MustCompile("^default") |
Perhaps it's better to declare a variable name for this rule here.
@wata727 I would like to also add in the rules for invalid parameter group, security group, and subnet group. However, I am not sure if I should try to add these into the API folder or not. I tried running Are you wanting these rules inside the API folder and if so how would I go about creating these? If not am I good to create them with the same process as the rules I just added. |
The rules under the These rules are automatically generated from definition files and you need to add a definition file like https://github.com/terraform-linters/tflint-ruleset-aws/blob/ef81b2ce272c396443598c6f37afa60b595f08c6/rules/api/definitions/aws_elasticache_cluster.hcl. However, this is a bit complicated, so it seems good to get it out of the scope of this PR.
Oops, this seems like a bug... |
👍 |
Sorry, it is wrong. You can run this generator like the following: cd rules/api
go run -tags generators ./generator |
resourceType: "aws_elasticache_replication_group", | ||
attributeName: "node_type", | ||
nodeTypes: map[string]bool{ | ||
"cache.t2.micro": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list could probably be shared with the same list here:
"cache.t2.micro": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes #140
Adds rules for aws_elasticcache_replication_group resource