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

EC2-Classic retirement: Remove deprecated resources and attributes #30966

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4f67f5c
r/aws_db_security_group: Remove resource.
ewbankkit Apr 25, 2023
d9dcae5
r/aws_elasticache_security_group: Remove resource.
ewbankkit Apr 25, 2023
18bc395
r/aws_redshift_security_group: Remove resource.
ewbankkit Apr 25, 2023
491377d
r/aws_db_instance: Remove 'security_group_names'.
ewbankkit Apr 25, 2023
0439418
d/aws_db_instance: Remove 'db_security_groups'.
ewbankkit Apr 25, 2023
a2d67ef
r/aws_elasticache_cluster: Remove 'security_group_names'.
ewbankkit Apr 25, 2023
6a2def1
Correct CHANGELOG file name.
ewbankkit Apr 25, 2023
ede2b39
Remove mention of 'EC2 Classic' and dead link.
ewbankkit Apr 25, 2023
dde3583
d/aws_elasticache_cluster: Remove 'security_group_names'.
ewbankkit Apr 25, 2023
dea5e91
r/aws_redshift_cluster: Remove 'cluster_security_groups'.
ewbankkit Apr 25, 2023
abae108
d/aws_redshift_cluster: Remove 'cluster_security_groups'.
ewbankkit Apr 25, 2023
9c6469a
r/aws_launch_configuration: Remove 'vpc_classic_link_id' and 'vpc_cla…
ewbankkit Apr 25, 2023
2f3c827
d/aws_launch_configuration: Remove 'vpc_classic_link_id' and 'vpc_cla…
ewbankkit Apr 25, 2023
06b157c
r/aws_vpc_peering_connection: Remove 'allow_classic_link_to_remote_vp…
ewbankkit Apr 25, 2023
065c0c7
r/aws_vpc_peering_connection_accepter: Remove 'allow_classic_link_to_…
ewbankkit Apr 25, 2023
7973386
r/aws_vpc_peering_connection_options: Remove 'allow_classic_link_to_r…
ewbankkit Apr 25, 2023
0f5d3d6
d/aws_vpc_peering_connection: Remove 'allow_classic_link_to_remote_vp…
ewbankkit Apr 25, 2023
80e964b
r/aws_vpc_peering_connection: Check Options is not nil before calling…
ewbankkit Apr 25, 2023
b857b6c
r/aws_vpc: Remove 'enable_classiclink' and 'enable_classiclink_dns_su…
ewbankkit Apr 25, 2023
7843210
r/aws_default_vpc: Remove 'enable_classiclink' and 'enable_classiclin…
ewbankkit Apr 25, 2023
ba76461
r/aws_default_vpc: Fix crash 'panic: interface conversion: interface …
ewbankkit Apr 25, 2023
009c814
Fix 'TestAccVPC_assignGeneratedIPv6CIDRBlockWithNetworkBorderGroup'.
ewbankkit Apr 25, 2023
e176e9b
Fix providerlint 'AWSAR003'.
ewbankkit Apr 26, 2023
f8bdac6
r/aws_eip: Remove support for standard domain.
ewbankkit Apr 26, 2023
fce8e75
r/aws_eip_association: Remove support for standard domain.
ewbankkit Apr 26, 2023
c27c6a0
r/aws_security_group: Remove support for non-VPC security groups.
ewbankkit Apr 26, 2023
04f4a70
r/aws_security_group_rule: Remove support for non-VPC security groups.
ewbankkit Apr 26, 2023
ea9eb1d
Remove 'TestExpandIPPerms_nonVPC'.
ewbankkit Apr 26, 2023
acc0171
r/aws_elastic_beanstalk_environment: Remove support for non-VPC secur…
ewbankkit Apr 26, 2023
307a934
Tweak documentation for 'aws_autoscaling_group.availability_zones'.
ewbankkit Apr 26, 2023
ed3910a
Fix golangci-lint 'whitespace'.
ewbankkit Apr 26, 2023
77c50a2
Fix golangci-lint 'staticcheck'.
ewbankkit Apr 26, 2023
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
87 changes: 87 additions & 0 deletions .changelog/30966.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
```release-note:breaking-change
provider: With the retirement of EC2-Classic the `aws_db_security_group` resource has been removed
```

```release-note:breaking-change
provider: With the retirement of EC2-Classic the `aws_elasticache_security_group` resource has been removed
```

```release-note:breaking-change
provider: With the retirement of EC2-Classic the `aws_redshift_security_group` resource has been removed
```

```release-note:breaking-change
resource/aws_db_instance: With the retirement of EC2-Classic the `security_group_names` attribute has been removed
```

```release-note:breaking-change
data-source/aws_db_instance: With the retirement of EC2-Classic the `db_security_groups` attribute has been removed
```

```release-note:breaking-change
resource/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed
```

```release-note:breaking-change
data-source/aws_elasticache_cluster: With the retirement of EC2-Classic the `security_group_names` attribute has been removed
```

```release-note:breaking-change
resource/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed
```

```release-note:breaking-change
data-source/aws_redshift_cluster: With the retirement of EC2-Classic the `cluster_security_groups` attribute has been removed
```

```release-note:breaking-change
resource/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed
```

```release-note:breaking-change
data-source/aws_launch_configuration: With the retirement of EC2-Classic the `vpc_classic_link_id` and `vpc_classic_link_security_groups` attributes have been removed
```

```release-note:breaking-change
resource/aws_vpc_peering_connection: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed
```

```release-note:breaking-change
resource/aws_vpc_peering_connection_accepter: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed
```

```release-note:breaking-change
resource/aws_vpc_peering_connection_options: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed
```

```release-note:breaking-change
data-source/aws_vpc_peering_connection: With the retirement of EC2-Classic the `allow_classic_link_to_remote_vpc` and `allow_vpc_to_remote_classic_link` attributes have been removed
```

```release-note:bug
resource/aws_vpc_peering_connection: Fix crash in `vpcPeeringConnectionOptionsEqual`
```

```release-note:breaking-change
resource/aws_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed
```

```release-note:breaking-change
resource/aws_default_vpc: With the retirement of EC2-Classic the `enable_classiclink` and `enable_classiclink_dns_support` attributes have been removed
```

```release-note:breaking-change
resource/aws_eip: With the retirement of EC2-Classic the `standard` domain is no longer supported
```

```release-note:breaking-change
resource/aws_eip_association: With the retirement of EC2-Classic the `standard` domain is no longer supported
```

```release-note:breaking-change
resource/aws_security_group: With the retirement of EC2-Classic non-VPC security groups are no longer supported
```

```release-note:breaking-change
resource/aws_security_group_rule: With the retirement of EC2-Classic non-VPC security groups are no longer supported
```
23 changes: 0 additions & 23 deletions internal/service/autoscaling/launch_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,19 +309,6 @@ func ResourceLaunchConfiguration() *schema.Resource {
return
},
},
"vpc_classic_link_id": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Deprecated: `With the retirement of EC2-Classic the vpc_classic_link_id attribute has been deprecated and will be removed in a future version.`,
},
"vpc_classic_link_security_groups": {
Type: schema.TypeSet,
Optional: true,
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
Deprecated: `With the retirement of EC2-Classic the vpc_classic_link_security_groups attribute has been deprecated and will be removed in a future version.`,
},
},
}
}
Expand All @@ -331,14 +318,6 @@ func resourceLaunchConfigurationCreate(ctx context.Context, d *schema.ResourceDa
autoscalingconn := meta.(*conns.AWSClient).AutoScalingConn()
ec2conn := meta.(*conns.AWSClient).EC2Conn()

if _, ok := d.GetOk("vpc_classic_link_id"); ok {
return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic no new Auto Scaling Launch Configurations can be created referencing ClassicLink`)
}

if v, ok := d.GetOk("vpc_classic_link_security_groups"); ok && v.(*schema.Set).Len() > 0 {
return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic no new Auto Scaling Launch Configurations can be created referencing ClassicLink`)
}

lcName := create.Name(d.Get("name").(string), d.Get("name_prefix").(string))
input := autoscaling.CreateLaunchConfigurationInput{
EbsOptimized: aws.Bool(d.Get("ebs_optimized").(bool)),
Expand Down Expand Up @@ -497,8 +476,6 @@ func resourceLaunchConfigurationRead(ctx context.Context, d *schema.ResourceData
d.Set("user_data", userDataHashSum(v))
}
}
d.Set("vpc_classic_link_id", lc.ClassicLinkVPCId)
d.Set("vpc_classic_link_security_groups", aws.StringValueSlice(lc.ClassicLinkVPCSecurityGroups))

rootDeviceName, err := findImageRootDeviceName(ctx, ec2conn, d.Get("image_id").(string))

Expand Down
11 changes: 0 additions & 11 deletions internal/service/autoscaling/launch_configuration_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,6 @@ func DataSourceLaunchConfiguration() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"vpc_classic_link_id": {
Type: schema.TypeString,
Computed: true,
},
"vpc_classic_link_security_groups": {
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
},
}
}
Expand Down Expand Up @@ -232,8 +223,6 @@ func dataSourceLaunchConfigurationRead(ctx context.Context, d *schema.ResourceDa
d.Set("security_groups", aws.StringValueSlice(lc.SecurityGroups))
d.Set("spot_price", lc.SpotPrice)
d.Set("user_data", lc.UserData)
d.Set("vpc_classic_link_id", lc.ClassicLinkVPCId)
d.Set("vpc_classic_link_security_groups", aws.StringValueSlice(lc.ClassicLinkVPCSecurityGroups))

rootDeviceName, err := findImageRootDeviceName(ctx, ec2conn, d.Get("image_id").(string))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ func TestAccAutoScalingLaunchConfigurationDataSource_basic(t *testing.T) {
resource.TestCheckResourceAttrPair(datasourceName, "spot_price", resourceName, "spot_price"),
// Resource and data source user_data have differing representations in state.
resource.TestCheckResourceAttrSet(datasourceName, "user_data"),
resource.TestCheckResourceAttrPair(datasourceName, "vpc_classic_link_id", resourceName, "vpc_classic_link_id"),
resource.TestCheckResourceAttrPair(datasourceName, "vpc_classic_link_security_groups.#", resourceName, "vpc_classic_link_security_groups.#"),
),
},
},
Expand Down
2 changes: 0 additions & 2 deletions internal/service/autoscaling/launch_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ func TestAccAutoScalingLaunchConfiguration_basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "spot_price", ""),
resource.TestCheckNoResourceAttr(resourceName, "user_data"),
resource.TestCheckNoResourceAttr(resourceName, "user_data_base64"),
resource.TestCheckResourceAttr(resourceName, "vpc_classic_link_id", ""),
resource.TestCheckResourceAttr(resourceName, "vpc_classic_link_security_groups.#", "0"),
),
},
{
Expand Down
10 changes: 9 additions & 1 deletion internal/service/ec2/ec2_availability_zone_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"regexp"
"testing"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-provider-aws/internal/acctest"
Expand Down Expand Up @@ -187,7 +188,7 @@ func TestAccEC2AvailabilityZoneDataSource_zoneID(t *testing.T) {
})
}

func testAccPreCheckLocalZoneAvailable(ctx context.Context, t *testing.T) {
func testAccPreCheckLocalZoneAvailable(ctx context.Context, t *testing.T, groupNames ...string) {
conn := acctest.Provider.Meta().(*conns.AWSClient).EC2Conn()

input := &ec2.DescribeAvailabilityZonesInput{
Expand All @@ -197,6 +198,13 @@ func testAccPreCheckLocalZoneAvailable(ctx context.Context, t *testing.T) {
}),
}

if len(groupNames) > 0 {
input.Filters = append(input.Filters, &ec2.Filter{
Name: aws.String("group-name"),
Values: aws.StringSlice(groupNames),
})
}

output, err := tfec2.FindAvailabilityZones(ctx, conn, input)

if acctest.PreCheckSkipError(err) {
Expand Down
Loading