knife ec2 to vpc node - amazon-ec2

I am trying to launch node in EC2 VPC using chef knife ec2 server create to launch ec2 instance into VPC, But I looking a flag to specify vpc info.
Anyone know how to spin up ec2 instance into vpc using knife ec2 server create ?
Thanks

There is a --subnet SUBNET_ID flag for knife ec2 command. You can specify which subnet of VPC you want the instance be created using this flag.
Refer: https://docs.chef.io/plugin_knife_ec2.html
You cannot provide VPC identity. However, you can provide subnet identity which eventually will create the instance in your VPC of choice.

Related

Performing DNAT for AWS EC2 instance

Is there any way to perform DNAT for AWS EC2 instances? I am trying to allocate one public ip and then associate this ip with any instance under my public subnet. We can perform similar action in VMware's NSX using DNAT rules but don't find it's equivalent in AWS.
An AWS Elastic IP is a static public IP address that can be moved between any of your EC2 instances. AWS is using NAT behind the scenes to make that work.
If you want an AWS Elastic IP to point to more than one of your EC2 instances at the same time, you can assign it to an AWS Network Load Balancer.

connect lambda to another vpc via an EC2 vpn tunnel

We have 2 separate VPC's and dont need to do any peering. one VPC has an openvpn software running for vpn purposes and a lambda in another vpc that needs access to the resource in the openvpn VPC. so how can this be done if we try to create a tunnel from an EC2 instance running in the Lambda's VPC that is connected to the other VPC via vpnclient? Would this work in this scenario or are there any other alternatives. The Lambda would like to reach the elasticsearch service running in the other VPC via VPN client running in the EC2 instance
Please create VPC peering between these 2 VPCs & configure route tables of both.
In case of need further help, please do let me know

How to connect ec2 Instance on aws to my company VPN

I have couple of ec2 Instances on amazon. I want to connect these ec2 instances to my company VPN. I want to do this, so that I can connect to Oracle which is on-premise from an application which is running on ec2
you can ssh to the ec2 instance from your company vpn
If you have correctly configured your VPN between your office and your AWS VPC (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html), then you should check your VPC NACLs, Security Groups and Route Tables to be able to ssh between the different servers and the EC2 Instances.

RDP - Non VPC EC2 instance to VPC (Public) EC2 Instance: Not Working

I have few EC2 instances across VPC and non-VPC.
VPC Instance
VPC-Dev1
VPC-Dev2
Without VPC
EC2-Dev1
EC2-Dev2
I can access (RDP) all the servers from outside world. I have given RDP access to all (0.0.0.0/0) to ensure that I am not missing out anything.
However, I can't access VPC-Dev1 from EC2-Dev1 or vice-a-versa. Is there any specific firewalls related setup I need do to allow AWS instances to get access to each other?
Any help much appreciated!
If you are trying to make the calls using the private IPs, try using the public IPs.

boto ec2 connect to region is not working in a EC2 instance in Amazon VPC

ec2 = boto.ec2.connect_to_region(regionName)
gets hung in a instance in VPC.
boto ec2 connect to region is not working in a EC2 instance in Amazon VPC but the same thing works outside Amazon VPC.
What are the things I need to check ?
Thank you
The VPC adds egress rules to Security Groups. It also adds a new feature called Network ACLs that adds stateless ingress and egress rules. Check both your Network ACLs and Security Groups to make sure that you aren't blocking anything with egress rules.

Resources