Error while creating network interface : Value (interface) for parameter InterfaceType is invalid.

0

Getting below error while creating network interface even though the interfaceType value is valid. Any ideas in which scenarios such an error can occur

Value (interface) for parameter InterfaceType is invalid. Allowed values are ('EFA') (Service: Ec2, Status Code: 400, Request ID: 4f3221ef-26d5-40e3-b10c-31d15e55e434

  • Could you provide some more details about what you're doing? Perhaps share the CLI command or API you're calling or the CloudFormation template?

  • We are using Aws Java SDK to create a network interface Below is a code snippet:

    var request = CreateNetworkInterfaceRequest.builder().description(networkInterface.getName()) .subnetId(networkInterface.getSubnet().getId()).clientToken(clientToken) .groups(groups);

            if (!(networkInterface.getInterfaceType() == null || networkInterface.getInterfaceType().isBlank())) {
                request.interfaceType(networkInterface.getInterfaceType());
            }
    

    The interface type is "interface" in this case. The strange thing this works for all aws accounts that we use for our testing except one specific one for which we are getting the above error.

    We wanted to understand in which scenarios such an error occurs? Is the interfacetype value account specific? If not why it fails for one account and not for others. As per the AWS documentation "interface" is a valid interfaceType value

Mohit
asked 6 months ago162 views
1 Answer
0

According to https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-networkinterface.html#aws-resource-ec2-networkinterface-properties the allowed values for InterfaceType are branch, efa & trunk. But the default value is interface.

In CloudFormation are you specifically setting the value to interface ? If so then what happens if you leave it blank?

profile picture
EXPERT
Steve_M
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions