Hi, I'm trying to create a NAT Gateway using the f...
# cloudengineering-support
b
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