-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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 #23625
Comments
EC2-Classic networking has been retired and references to it have been deprecated in the AWS provider - hashicorp/terraform-provider-aws#23625 This change fixes deprecation warnings we started getting - ``` Warning: Argument is deprecated with module.vpc.aws_vpc.default, on ../../modules/vpc-hub/main.tf line 105, in resource "aws_vpc" "default": 105: enable_classiclink = false With the retirement of EC2-Classic the enable_classiclink attribute has been deprecated and will be removed in a future version. ```
My apologies if I'm missing some context, but isn't Phase 2 a massively backward incompatible change? For example, with all Terraform versions so far, it was possible to create a security group with the following code: resource "aws_security_group" "instance" {
name = "example"
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
} Now, with AWS provider 4.29.0, this suddenly produces an error:
That feels like a major breaking change, so shouldn't it be in AWS provider v5 only? Or some other way to indicate that end-users are now going to do a huge refactor to many, many resources? |
One thought: instead of this breaking change, would it be possible to update those resources to automatically use the Default VPC if |
I've decided to file this as a new issue to ensure it gets visibility and isn't lost in a comment thread here: #26666 |
@brikis98 Thanks for raising a separate issue. |
Woohoo! I just tried it out with provider 4.30.0, and it seems to work just fine. Thank you 👍 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Description
On August 15, 2022 AWS will retire EC2-Classic Networking
The provider has always supported EC2-Classic, but inline with this retirement we will remove for support for it in
v5.0
of the provider. At this time we have no date for this next major version, but we expect it to land sometime in 2023.In order to ensure that users are well aware of this change, we will add deprecation notices to resources/attributes which configure elements of EC2-Classic Networking and over time remove the EC2-Classic-specific functionality from the codebase.
New or Affected Resource(s)
aws_eip
aws_eip_association
aws_security_group
aws_default_security_group
aws_vpc
aws_vpc_peering_connection
aws_vpc_peering_connection_accepter
aws_vpc_peering_connection_options
aws_launch_configuration
aws_db_instance
aws_db_security_group
aws_reshift_cluster
aws_redshift_security_group
aws_elasticache_cluster
aws_elasticache_security_group
aws_opsworks_stack
References
Phases
This work will be done in a phased approach with a number of PRs submitted.
Phase 1 - Resource and attribute deprecation
In this phase those resources and attributes which apply only to EC2-Classic functionality will be marked as deprecated, following documented best practices.
Add
DeprecationMessage
to these resources’ schemas (and document):aws_db_security_group
aws_elasticache_security_group
aws_redshift_security_group
Add
Deprecated
to these resource attributes:aws_db_instance.security_group_names
aws_elasticache_cluster.security_group_names
aws_redshift_cluster.cluster_security_groups
aws_launch_configuration.vpc_classic_link_id
aws_launch_configuration.vpc_classic_link_security_groups
aws_vpc.enable_classiclink
aws_vpc.enable_classiclink_dns_support
aws_vpc_peering_connection.allow_classic_link_to_remote_vpc
aws_vpc_peering_connection.allow_vpc_to_remote_classic_link
aws_vpc_peering_connection_accepter.allow_classic_link_to_remote_vpc
aws_vpc_peering_connection_accepter.allow_vpc_to_remote_classic_link
aws_vpc_peering_connection_options.allow_classic_link_to_remote_vpc
aws_vpc_peering_connection_options.allow_vpc_to_remote_classic_link
Phase 2 - Prevent creation of new EC2-Classic resources
In this phase attempting to create new EC2-Classic resources will result in an error during
terraform apply
. Existing EC2-Classic resources can be read, updated and deleted.No new instances of these resources can be created:
aws_db_security_group
aws_elasticache_security_group
aws_redshift_security_group
Creation/update of these resources will be modified:
aws_eip
- Error ifvpc
isfalse
Reverted via resource/aws_eip: Default to default domain when
vpc
not set #26716.aws_security_group
- Error ifvpc_id
is not configuredReverted via resource/aws_security_group: Use default VPC when no VPC ID passed #26697.
aws_vpc
- Error ifenable_classiclink
orenable_classiclink_dns_support
istrue
aws_vpc_peering_connection
- Error ifallow_classic_link_to_remote_vpc
orallow_vpc_to_remote_classic_link
istrue
aws_vpc_peering_connection_accepter
- Error ifallow_classic_link_to_remote_vpc
orallow_vpc_to_remote_classic_link
istrue
aws_vpc_peering_connection_options
- Error ifallow_classic_link_to_remote_vpc
orallow_vpc_to_remote_classic_link
istrue
aws_launch_configuration
- Error ifvpc_classic_link_id
orvpc_classic_link_security_groups
is configuredaws_db_instance
- Error ifsecurity_group_names
is configuredaws_redshift_cluster
- Error ifcluster_security_groups
is configuredaws_elasticache_cluster
- Error ifsecurity_group_names
is configuredaws_opsworks_stack
- Error ifvpc_id
ordefault_subnet_id
is not configuredReverted via resource/aws_opsworks_stack: Use Default VPC when no VPC ID passed #26711.
Phase 3 - Remove acceptance testing infrastructure
The text was updated successfully, but these errors were encountered: