Creation of NAT gateway and EIP Association

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    

Get Hands-On Serverless Applications with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.