-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathrequest_quota_increase_test.go
52 lines (41 loc) · 1.57 KB
/
request_quota_increase_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package test
import (
"testing"
"github.com/gruntwork-io/terratest/modules/aws"
"github.com/gruntwork-io/terratest/modules/terraform"
"github.com/stretchr/testify/assert"
)
type (
QuotaAndServiceName struct {
QuotaName string `json:"quota_name"`
QuotaCode string `json:"quota_code"`
ServiceName string `json:"service_name"`
ServiceCode string `json:"service_code"`
}
QuotaIncreaseOutput struct {
NatGateway QuotaAndServiceName `json:"vpc_nat_gateways_per_availability_zone"`
NaclRules QuotaAndServiceName `json:"vpc_rules_per_network_acl"`
}
)
func TestRequestQuotaIncrease(t *testing.T) {
t.Parallel()
awsRegion := aws.GetRandomRegion(t, nil, nil)
terraformOptions := &terraform.Options{
TerraformDir: "../examples/request-quota-increase",
Vars: map[string]interface{}{
"aws_region": awsRegion,
},
}
defer terraform.Destroy(t, terraformOptions)
terraform.InitAndApply(t, terraformOptions)
output := QuotaIncreaseOutput{}
terraform.OutputStruct(t, terraformOptions, "new_quotas", &output)
assert.Equal(t, output.NatGateway.QuotaName, "NAT gateways per Availability Zone")
assert.Equal(t, output.NatGateway.ServiceName, "Amazon Virtual Private Cloud (Amazon VPC)")
assert.Equal(t, output.NatGateway.ServiceCode, "vpc")
assert.Equal(t, output.NatGateway.QuotaCode, "L-FE5A380F")
assert.Equal(t, output.NaclRules.QuotaName, "Rules per network ACL")
assert.Equal(t, output.NaclRules.ServiceName, "Amazon Virtual Private Cloud (Amazon VPC)")
assert.Equal(t, output.NaclRules.ServiceCode, "vpc")
assert.Equal(t, output.NaclRules.QuotaCode, "L-2AEEBF1A")
}