AWS Amazon EC2 Network Interface

This page shows how to write Terraform and CloudFormation for Amazon EC2 Network Interface and write them securely.

aws_network_interface (Terraform)

The Network Interface in Amazon EC2 can be configured in Terraform with the resource name aws_network_interface. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

nif.tf#L1
resource "aws_network_interface" "eni-07903ed53602539c4" {
    subnet_id         = "subnet-954376f3"
    private_ips       = ["172.31.1.180"]
    security_groups   = ["sg-0683a33325f2291ab"]
    source_dest_check = true
    attachment {
nif.tf#L9
resource "aws_network_interface" "eni-dev-petrol-eu-central-1c-erp-ecs" { //  //06024d33c1dcb2d85
    // "aws_subnet" "subnet-dev-petrol-eu-central-1c"
    subnet_id         = aws_subnet.subnet-dev-petrol-eu-central-1c.id //"subnet-071ac2d8a7a790495"
    private_ips       = ["172.31.4.66"]
    security_groups   = [aws_security_group.sg-dt-srv-erp-petrol-dev-ecs.id] // ["sg-05c9a73a6a164d7f7"]
    source_dest_check = true
main.tf#L124
resource "aws_network_interface" "NginX-public" {
  subnet_id       = aws_subnet.Brokenbyte-outside.id
  #private_ips     = ["192.168.100.10"]
  security_groups = [aws_security_group.allow_traffic.id]
}

eni.tf#L1
resource "aws_network_interface" "mgmt" {
  subnet_id       = module.vpc.public_subnets[0]
  private_ips     = ["10.0.1.10"]
  security_groups = [aws_security_group.mgmt.id]
}

node-interfaces.tf#L1
resource "aws_network_interface" "master_public_network_interface" {
  subnet_id       = var.public_subnet_id
  security_groups = [aws_security_group.nodes.id]
}

resource "aws_network_interface" "worker_public_network_interface" {

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides an Elastic network interface (ENI) resource.

Tips: Best Practices for The Other AWS Amazon EC2 Resources

In addition to the aws_default_vpc, AWS Amazon EC2 has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.

risk-label

aws_default_vpc

Ensure to avoid using default VPC

It is better to define the own VPC and use it.

risk-label

aws_network_acl_rule

Ensure your network ACL rule blocks unwanted inbound traffic

It is better to block unwanted inbound traffic.

risk-label

aws_ebs_volume

Ensure to use a customer-managed key for EBS volume encryption

It is better to use a customer-managed key for EBS volume encryption. It can be gain more control over the encryption by using customer-managed keys (CMK).

risk-label

aws_instance

Ensure to avoid storing AWS access keys in user data

It is better to avoid storing AWS access keys in user data. `aws_iam_instance_profile` could be used instead.

risk-label

aws_security_group

Ensure your security group blocks unwanted inbound traffic

It is better to block unwanted inbound traffic.

Review your AWS Amazon EC2 settings

In addition to the above, there are other security points you should be aware of making sure that your .tf files are protected in Shisho Cloud.

AWS::EC2::NetworkInterface (CloudFormation)

The NetworkInterface in EC2 can be configured in CloudFormation with the resource name AWS::EC2::NetworkInterface. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

elasticsearch.yml#L84
    Type: AWS::EC2::NetworkInterface
    Properties:
      Description: ES debasish-es-domain
      SourceDestCheck: 'true'
      SubnetId:
        Ref: subnet02dcf76df07dd6f35
lgdop-infra.yml#L62
    Type: AWS::EC2::NetworkInterface
    Properties:
      Description: Private IPs
      PrivateIpAddress: 172.31.48.10
      SubnetId: subnet-0ebf22ff6c78bec9d
      GroupSet:
ULTRA-VR.yml#L29
    Type: 'AWS::EC2::NetworkInterface'
  wsapp3277:
    Properties:
      KeyName: tcpaws-ivrco1-001-apse2-cmk-ULTRA-VR-prod-keypair
      ImageId: ami-0d52d93f5d72435cf
      InstanceType: c5.9xlarge
xzonehadualnic.yml#L248
    Type: AWS::EC2::NetworkInterface
    Properties:
      Description: AWS FW0 MGMT
      SubnetId: !Ref 'FW0MgmtSubnet'
      SourceDestCheck: true
      Tags:
eni.yml#L18
    Type:                              AWS::EC2::NetworkInterface
    Properties:
      SecondaryPrivateIpAddressCount:  1
      SubnetId:                        !Ref AvailableSubnetId1
      GroupSet:
        - !ImportValue master-sg::EC2SSHSecurityGroupId
AWS_EC2_VPC_UPDATE.json#L6
  "Message" : "{\"configurationItemDiff\":{\"changedProperties\":{\"Relationships.0\":{\"previousValue\":null,\"updatedValue\":{\"resourceId\":\"i-0b72e0b70e7fae3c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},\"changeType\":\"CREATE\"}},\"changeType\":\"UPDATE\"},\"configurationItem\":{\"relatedEvents\":[\"b1d6c6e1-2323-40e2-8d4b-3aea59f2e3ee\"],\"relationships\":[{\"resourceId\":\"acl-fc49ff92\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkAcl\",\"name\":\"Contains NetworkAcl\"},{\"resourceId\":\"eni-1eec3adb\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-2132bad2\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-239477d1\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-2b986f38\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-5d3479f7\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-6933e6c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-70385dde\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-83fc5323\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-a3902b84\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-ad25f7cc\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-bf97324c\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-f2397458\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-fd35bd0e\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-fe24b408\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"i-099e794cfa830e9be\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-0b72e0b70e7fae3c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-0fca61ededa522f1a\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-8b5739f2\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-c72af2f6\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-fb694e66\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"igw-fe49ff90\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::InternetGateway\",\"name\":\"Is attached to InternetGateway\"},{\"resourceId\":\"rtb-f749ff99\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::RouteTable\",\"name\":\"Contains RouteTable\"},{\"resourceId\":\"rtb-fd49ff93\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::RouteTable\",\"name\":\"Contains RouteTable\"},{\"resourceId\":\"sg-0d2cd677\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-1e2cf271\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-43cb9c27\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-6b62e412\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-734efc0f\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-7c69ed05\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-80f755ef\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-da58eaa6\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-dfe6c6a6\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"subnet-16c70477\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Subnet\",\"name\":\"Contains Subnet\"},{\"resourceId\":\"subnet-f849ff96\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Subnet\",\"name\":\"Contains Subnet\"}],\"configuration\":{\"cidrBlock\":\"10.0.0.0/16\",\"dhcpOptionsId\":\"dopt-f24ff99c\",\"state\":\"available\",\"vpcId\":\"vpc-ff49ff91\",\"instanceTenancy\":\"default\",\"ipv6CidrBlockAssociationSet\":[],\"isDefault\":false,\"tags\":[{\"key\":\"Name\",\"value\":\"EmsRefreshSpec-VPC\"}]},\"supplementaryConfiguration\":{},\"tags\":{\"Name\":\"EmsRefreshSpec-VPC\"},\"configurationItemVersion\":\"1.2\",\"configurationItemCaptureTime\":\"2017-09-07T12:26:51.155Z\",\"configurationStateId\":1504787211155,\"awsAccountId\":\"200278856672\",\"configurationItemStatus\":\"OK\",\"resourceType\":\"AWS::EC2::VPC\",\"resourceId\":\"vpc-ff49ff91\",\"resourceName\":null,\"ARN\":\"arn:aws:ec2:us-east-1:200278856672:vpc/vpc-ff49ff91\",\"awsRegion\":\"us-east-1\",\"availabilityZone\":\"Multiple Availability Zones\",\"configurationStateMd5Hash\":\"1d99a10eebb955b49fcbcd3743cf3292\",\"resourceCreationTime\":null},\"notificationCreationTime\":\"2017-09-07T12:26:51.563Z\",\"messageType\":\"ConfigurationItemChangeNotification\",\"recordVersion\":\"1.2\"}",
  "Timestamp" : "2017-09-07T12:26:52.026Z",
  "SignatureVersion" : "1",
  "Signature" : "Jp4ku34Z25ID02WrsFj+G5j3DSuejjka/gBen/+DPD8MHjJVNeXSsA2ES9Spv0ukxyPsmz8fVWqIg/yv5/SlwlTvRoPF8iivm+IaVf4mh0q9NEUmDEHqzxq0IwwqUxsQZHisyLVxCntP7CdwMjgejm4gjP/5exQBz6+Lb9TnP9FRrzTVZRWUUe5Wx3GFh0YaV19IysfsnBzzGSNpvx7aCy5ZMmxYnAOmJEetg9xYddpKaLQ5CzQ6V3HP2TqvpppFpOkB9oCUWP1AZomoW0GUiah1sGEe8pfLVCoTjFdx/d3oj8PVMW8nGvH2WuEAdToUSnfslGX1xSSnLIlOB9a8lw==",
  "SigningCertURL" : "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-433026a4050d206028891664da859041.pem",
  "UnsubscribeURL" : "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:200278856672:AWSConfig_topic:61d4ffc8-72e3-41a7-b28d-86e700532cd1"
AWS_EC2_SecurityGroup_UPDATE.json#L6
  "Message" : "{\"configurationItemDiff\":{\"changedProperties\":{\"Relationships.0\":{\"previousValue\":null,\"updatedValue\":{\"resourceId\":\"i-0b72e0b70e7fae3c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Is associated with Instance\"},\"changeType\":\"CREATE\"}},\"changeType\":\"UPDATE\"},\"configurationItem\":{\"relatedEvents\":[\"b1d6c6e1-2323-40e2-8d4b-3aea59f2e3ee\"],\"relationships\":[{\"resourceId\":\"eni-1eec3adb\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Is associated with NetworkInterface\"},{\"resourceId\":\"eni-2b986f38\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Is associated with NetworkInterface\"},{\"resourceId\":\"eni-5d3479f7\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Is associated with NetworkInterface\"},{\"resourceId\":\"eni-6933e6c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Is associated with NetworkInterface\"},{\"resourceId\":\"eni-70385dde\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Is associated with NetworkInterface\"},{\"resourceId\":\"eni-83fc5323\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Is associated with NetworkInterface\"},{\"resourceId\":\"eni-a3902b84\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Is associated with NetworkInterface\"},{\"resourceId\":\"eni-ad25f7cc\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Is associated with NetworkInterface\"},{\"resourceId\":\"eni-bf97324c\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Is associated with NetworkInterface\"},{\"resourceId\":\"eni-fe24b408\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Is associated with NetworkInterface\"},{\"resourceId\":\"i-099e794cfa830e9be\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Is associated with Instance\"},{\"resourceId\":\"i-0b72e0b70e7fae3c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Is associated with Instance\"},{\"resourceId\":\"i-0fca61ededa522f1a\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Is associated with Instance\"},{\"resourceId\":\"i-8b5739f2\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Is associated with Instance\"},{\"resourceId\":\"i-c72af2f6\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Is associated with Instance\"},{\"resourceId\":\"i-fb694e66\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Is associated with Instance\"},{\"resourceId\":\"vpc-ff49ff91\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::VPC\",\"name\":\"Is contained in Vpc\"}],\"configuration\":{\"description\":\"EmsRefreshSpec-SecurityGroup-VPC\",\"groupName\":\"EmsRefreshSpec-SecurityGroup-VPC\",\"ipPermissions\":[{\"fromPort\":22,\"ipProtocol\":\"tcp\",\"ipv6Ranges\":[],\"prefixListIds\":[],\"toPort\":22,\"userIdGroupPairs\":[],\"ipv4Ranges\":[{\"cidrIp\":\"0.0.0.0/0\"}],\"ipRanges\":[\"0.0.0.0/0\"]},{\"fromPort\":-1,\"ipProtocol\":\"icmp\",\"ipv6Ranges\":[],\"prefixListIds\":[],\"toPort\":-1,\"userIdGroupPairs\":[],\"ipv4Ranges\":[{\"cidrIp\":\"0.0.0.0/0\"}],\"ipRanges\":[\"0.0.0.0/0\"]}],\"ownerId\":\"200278856672\",\"groupId\":\"sg-80f755ef\",\"ipPermissionsEgress\":[{\"ipProtocol\":\"-1\",\"ipv6Ranges\":[],\"prefixListIds\":[],\"userIdGroupPairs\":[],\"ipv4Ranges\":[{\"cidrIp\":\"0.0.0.0/0\"}],\"ipRanges\":[\"0.0.0.0/0\"]}],\"tags\":[],\"vpcId\":\"vpc-ff49ff91\"},\"supplementaryConfiguration\":{},\"tags\":{},\"configurationItemVersion\":\"1.2\",\"configurationItemCaptureTime\":\"2017-09-07T12:26:50.892Z\",\"configurationStateId\":1504787210892,\"awsAccountId\":\"200278856672\",\"configurationItemStatus\":\"OK\",\"resourceType\":\"AWS::EC2::SecurityGroup\",\"resourceId\":\"sg-80f755ef\",\"resourceName\":\"EmsRefreshSpec-SecurityGroup-VPC\",\"ARN\":\"arn:aws:ec2:us-east-1:200278856672:security-group/sg-80f755ef\",\"awsRegion\":\"us-east-1\",\"availabilityZone\":\"Not Applicable\",\"configurationStateMd5Hash\":\"309d3f8e812bda2e6a81c543cfcfafa1\",\"resourceCreationTime\":null},\"notificationCreationTime\":\"2017-09-07T12:26:51.450Z\",\"messageType\":\"ConfigurationItemChangeNotification\",\"recordVersion\":\"1.2\"}",
  "Timestamp" : "2017-09-07T12:26:51.862Z",
  "SignatureVersion" : "1",
  "Signature" : "A3fBZRt9OVU2nv11955wm19p4lL2y0XK+FK10tXgyVOr0VqIlBFzA5bzdIQ9CSmYn2FlAi1AN0clyP0WCqlsle7WoWL/kzJGJey2WEsTeCqFxIfnFT015qOm7TsUCIFIPk7L3UasLeoY1tLzY3zy6J0OOnPylXkGvU8KwkwAuSbywBk8vMI69gngwV619uIqPNK19+Yq2Ux60HrDnu5NXb2jgRgSSxj7NqX9FlVhR6NbHXjSjNhtH6sIFMyJdy/LnYoySIZLbFPLAT/IU27KpIUkZn4aobEWyup7jOAW0cC9akEkxPAci6XaH7GQbj3IPmY9pjHL5eb4JVzLz03ung==",
  "SigningCertURL" : "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-433026a4050d206028891664da859041.pem",
  "UnsubscribeURL" : "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:200278856672:AWSConfig_topic:61d4ffc8-72e3-41a7-b28d-86e700532cd1"
AWS_EC2_VPC_UPDATE.json#L6
  "Message" : "{\"configurationItemDiff\":{\"changedProperties\":{\"Relationships.0\":{\"previousValue\":null,\"updatedValue\":{\"resourceId\":\"i-0b72e0b70e7fae3c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},\"changeType\":\"CREATE\"}},\"changeType\":\"UPDATE\"},\"configurationItem\":{\"relatedEvents\":[\"b1d6c6e1-2323-40e2-8d4b-3aea59f2e3ee\"],\"relationships\":[{\"resourceId\":\"acl-fc49ff92\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkAcl\",\"name\":\"Contains NetworkAcl\"},{\"resourceId\":\"eni-1eec3adb\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-2132bad2\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-239477d1\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-2b986f38\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-5d3479f7\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-6933e6c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-70385dde\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-83fc5323\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-a3902b84\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-ad25f7cc\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-bf97324c\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-f2397458\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-fd35bd0e\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-fe24b408\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"i-099e794cfa830e9be\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-0b72e0b70e7fae3c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-0fca61ededa522f1a\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-8b5739f2\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-c72af2f6\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-fb694e66\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"igw-fe49ff90\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::InternetGateway\",\"name\":\"Is attached to InternetGateway\"},{\"resourceId\":\"rtb-f749ff99\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::RouteTable\",\"name\":\"Contains RouteTable\"},{\"resourceId\":\"rtb-fd49ff93\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::RouteTable\",\"name\":\"Contains RouteTable\"},{\"resourceId\":\"sg-0d2cd677\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-1e2cf271\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-43cb9c27\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-6b62e412\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-734efc0f\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-7c69ed05\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-80f755ef\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-da58eaa6\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"sg-dfe6c6a6\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::SecurityGroup\",\"name\":\"Contains SecurityGroup\"},{\"resourceId\":\"subnet-16c70477\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Subnet\",\"name\":\"Contains Subnet\"},{\"resourceId\":\"subnet-f849ff96\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Subnet\",\"name\":\"Contains Subnet\"}],\"configuration\":{\"cidrBlock\":\"10.0.0.0/16\",\"dhcpOptionsId\":\"dopt-f24ff99c\",\"state\":\"available\",\"vpcId\":\"vpc-ff49ff91\",\"instanceTenancy\":\"default\",\"ipv6CidrBlockAssociationSet\":[],\"isDefault\":false,\"tags\":[{\"key\":\"Name\",\"value\":\"EmsRefreshSpec-VPC\"}]},\"supplementaryConfiguration\":{},\"tags\":{\"Name\":\"EmsRefreshSpec-VPC\"},\"configurationItemVersion\":\"1.2\",\"configurationItemCaptureTime\":\"2017-09-07T12:26:51.155Z\",\"configurationStateId\":1504787211155,\"awsAccountId\":\"200278856672\",\"configurationItemStatus\":\"OK\",\"resourceType\":\"AWS::EC2::VPC\",\"resourceId\":\"vpc-ff49ff91\",\"resourceName\":null,\"ARN\":\"arn:aws:ec2:us-east-1:200278856672:vpc/vpc-ff49ff91\",\"awsRegion\":\"us-east-1\",\"availabilityZone\":\"Multiple Availability Zones\",\"configurationStateMd5Hash\":\"1d99a10eebb955b49fcbcd3743cf3292\",\"resourceCreationTime\":null},\"notificationCreationTime\":\"2017-09-07T12:26:51.563Z\",\"messageType\":\"ConfigurationItemChangeNotification\",\"recordVersion\":\"1.2\"}",
  "Timestamp" : "2017-09-07T12:26:52.026Z",
  "SignatureVersion" : "1",
  "Signature" : "Jp4ku34Z25ID02WrsFj+G5j3DSuejjka/gBen/+DPD8MHjJVNeXSsA2ES9Spv0ukxyPsmz8fVWqIg/yv5/SlwlTvRoPF8iivm+IaVf4mh0q9NEUmDEHqzxq0IwwqUxsQZHisyLVxCntP7CdwMjgejm4gjP/5exQBz6+Lb9TnP9FRrzTVZRWUUe5Wx3GFh0YaV19IysfsnBzzGSNpvx7aCy5ZMmxYnAOmJEetg9xYddpKaLQ5CzQ6V3HP2TqvpppFpOkB9oCUWP1AZomoW0GUiah1sGEe8pfLVCoTjFdx/d3oj8PVMW8nGvH2WuEAdToUSnfslGX1xSSnLIlOB9a8lw==",
  "SigningCertURL" : "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-433026a4050d206028891664da859041.pem",
  "UnsubscribeURL" : "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:200278856672:AWSConfig_topic:61d4ffc8-72e3-41a7-b28d-86e700532cd1"
AWS_EC2_Subnet_UPDATE.json#L6
  "Message" : "{\"configurationItemDiff\":{\"changedProperties\":{\"Relationships.0\":{\"previousValue\":null,\"updatedValue\":{\"resourceId\":\"i-0b72e0b70e7fae3c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},\"changeType\":\"CREATE\"},\"Configuration.AvailableIpAddressCount\":{\"previousValue\":238,\"updatedValue\":237,\"changeType\":\"UPDATE\"}},\"changeType\":\"UPDATE\"},\"configurationItem\":{\"relatedEvents\":[\"b1d6c6e1-2323-40e2-8d4b-3aea59f2e3ee\"],\"relationships\":[{\"resourceId\":\"acl-fc49ff92\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkAcl\",\"name\":\"Is attached to NetworkAcl\"},{\"resourceId\":\"eni-2132bad2\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-239477d1\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-2b986f38\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-6933e6c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-70385dde\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-83fc5323\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-a3902b84\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-ad25f7cc\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-bf97324c\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-fd35bd0e\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-fe24b408\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"i-099e794cfa830e9be\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-0b72e0b70e7fae3c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-0fca61ededa522f1a\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-8b5739f2\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-c72af2f6\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-fb694e66\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"rtb-f749ff99\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::RouteTable\",\"name\":\"Is contained in RouteTable\"},{\"resourceId\":\"vpc-ff49ff91\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::VPC\",\"name\":\"Is contained in Vpc\"}],\"configuration\":{\"availabilityZone\":\"us-east-1e\",\"availableIpAddressCount\":237,\"cidrBlock\":\"10.0.0.0/24\",\"defaultForAz\":false,\"mapPublicIpOnLaunch\":true,\"state\":\"available\",\"subnetId\":\"subnet-f849ff96\",\"vpcId\":\"vpc-ff49ff91\",\"assignIpv6AddressOnCreation\":false,\"ipv6CidrBlockAssociationSet\":[],\"tags\":[{\"key\":\"Name\",\"value\":\"EmsRefreshSpec-Subnet1\"}]},\"supplementaryConfiguration\":{},\"tags\":{\"Name\":\"EmsRefreshSpec-Subnet1\"},\"configurationItemVersion\":\"1.2\",\"configurationItemCaptureTime\":\"2017-09-07T12:26:51.041Z\",\"configurationStateId\":1504787211041,\"awsAccountId\":\"200278856672\",\"configurationItemStatus\":\"OK\",\"resourceType\":\"AWS::EC2::Subnet\",\"resourceId\":\"subnet-f849ff96\",\"resourceName\":null,\"ARN\":\"arn:aws:ec2:us-east-1:200278856672:subnet/subnet-f849ff96\",\"awsRegion\":\"us-east-1\",\"availabilityZone\":\"us-east-1e\",\"configurationStateMd5Hash\":\"57b1bc1e32f95e30674d58d617eb559a\",\"resourceCreationTime\":null},\"notificationCreationTime\":\"2017-09-07T12:26:51.538Z\",\"messageType\":\"ConfigurationItemChangeNotification\",\"recordVersion\":\"1.2\"}",
  "Timestamp" : "2017-09-07T12:26:51.977Z",
  "SignatureVersion" : "1",
  "Signature" : "WiN53avSdIgF65IA+SIiLscvgVkX3TvtIMwpGvRk8UKy9FlVP4sOK7TvjaPjbaAekdShXO3Pj17xkyy2PlsTCx6dzDVC16ttXvbV7491HtK3lKJSdlWTWi8V4F448a3lEqjFCEuukeycNtAqoHP8GDEFXftj3v97FUPPAdJ/TQdSl89TBZ8MUFNoRPeYjV7s1T9GgMa35MvelaBp8wZIoKc8BViAVGoKozxgOdlZXp/sl7xn+a2OBxgLArj6vXPA9lI1Qq6B4+HouZb1TRNpQEGoQSlYRgAtN1WCtTSvemb2Ercvhl3CVkKRecbsv8zDEmeKMVmwP3uNy5xYGwFU1g==",
  "SigningCertURL" : "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-433026a4050d206028891664da859041.pem",
  "UnsubscribeURL" : "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:200278856672:AWSConfig_topic:61d4ffc8-72e3-41a7-b28d-86e700532cd1"
AWS_EC2_Subnet_UPDATE.json#L6
  "Message" : "{\"configurationItemDiff\":{\"changedProperties\":{\"Relationships.0\":{\"previousValue\":null,\"updatedValue\":{\"resourceId\":\"i-0b72e0b70e7fae3c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},\"changeType\":\"CREATE\"},\"Configuration.AvailableIpAddressCount\":{\"previousValue\":238,\"updatedValue\":237,\"changeType\":\"UPDATE\"}},\"changeType\":\"UPDATE\"},\"configurationItem\":{\"relatedEvents\":[\"b1d6c6e1-2323-40e2-8d4b-3aea59f2e3ee\"],\"relationships\":[{\"resourceId\":\"acl-fc49ff92\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkAcl\",\"name\":\"Is attached to NetworkAcl\"},{\"resourceId\":\"eni-2132bad2\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-239477d1\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-2b986f38\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-6933e6c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-70385dde\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-83fc5323\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-a3902b84\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-ad25f7cc\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-bf97324c\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-fd35bd0e\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"eni-fe24b408\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::NetworkInterface\",\"name\":\"Contains NetworkInterface\"},{\"resourceId\":\"i-099e794cfa830e9be\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-0b72e0b70e7fae3c9\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-0fca61ededa522f1a\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-8b5739f2\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-c72af2f6\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"i-fb694e66\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::Instance\",\"name\":\"Contains Instance\"},{\"resourceId\":\"rtb-f749ff99\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::RouteTable\",\"name\":\"Is contained in RouteTable\"},{\"resourceId\":\"vpc-ff49ff91\",\"resourceName\":null,\"resourceType\":\"AWS::EC2::VPC\",\"name\":\"Is contained in Vpc\"}],\"configuration\":{\"availabilityZone\":\"us-east-1e\",\"availableIpAddressCount\":237,\"cidrBlock\":\"10.0.0.0/24\",\"defaultForAz\":false,\"mapPublicIpOnLaunch\":true,\"state\":\"available\",\"subnetId\":\"subnet-f849ff96\",\"vpcId\":\"vpc-ff49ff91\",\"assignIpv6AddressOnCreation\":false,\"ipv6CidrBlockAssociationSet\":[],\"tags\":[{\"key\":\"Name\",\"value\":\"EmsRefreshSpec-Subnet1\"}]},\"supplementaryConfiguration\":{},\"tags\":{\"Name\":\"EmsRefreshSpec-Subnet1\"},\"configurationItemVersion\":\"1.2\",\"configurationItemCaptureTime\":\"2017-09-07T12:26:51.041Z\",\"configurationStateId\":1504787211041,\"awsAccountId\":\"200278856672\",\"configurationItemStatus\":\"OK\",\"resourceType\":\"AWS::EC2::Subnet\",\"resourceId\":\"subnet-f849ff96\",\"resourceName\":null,\"ARN\":\"arn:aws:ec2:us-east-1:200278856672:subnet/subnet-f849ff96\",\"awsRegion\":\"us-east-1\",\"availabilityZone\":\"us-east-1e\",\"configurationStateMd5Hash\":\"57b1bc1e32f95e30674d58d617eb559a\",\"resourceCreationTime\":null},\"notificationCreationTime\":\"2017-09-07T12:26:51.538Z\",\"messageType\":\"ConfigurationItemChangeNotification\",\"recordVersion\":\"1.2\"}",
  "Timestamp" : "2017-09-07T12:26:51.977Z",
  "SignatureVersion" : "1",
  "Signature" : "WiN53avSdIgF65IA+SIiLscvgVkX3TvtIMwpGvRk8UKy9FlVP4sOK7TvjaPjbaAekdShXO3Pj17xkyy2PlsTCx6dzDVC16ttXvbV7491HtK3lKJSdlWTWi8V4F448a3lEqjFCEuukeycNtAqoHP8GDEFXftj3v97FUPPAdJ/TQdSl89TBZ8MUFNoRPeYjV7s1T9GgMa35MvelaBp8wZIoKc8BViAVGoKozxgOdlZXp/sl7xn+a2OBxgLArj6vXPA9lI1Qq6B4+HouZb1TRNpQEGoQSlYRgAtN1WCtTSvemb2Ercvhl3CVkKRecbsv8zDEmeKMVmwP3uNy5xYGwFU1g==",
  "SigningCertURL" : "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-433026a4050d206028891664da859041.pem",
  "UnsubscribeURL" : "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:200278856672:AWSConfig_topic:61d4ffc8-72e3-41a7-b28d-86e700532cd1"

Parameters

Explanation in CloudFormation Registry

Describes a network interface in an Amazon EC2 instance for AWS CloudFormation.

Frequently asked questions

What is AWS Amazon EC2 Network Interface?

AWS Amazon EC2 Network Interface is a resource for Amazon EC2 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon EC2 Network Interface?

For Terraform, the tappoflw/tappo1, mdigbazova/terraforming-4ha-live-all-resources and zeenmc/terraform source code examples are useful. See the Terraform Example section for further details.

For CloudFormation, the dishayan/Elastic-Search, andreas131989/experiments and apur27/public source code examples are useful. See the CloudFormation Example section for further details.