-
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
[New Resource] aws_default_internet_gateway #37899
base: main
Are you sure you want to change the base?
[New Resource] aws_default_internet_gateway #37899
Conversation
Community NoteVoting for Prioritization
For Submitters
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @PeterSzegedi 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
@PeterSzegedi Thanks for the contribution 👏. data "aws_vpc" "default" {
default = true
}
data "aws_internet_gateway" "default" {
filter {
name = "attachment.vpc-id"
values = [data.aws_vpc.default.id]
}
}
import {
to = aws_internet_gateway.default
id = data.aws_internet_gateway.default.id
}
resource "aws_internet_gateway" "default" {
vpc_id = data.aws_vpc.default.id
} Does this fulfill your use case? |
Description
New resource to enable deletion and creation of "default" IGWs.
The reason to have it is to fix issue 23488
Currently the aws_default_vpc resource does not work due to having an IGW attached by default.
The Internet Gateways have no isDefault property on AWS, so there is no way to identify them outside of "if it is attached to a default VPC, it is the default IGW". The logic attributes this in the resource
Relations
Closes #23488.
Relates #3999.
Output from Acceptance Testing