Hey I'm working with go/aws and having trouble get...
# general
Hey I'm working with go/aws and having trouble getting an EIP and NATGateway to work together. I have the EIP being created and the NATGateway taking the EIP's AllocationID as a param but pulumi is blowing up saying the AllocaitonID is a missing argument
Could you share the error message?
(And if possible, the code snippet?)
Copy code
// Make an EIP for the NAT Gateway
natEIP, err := ec2.NewEip(ctx, "NATEIP", &ec2.EipArgs{
    PublicIpv4Pool: "amazon",
    Vpc:            true,

// Make a NAT gateway
natGateway, err := ec2.NewNatGateway(ctx, "NATGateway", &ec2.NatGatewayArgs{
    AllocationId: natEIP.AllocationId(),
    SubnetId:     publicSubnet.ID(),
======== ERROR MESSAGE ========
Copy code
  aws:ec2:NatGateway (NATGateway):
    error: aws:ec2/natGateway:NatGateway resource 'NATGateway' has a problem: "allocation_id": required field is not set
The EIP is being created and I can see the allocation id inside the AWS console
It appears that
is undefined for this type of
resource. Instead, you need to use
. Can't explain why that is the API design personally - but it is the pattern used here https://pulumi.io/reference/pkg/nodejs/@pulumi/aws/ec2/#example-usage-10 and I tried it in Go and it worked.
Huh how weird! I'll give it a try, thanks!