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 AWS CloudFormation template, use the following syntax:
Properties
-
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
-
CreateInternetGateway in the Amazon EC2 API Reference
-
Internet gateways in the Amazon VPC User Guide
-
Use the AWS::EC2::VPCGatewayAttachment resource to associate an internet gateway with a VPC