Expose Resources
Assign public IP address
Generate public address. Store the allocation ID because it will be needed in following commands
Get ENI Attachment IDs of EC2 instances in VPC
Assign public IP to attached ENI. The required IDs are the ENI (eni-xxxx) and the IP allocation one (eipalloc-xxxxxxx) returned by the first command
Modify Routing Table to allow public traffic
Get VPC and subnets of EC2 instances
Get a list of available gateways in current VPC. Save the ID of a gateway to use to route traffic outside the VPC
Get routing tables of specified VPC and subnet
Edit the routing table to allow traffic from the VPC to the internet
Disable instance ACL rules
Get the security groups associated with each EC2 instance. Edit the one of the instance you intend to expose
Add inbound rule to security group to allow all traffic to reach the instance
Disable NACL rules
Get the VPC of the target EC2 instance
Get NACL rules for the vpc. Dependingon the rules it may be required to insert new rules to allow all traffic inbound and/or outbound in one or more NACL instances. Keep in mind that NACL are stateless so it is possible that inbound traffic is allowed but the response is still being blocked by the outbound filter rules. in this case we need to add an allow all rule to the outbound traffic too.
Add rule to allow all inbound traffic
Add rule to allow all outbound traffic
Last updated