Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::EC2::NetworkInterfacePermission

The AWS::EC2::NetworkInterfacePermission resource specifies a permission for an Amazon EC2 network interface. For example, you can grant an AWS authorized partner account permission to attach the specified network interface to an instance in their account. For more information, see CreateNetworkInterfacePermission and NetworkInterfacePermission in the Amazon EC2 API Reference.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

Copy
{ "Type" : "AWS::EC2::NetworkInterfacePermission", "Properties" : { "AwsAccountId" : String, "NetworkInterfaceId" : String, "Permission" : String } }

YAML

Copy
Type: "AWS::EC2::NetworkInterfacePermission" Properties: AwsAccountId: String NetworkInterfaceId: String Permission: String

Properties

AwsAccountId

The AWS account ID.

Required: Yes

Type: String

Update requires: Replacement

NetworkInterfaceId

The ID of the network interface.

Required: Yes

Type: String

Update requires: Replacement

Permission

The type of permission to grant: INSTANCE-ATTACH or EIP-ASSOCIATE.

Required: Yes

Type: String

Update requires: Replacement

Return Values

Ref

When you pass the logical ID of an AWS::EC2::NetworkInterfacePermission resource to the intrinsic Ref function, the function returns the network interface permission ID. For example, eni-perm-055663b682ea24b48.

For more information about using the Ref function, see Ref.

Examples

Grant INSTANCE-ATTACH Permission

The following example creates a permission (INSTANCE-ATTACH) for a specified network interface and AWS account.

JSON

Copy
{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "MyNetworkInterfacePermission": { "Type": "AWS::EC2::NetworkInterfacePermission", "Properties": { "NetworkInterfaceId": "eni-030e3xxx", "AwsAccountId": "11111111111", "Permission": "INSTANCE-ATTACH" } } }, "Outputs": { "ReferenceId": { "Value": { "Ref": "MyNetworkInterfacePermission" } } } }

YAML

Copy
AWSTemplateFormatVersion: 2010-09-09 Resources: MyNetworkInterfacePermission: Type: 'AWS::EC2::NetworkInterfacePermission' Properties: NetworkInterfaceId: eni-030e3xxx AwsAccountId: '11111111111' Permission: INSTANCE-ATTACH Outputs: ReferenceId: Value: !Ref MyNetworkInterfacePermission