hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.74k stars 9.1k forks source link

[New Resource]: `aws_vpc_security_group_rules_exclusive` #39383

Open jar-b opened 19 hours ago

jar-b commented 19 hours ago

Description

Manage ingress and egress rules assigned to a VPC security group. Related resources:

aws_security_group aws_security_group_rule aws_vpc_security_group_egress_rule aws_vpc_security_group_ingress_rule

Deprecate aws_security_group.ingress and aws_security_group.egress. Consider deprecating aws_security_group_rule entirely.

Requested Resource(s) and/or Data Source(s)

Potential Terraform Configuration

resource "aws_vpc_security_group_rules_exclusive" "example" {
  security_group_id = aws_security_group.example.id
  egress_rule_ids   = [aws_vpc_security_group_egress_rule.example.id]
  ingress_rule_ids  = [aws_vpc_security_group_ingress_rule.example.id]
}

Alternatively, this could be split into two resources to match the ingress/egress rule resource variants:

resource "aws_vpc_security_group_egress_rules_exclusive" "example" {
  security_group_id = aws_security_group.example.id
  rule_ids          = [aws_vpc_security_group_egress_rule.example.id]
}
resource "aws_vpc_security_group_ingress_rules_exclusive" "example" {
  security_group_id = aws_security_group.example.id
  rule_ids          = [aws_vpc_security_group_ingress_rule.example.id]
}

References

github-actions[bot] commented 19 hours ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue