admin管理员组

文章数量:1410689

I need to get the Elastic IP that is associated with a Public Subnet (map_public_ip_on_launch=True).

I tried the following solutions: 1 2 (see printEIP())

However, looks like there's no public subnet's node children. The following code will produce [] as output:

for subnet in vpc.public_subnets:
  print(node.children)

The question is - is there a way to get the Elastic IP associated with a Public Subnet in AWS CDK? In the web interface, at the "Elastic IP addresses" page I see the associations with the subnets.

Similar SO answers (How to list the Elastic IP (EIP) addresses via CDK, Get EIP as output from aws-cdk generated VPC definition) do not appear to be working anymore.

Thank you

本文标签: amazon web servicesAWS CDK A method to get Elastic IPs associated with a Public SubnetStack Overflow