I have created an ec2 instance using tf CDK. i am trying to run a command on this instance which needs internet access but it is not able to connect but when i create an instance manually on AWS with same properties, it is able to connect. i am using NAT gateway to connect with internet. is there any specific property i am missing when creating instance with terraform ?
Hi @ansgarm , instance created manually within same security group and subnet with the same ami is able to connect but instance created with terraform not.
is there anything i need to specify in config when creating with TF.
i am passing these arguments for now:
ami: string,
instanceType: string,
subnetId: string,
vpcSecurityGroupIds: string ,
availabilityZone: string
If you create an instance via the AWS Console Wizard, it might have set defaults which it didn’t tell you about.
You could compare the properties of the instance that can connect in the AWS Console to the one your created via CDK for Terraform (also look at its properties in the AWS Console. Maybe you can spot the difference there.
Hi @ansgarm , did check all properties with state file as well but not getting anything related to internet access through NAT gateway. can you please suggest which config attributes may have a role in internet access ?