Skip to content

Commit b71dcb6

Browse files
authored
Add document for aws_db_instance_invalid_type (#63)
ref: #61 (comment) Co-authored-by: kondo takeshi <[email protected]>
1 parent 6893c81 commit b71dcb6

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

docs/rules/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ These rules warn of possible errors that can occur at `terraform apply`. Rules m
1414
|[aws_db_instance_invalid_engine](aws_db_instance_invalid_engine.md)||
1515
|aws_db_instance_invalid_option_group||
1616
|aws_db_instance_invalid_parameter_group||
17-
|aws_db_instance_invalid_type||
17+
|[aws_db_instance_invalid_type](aws_db_instance_invalid_type.md)||
1818
|aws_db_instance_invalid_vpc_security_group||
1919
|aws_elasticache_cluster_invalid_parameter_group||
2020
|aws_elasticache_cluster_invalid_security_group||
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# aws_db_instance_invalid_type
2+
3+
Disallow using invalid type.
4+
5+
## Example
6+
7+
```hcl
8+
resource "aws_db_instance" "default" {
9+
allocated_storage = 20
10+
engine = "mysql"
11+
engine_version = "5.7"
12+
instance_class = "db.t1.micro" // invalid type!
13+
name = "mydb"
14+
username = "foo"
15+
password = "bar"
16+
db_subnet_group_name = "my_database_subnet_group"
17+
parameter_group_name = "default.mysql5.6"
18+
}
19+
```
20+
21+
```
22+
$ tflint
23+
1 issue(s) found:
24+
25+
Warning: "db.t1.micro" is previous generation instance type. (aws_db_instance_previous_type)
26+
27+
on template.tf line 5:
28+
5: instance_class = "db.t1.micro" // invalid type!
29+
30+
```
31+
32+
## Why
33+
34+
Apply will fail. (Plan will succeed with the invalid value though)
35+
36+
## How To Fix
37+
38+
Select valid type according to the [document](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html#Concepts.DBInstanceClass.Types)
39+

0 commit comments

Comments
 (0)