Closed vainkop closed 3 years ago
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
Really? No guidence or on this?
This is what I found
EFA - I believe it's the normal interface https://awscli.amazonaws.com/v2/documentation/api/2.3.2/reference/ec2/create-network-interface.html
Indicates the type of network interface. To create an Elastic Fabric Adapter (EFA), specify efa . For more information, see Elastic Fabric Adapter in the Amazon Elastic Compute Cloud User Guide . To create a trunk network interface, specify efa . For more information, see Network interface trunking in the Amazon Elastic Compute Cloud User Guide .
TRUNK is for ECS/Task Definitions https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-eni.html
Amazon ECS supports launching container instances with increased ENI density using supported Amazon EC2 instance types. When you use these instance types and opt in to the awsvpcTrunking account setting, additional ENIs are available on newly launched container instances. This configuration allows you to place more tasks using the awsvpc network mode on each container instance. Using this feature, a c5.large instance with awsvpcTrunking enabled has an increased ENI limit of twelve. The container instance will have the primary network interface and Amazon ECS creates and attaches a "trunk" network interface to the container instance. So this configuration allows you to launch ten tasks on the container instance instead of the current two tasks.
interfaceType https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_NetworkInterface.html
The type of network interface.
Type: String
Valid Values: interface | natGateway | efa | trunk | load_balancer | network_load_balancer | vpc_endpoint | branch | transit_gateway | lambda | quicksight | global_accelerator_managed | api_gateway_managed | gateway_load_balancer | gateway_load_balancer_endpoint | iot_rules_managed | aws_codestar_connections_managed
Agree this item should be reopened.
This is a bug with terraform itself, please +1 this issue to get more momentum in solving it: https://github.com/hashicorp/terraform-provider-aws/issues/33857
Really? No guidence or on this?
TLDR: remove the attribute, but you might want to remove the interface altogether.
What I did at first was to remove the interface_type
attribute to let the default apply (Elastic something or other). This got rid of the error and created the interface successfully.
Now, in my case, this interface was associated to an EIP (static IP) resource, which in turn was associated to a NAT resource. This whole setup was giving me issues (Terraform error Resource.AlreadyAssociated
), so I ended up removing the interface altogether, since the docs never talk about creating an interface for the NAT.
It turns out that when you do that (leaving just the NAT and EIP, associated via the EIP's allocation_id
), AWS automatically creates a network interface for the NAT, with the right attribute set: interface_type=nat_gateway
I suspect this is the case here. Terraformer's "fault" is in exporting this interface's configuration, but I don't know if it even has a way of knowing this was created automatically, not by the user.
So, if your case is similar to mine, just remove the interface and let AWS create and manage it. Then you don't need to worry about its attributes.
Hi. So I've parsed some AWS infra with Terraformer 0.8.14 (latest atm) using aws provider 3.47.0 (also latest atm) & got some ENIs but when I try to run terraform init + plan on them (0.13.7) I see 3 types of errors:
load_balancer
,interface
&nat_gateway
instead ofefa
,branch
ortrunk
expected by Terraform inaws_network_interface
resourceAnd then I check the AWS console & see that those types are real (see screenshots).
Is it a bug in Terraformer?
Should I pin the aws provider for it to different version (but I'm doing terraform init for terraformer first & for the resulting code & I can see same aws provider version 3.47.0 used so they match) ?
Am I missing something here?