Skip to content

Aukhan/terraform-ec2-vpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example to create an AWS VPC and one subnet in that VPC with one EC2. Creates a security group for this infrastructure and rules to allow SSH and HTTP in bound only. It expects that you already have a key generated in AWS and will ask for that key pair's name as a variable.

Credentials

  • Expects a file named aws.credentials to be placed at the root
  • The contents of the file should look like
[default]
aws_access_key_id=<access_key>
aws_secret_access_key=<secret_key>

Setup

Change any names if you have to and then run

terraform plan

If all looks good

terraform apply

Output

The elastic IP assigned to the instance will be output

master_elastic_ip = x.x.x.x

Use the ip to ssh into the server

ssh -i path/to/key.pem [email protected]

Hit the IP address in a browser to see the nginx default screen popup

Teardown

terraform destroy

About

No description or website provided.

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published