Skip to content

Commit 43f7450

Browse files
authored
docs: copy edits for deep check (#477)
1 parent 6051809 commit 43f7450

File tree

1 file changed

+17
-23
lines changed

1 file changed

+17
-23
lines changed

docs/deep_checking.md

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Deep Checking
22

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.
44

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`.
66

77
```console
88
$ tflint
@@ -15,7 +15,7 @@ Error: "invalid_profile" is invalid IAM profile name. (aws_instance_invalid_iam_
1515

1616
```
1717

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:
1919

2020
```hcl
2121
plugin "aws" {
@@ -39,7 +39,7 @@ Credentials can be set in several ways. Each is referenced in the following orde
3939

4040
### Static credentials
4141

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:
4343

4444
```hcl
4545
plugin "aws" {
@@ -52,8 +52,6 @@ plugin "aws" {
5252
}
5353
```
5454

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-
5755
```hcl
5856
provider "aws" {
5957
region = "us-west-2"
@@ -62,9 +60,11 @@ provider "aws" {
6260
}
6361
```
6462

65-
### Shared credentials
63+
However, committing credentials is not recommended.
64+
65+
### Shared Credentials
6666

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`.
6868

6969
```hcl
7070
plugin "aws" {
@@ -77,8 +77,6 @@ plugin "aws" {
7777
}
7878
```
7979

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-
8280
```hcl
8381
provider "aws" {
8482
region = "us-west-2"
@@ -87,24 +85,20 @@ provider "aws" {
8785
}
8886
```
8987

90-
### Environment variables
88+
### Environment Variables
9189

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.
9391

9492
```
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
9795
```
9896

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
10498

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.
106100

107-
You can also declare the assume role config in the plugin config:
101+
You can also specify a role in the plugin configuration:
108102

109103
```hcl
110104
plugin "aws" {
@@ -118,9 +112,9 @@ plugin "aws" {
118112
}
119113
```
120114

121-
## Required permissions
115+
## Required Permissions
122116

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:
124118

125119
```json
126120
{

0 commit comments

Comments
 (0)