Skip to content

Commit

Permalink
Merge pull request #29607 from hashicorp/b-aws_default_vpc.enable_net…
Browse files Browse the repository at this point in the history
…work_address_usage_metrics

r/aws_default_vpc: Change `enable_network_address_usage_metrics` to Optional+Computed
  • Loading branch information
ewbankkit authored Feb 23, 2023
2 parents c44a5b9 + f47ddee commit 328d3d3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .changelog/29607.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_default_vpc: Change `enable_network_address_usage_metrics` to Optional+Computed, matching the `aws_vpc` resource
```
2 changes: 1 addition & 1 deletion internal/service/ec2/vpc_default_vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func ResourceDefaultVPC() *schema.Resource {
"enable_network_address_usage_metrics": {
Type: schema.TypeBool,
Optional: true,
Default: true,
Computed: true,
},
"existing_default_vpc": {
Type: schema.TypeBool,
Expand Down
8 changes: 4 additions & 4 deletions internal/service/ec2/vpc_default_vpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func testAccDefaultVPC_Existing_basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "enable_classiclink_dns_support", "false"),
resource.TestCheckResourceAttr(resourceName, "enable_dns_hostnames", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_dns_support", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "false"),
resource.TestCheckResourceAttr(resourceName, "existing_default_vpc", "true"),
resource.TestCheckResourceAttr(resourceName, "force_destroy", "false"),
resource.TestCheckResourceAttr(resourceName, "instance_tenancy", "default"),
Expand Down Expand Up @@ -150,7 +150,7 @@ func testAccDefaultVPC_Existing_assignGeneratedIPv6CIDRBlock(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "enable_classiclink_dns_support", "false"),
resource.TestCheckResourceAttr(resourceName, "enable_dns_hostnames", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_dns_support", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "false"),
resource.TestCheckResourceAttr(resourceName, "existing_default_vpc", "true"),
resource.TestCheckResourceAttr(resourceName, "force_destroy", "false"),
resource.TestCheckResourceAttr(resourceName, "instance_tenancy", "default"),
Expand Down Expand Up @@ -227,7 +227,7 @@ func testAccDefaultVPC_NotFound_basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "enable_classiclink_dns_support", "false"),
resource.TestCheckResourceAttr(resourceName, "enable_dns_hostnames", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_dns_support", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "false"),
resource.TestCheckResourceAttr(resourceName, "existing_default_vpc", "false"),
resource.TestCheckResourceAttr(resourceName, "force_destroy", "false"),
resource.TestCheckResourceAttr(resourceName, "instance_tenancy", "default"),
Expand Down Expand Up @@ -276,7 +276,7 @@ func testAccDefaultVPC_NotFound_assignGeneratedIPv6CIDRBlock(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "enable_classiclink_dns_support", "false"),
resource.TestCheckResourceAttr(resourceName, "enable_dns_hostnames", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_dns_support", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_network_address_usage_metrics", "false"),
resource.TestCheckResourceAttr(resourceName, "existing_default_vpc", "false"),
resource.TestCheckResourceAttr(resourceName, "force_destroy", "false"),
resource.TestCheckResourceAttr(resourceName, "instance_tenancy", "default"),
Expand Down
1 change: 0 additions & 1 deletion website/docs/r/default_vpc.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ The arguments of an `aws_default_vpc` differ slightly from those of [`aws_vpc`](

* The `cidr_block` and `instance_tenancy` arguments become computed attributes
* The default value for `enable_dns_hostnames` is `true`
* The default value for `enable_network_address_usage_metrics` is `true`

The following additional arguments are supported:

Expand Down

0 comments on commit 328d3d3

Please sign in to comment.