1

Is it possible to tag the embedded NIC in AWS with cloudformation? If not, is it possible to disable the embedded NIC and create a new resource and attach the NIC to the instance as ID 0 or the only network interface?

1 Answer 1

0

It is possible to tag network interfaces in CloudFormation:

This is an example from the documentation with the key/value pair foo/bar:

AWSTemplateFormatVersion: '2010-09-09'
Description: Simple Standalone ENI
Resources:
  myENI:
    Type: AWS::EC2::NetworkInterface
    Properties:
      Tags:
      - Key: foo
        Value: bar
      Description: A nice description.
      SourceDestCheck: 'false'
      GroupSet:
      - sg-75zzz219
      SubnetId: subnet-3z648z53
      PrivateIpAddress: 10.0.0.16

However, it is not possible to tag the embedded network interface, as per documentation. However, you should be able to use the Property DeviceIndex to achieve your ordering. This is an adapted example from the documentation:

AWSTemplateFormatVersion: '2010-09-09'
Description: Simple Standalone ENI
Resources:
  Ec2Instance: 
    Type: "AWS::EC2::Instance"
    Properties: 
      ImageId: 
        Fn::FindInMap: 
          - "RegionMap"
          - Ref: "AWS::Region"
          - "AMI"
      KeyName: 
        Ref: "KeyName"
      NetworkInterfaces: 
        - AssociatePublicIpAddress: "true"
          DeviceIndex: "0"
          GroupSet: 
            - Ref: "myVPCEC2SecurityGroup"
          SubnetId: 
            Ref: "PublicSubnet"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .