AWS::EC2::InternetGateway - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

AWS::EC2::InternetGateway

Allocates an internet gateway for use with a VPC. After creating the Internet gateway, you then attach it to a VPC.

Syntax

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

JSON

{ "Type" : "AWS::EC2::InternetGateway", "Properties" : { "Tags" : [ Tag, ... ] } }

YAML

Type: AWS::EC2::InternetGateway Properties: Tags: - Tag

Properties

Tags

Any tags to assign to the internet gateway.

Required: No

Type: Array of Tag

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the ID of the internet gateway.

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

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

InternetGatewayId

The ID of the internet gateway.

Examples

Create an internet gateway

The following example creates an internet gateway and assigns it a tag.

JSON

"Resources" : { "myInternetGateway" : { "Type" : "AWS::EC2::InternetGateway", "Properties" : { "Tags" : [ {"Key" : "stack", "Value" : "production"}] } } }

YAML

myInternetGateway: Type: AWS::EC2::InternetGateway Properties: Tags: - Key: stack Value: production

See also