You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/deep_checking.md
+17-23Lines changed: 17 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Deep Checking
2
2
3
-
Deep Checking uses your provider's credentials to perform a more strict inspection.
3
+
_Deep checking_ uses your provider's credentials to apply additional checks that require read access to a target AWS account. TFLint will read AWS configuration from a `provider "aws" {}` block or the same environment variables used by the AWS provider.
4
4
5
-
For example, if the IAM profile references something that doesn't exist, terraform apply will fail, which can't be found by general validation. Deep Checking solves this problem.
5
+
For example, the `aws_instance_invalid_iam_profile` rule checks whether a specified IAM profile exists in the target AWS account. This helps detect issues that would result in a failed `terraform plan`.
6
6
7
7
```console
8
8
$ tflint
@@ -15,7 +15,7 @@ Error: "invalid_profile" is invalid IAM profile name. (aws_instance_invalid_iam_
15
15
16
16
```
17
17
18
-
You can enable Deep Checking by changing the plugin configuration.
18
+
You can enable deep checking by enabling `deep_check` in the plugin block:
19
19
20
20
```hcl
21
21
plugin "aws" {
@@ -39,7 +39,7 @@ Credentials can be set in several ways. Each is referenced in the following orde
39
39
40
40
### Static credentials
41
41
42
-
If you have an access key and a secret key, you can pass these keys like the following:
42
+
Access and secret keys can be passed as literals in the plugin or provider configuration:
43
43
44
44
```hcl
45
45
plugin "aws" {
@@ -52,8 +52,6 @@ plugin "aws" {
52
52
}
53
53
```
54
54
55
-
Although there is not recommended, if an access key is hard-coded in a provider configuration, they will also be taken into account. The priority is higher than the environment variable and lower than the above way.
56
-
57
55
```hcl
58
56
provider "aws" {
59
57
region = "us-west-2"
@@ -62,9 +60,11 @@ provider "aws" {
62
60
}
63
61
```
64
62
65
-
### Shared credentials
63
+
However, committing credentials is not recommended.
64
+
65
+
### Shared Credentials
66
66
67
-
If you have [shared credentials](https://aws.amazon.com/jp/blogs/security/a-new-and-standardized-way-to-manage-credentials-in-the-aws-sdks/), you can pass a profile name and credentials file path. If omitted, these will be `default` and `~/.aws/credentials`.
67
+
If you have [shared credentials](https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html), you can pass a profile name and credentials file path. If omitted, these will be `default` and `~/.aws/credentials`.
68
68
69
69
```hcl
70
70
plugin "aws" {
@@ -77,8 +77,6 @@ plugin "aws" {
77
77
}
78
78
```
79
79
80
-
If these configurations are defined in the provider block, they will also be taken into account. But the priority is lower than the above way.
81
-
82
80
```hcl
83
81
provider "aws" {
84
82
region = "us-west-2"
@@ -87,24 +85,20 @@ provider "aws" {
87
85
}
88
86
```
89
87
90
-
### Environment variables
88
+
### Environment Variables
91
89
92
-
This plugin looks up`AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`, `AWS_REGION` environment variables. This is useful when you don't want to explicitly pass credentials.
90
+
This plugin reads the`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_REGION` environment variables.
93
91
94
92
```
95
-
$ export AWS_ACCESS_KEY_ID=AWS_ACCESS_KEY
96
-
$ export AWS_SECRET_ACCESS_KEY=AWS_SECRET_KEY
93
+
export AWS_ACCESS_KEY_ID=AWS_ACCESS_KEY
94
+
export AWS_SECRET_ACCESS_KEY=AWS_SECRET_KEY
97
95
```
98
96
99
-
### Role-based authentication
100
-
101
-
This plugin fetches credentials in the same way as Terraform. See [this documentation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#codebuild-ecs-and-eks-roles) for the role-based authentication.
102
-
103
-
### Assume role
97
+
### Assume Role
104
98
105
-
This plugin can assume a role in the same way as Terraform. See [this documentation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#assume-role).
99
+
This plugin can assume a role using the provider configuration declared in the target module. See [the provider documentation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#assume-role) for examples.
106
100
107
-
You can also declare the assume role config in the plugin config:
101
+
You can also specify a role in the plugin configuration:
108
102
109
103
```hcl
110
104
plugin "aws" {
@@ -118,9 +112,9 @@ plugin "aws" {
118
112
}
119
113
```
120
114
121
-
## Required permissions
115
+
## Required Permissions
122
116
123
-
The following policy document provides the minimal set permissions necessary for the deep checking:
117
+
The following policy document provides the minimal set permissions necessary for deep checking:
0 commit comments