-
Notifications
You must be signed in to change notification settings - Fork 75
Add lint for db_instance's engine attribute #61
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
Add lint for db_instance's engine attribute #61
Conversation
5ec6e63
to
2c3528c
Compare
@wata727 |
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.
I left a suggestion but looks good overall 👍
|
||
// Link returns the rule reference link | ||
func (r *AwsDBInstanceInvalidEngineRule) Link() string { | ||
return project.ReferenceLink(r.Name()) |
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 rule doesn't have documentation, so it's better to return an empty string instead.
By the way, the aws_db_instance_invalid_type
rule also returns a link, but since there is no documentation, it seems that this should also return an empty string... 😓
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.
Understand, cool 🆒
https://github.com/terraform-linters/tflint-ruleset-aws/blob/master/project/main.go#L10
https://github.com/terraform-linters/tflint-ruleset-aws/tree/v0.2.1/docs/rules
I will add a document for the rule 👍
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.
Addressed 👍 6a9575c
How about this?
5d47eee
to
6a9575c
Compare
docs/rules/README.md
Outdated
@@ -52,6 +53,7 @@ These rules warn of possible errors that can occur at `terraform apply`. Rules m | |||
These rules suggest to better ways. | |||
|
|||
- [aws_instance_previous_type](aws_instance_previous_type.md) | |||
- [aws_db_instance_invalid_engine](aws_db_instance_invalid_engine.md) |
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.
It's listed above as possible errors, so we don't need to list it here.
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.
Addressed. 1a8a656
aws_db_instance_invalid_engine is rule that warn of possible errors that can occur at `terraform apply`. So it should be in Possible Errors section.
Ah, maybe need to add here? tflint-ruleset-aws/rules/provider.go Line 9 in 6a9575c
|
Added some fixes. and I tested in my local. $ cat main.tf
resource "aws_db_instance" "default" {
allocated_storage = 20
storage_type = "gp2"
engine = "mysql57"
engine_version = "5.7"
instance_class = "db.t2.micro"
name = "mydb"
username = "foo"
password = "foobarbaz"
}
👍 Ready for the review again! |
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.
👍
ref: #61 (comment) Co-authored-by: kondo takeshi <chaspy@users.noreply.github.com>
Wish these could also be pulled from the SDK :/ |
ref: #60