Start with the usual CloudFormation template version and description:
AWSTemplateFormatVersion: "2010-09-09" Description: Create NAT Gateway and associated route.
The template must take the following required parameters:
Parameters: PublicSubnetId: Description: Public Subnet ID to add the NAT Gateway to Type: AWS::EC2::Subnet::Id RouteTableId: Description: The private subnet route table to add the NAT Gateway route to Type: String
In the Resources section, define an Elastic IP that will be assigned to the NAT gateway: