Now that we have EIP allocated, let's create NAT gateways and associate them with the EIPs. The following code block shows how the allocated EIP can be associated with the NAT gateway:
letsPollVPCNatGateway: Type: AWS::EC2::NatGateway DependsOn: letsPollVPCNatGatewayEIP Properties: AllocationId: { Fn::GetAtt: [ "letsPollVPCNatGatewayEIP", "AllocationId" ] } SubnetId: Ref: letsPollPublicSubnet Tags: - Key: Name Value: Lets Poll VPC NAT Gateway 1