Skip to content
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 aws_nat_gateway #134

Merged
merged 2 commits into from
Jan 21, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/cmd/scan/supported_resources/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ As AWS documentation recommends, the below policy is granting only the permissio
"ec2:DescribeVpcClassicLink",
"ec2:DescribeVpcClassicLinkDnsSupport",
"ec2:DescribeSubnets",
"ec2:DescribeNatGateways",
"iam:GetPolicy",
"iam:GetPolicyVersion",
"iam:GetRole",
Expand Down Expand Up @@ -212,3 +213,4 @@ As AWS documentation recommends, the below policy is granting only the permissio
- [x] aws_default_route_table
- [x] aws_route
- [x] aws_route_table_association
- [x] aws_nat_gateway
1 change: 1 addition & 0 deletions pkg/driftctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (d DriftCTL) Run() *analyser.Analysis {
middlewares.NewAwsRouteTableExpander(),
middlewares.NewAwsDefaultRouteTable(),
middlewares.NewAwsDefaultRoute(),
middlewares.NewAwsNatGatewayEipAssoc(),
)

logrus.Debug("Ready to run middlewares")
Expand Down
1 change: 1 addition & 0 deletions pkg/iac/deserializers.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ func Deserializers() []deserializer.CTYDeserializer {
awsdeserializer.NewRouteTableDeserializer(),
awsdeserializer.NewRouteDeserializer(),
awsdeserializer.NewRouteTableAssociationDeserializer(),
awsdeserializer.NewNatGatewayDeserializer(),
}
}
1 change: 1 addition & 0 deletions pkg/iac/terraform/state/terraform_state_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func TestTerraformStateReader_Resources(t *testing.T) {
{name: "route table", dirName: "route_table", wantErr: false},
{name: "route", dirName: "route", wantErr: false},
{name: "route table associations", dirName: "route_assoc", wantErr: false},
{name: "NAT gateway", dirName: "aws_nat_gateway", wantErr: false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
13 changes: 13 additions & 0 deletions pkg/iac/terraform/state/test/aws_nat_gateway/result.golden.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"AllocationId": "eipalloc-0f3e9fff457bb770b",
"Id": "nat-0a5408508b19ef490",
"NetworkInterfaceId": "eni-0a5125861e3328c7d",
"PrivateIp": "172.31.84.248",
"PublicIp": "54.87.245.115",
"SubnetId": "subnet-44fe0c65",
"Tags": {
"Name": "nat1"
}
}
]
Loading