https://pulumi.com logo
#cloudengineering-support
Title
# cloudengineering-support
b

billions-branch-7264

10/17/2020, 7:42 PM
Hi, I'm trying to create a NAT Gateway using the following code
Copy code
....
nat_gateway = aws.ec2.NatGateway(
    f"nat-gateway",
    allocation_id=elastic_ip.allocation_id,
    subnet_id=subnet.id,
    opts=ResourceOptions(provider=provider),
)
other components (vpc, elastic ip, subnet and internet gateway) are successfully created except for the NAT Gateway with this error
aws:ec2/natGateway:NatGateway resource 'nat-gateway' has a problem: Required attribute is not set
any ideas?
it turned out that I have to use
allocation_id=elastic_ip.id
instead of
allocation_id=elastic_ip.allocation_id
now it works fine