diff --git a/.changelog/29607.txt b/.changelog/29607.txt new file mode 100644 index 00000000000..12bf1f919df --- /dev/null +++ b/.changelog/29607.txt @@ -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 +``` \ No newline at end of file diff --git a/internal/service/ec2/vpc_default_vpc.go b/internal/service/ec2/vpc_default_vpc.go index 88824217672..4dd122175c2 100644 --- a/internal/service/ec2/vpc_default_vpc.go +++ b/internal/service/ec2/vpc_default_vpc.go @@ -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, diff --git a/internal/service/ec2/vpc_default_vpc_test.go b/internal/service/ec2/vpc_default_vpc_test.go index b2a9d70c25e..bc58c46976c 100644 --- a/internal/service/ec2/vpc_default_vpc_test.go +++ b/internal/service/ec2/vpc_default_vpc_test.go @@ -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"), @@ -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"), @@ -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"), @@ -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"), diff --git a/website/docs/r/default_vpc.html.markdown b/website/docs/r/default_vpc.html.markdown index 09297c57602..5acd0b443ca 100644 --- a/website/docs/r/default_vpc.html.markdown +++ b/website/docs/r/default_vpc.html.markdown @@ -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: