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.82k stars 9.17k forks source link

[Bug]: Transfer Family - VPC Endpoint - Swapping Private -> Public Subents #34923

Open SuperP4rks opened 10 months ago

SuperP4rks commented 10 months ago

Terraform Core Version

1.6.6

AWS Provider Version

5.30.0

Affected Resource(s)

aws-transfer-family-server

Expected Behavior

Where running a Terraform Apply, and changing from private to public subnets i would expect the subents to be changes and the EIP's to be associated with the new subnet.

Would be good to note that this did work and not fresh code.

Example Below:

  endpoint_details {
    security_group_ids         = [aws_security_group.this.id]
    address_allocation_ids  = var.public_facing ? var.aws_eip_ids : null
    subnet_ids                       = var.public_facing ? data.aws_subnets.public.ids : data.aws_subnets.private.ids
    vpc_id                              = data.aws_vpc.this.id
  }

I have a feeling AWS maybe changed there API, Looking in the AWS Console there is now and internal and Internet Facing radio button.

image

Actual Behavior

Terraform reports an issue with the subnetids being changed

│ Error: updating Transfer Server (s-xxxxxxxxxxxx): InvalidRequestException: Specified SubnetIds must exist in the server before attaching AddressAllocationIds
│   with aws_transfer_server.this,
│   on main.tf line 1, in resource "aws_transfer_server" "this":
│    1: resource "aws_transfer_server" "this" {

It would be good to reflect and add that when i move from Public back to Private that terraform run acts as expected without issues. Its only when moving from Private -> Public and associating the EIP's

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

N/A

Steps to Reproduce

N/A

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 10 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue