Skip to content

Commit 5f882dd

Browse files
authored
Added detachvolume for BYOVPC (#311)
Added the following actions for cross-account role: * ec2:AllocateAddress * ec2:CreateNatGateway * ec2:CreateRouteTable * ec2:CreateVpcEndpoint * ec2:DeleteDhcpOptions * ec2:DeleteNatGateway * ec2:DeleteVpcEndpoints * ec2:DescribeNatGateways * ec2:DisassociateRouteTable * ec2:ReleaseAddress * ec2:DetachVolume
1 parent 6e7d1a2 commit 5f882dd

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

access/data_aws_policies.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,17 @@ func DataAwsCrossAccountRolicy() *schema.Resource {
8989
"ec2:CreatePlacementGroup",
9090
"ec2:DeletePlacementGroup",
9191
"ec2:DescribePlacementGroups",
92+
"ec2:AllocateAddress",
93+
"ec2:CreateNatGateway",
94+
"ec2:CreateRouteTable",
95+
"ec2:CreateVpcEndpoint",
96+
"ec2:DeleteDhcpOptions",
97+
"ec2:DeleteNatGateway",
98+
"ec2:DeleteVpcEndpoints",
99+
"ec2:DescribeNatGateways",
100+
"ec2:DisassociateRouteTable",
101+
"ec2:ReleaseAddress",
102+
"ec2:DetachVolume",
92103
},
93104
Resources: "*",
94105
},

access/data_aws_policies_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func TestDataAwsCrossAccountRolicy(t *testing.T) {
1616
}.Apply(t)
1717
assert.NoError(t, err)
1818
j := d.Get("json")
19-
assert.Lenf(t, j, 2401, "Strange length for policy: %s", j)
19+
assert.Lenf(t, j, 2759, "Strange length for policy: %s", j)
2020
}
2121

2222
func TestDataAwsCrossAccountRolicy_WithPassRoles(t *testing.T) {
@@ -29,7 +29,7 @@ func TestDataAwsCrossAccountRolicy_WithPassRoles(t *testing.T) {
2929
}.Apply(t)
3030
assert.NoError(t, err)
3131
j := d.Get("json")
32-
assert.Lenf(t, j, 2537, "Strange length for policy: %s", j)
32+
assert.Lenf(t, j, 2895, "Strange length for policy: %s", j)
3333
}
3434

3535
func TestDataAwsAssumeRolePolicy(t *testing.T) {

0 commit comments

Comments
 (0)