Giter VIP home page Giter VIP logo

terraform-aws-basic-ec2's Introduction

AWS Basic EC2

Create env.tfvars

Before to execute terraform, you should change the env.tfvars inputs.

Usage

To run this example you need to execute:

$ terraform init
$ terraform plan -var-file=env.tfvars
$ terraform apply -var-file=env.tfvars

To destroy the resources you need to execute:

$ terraform destroy -var-file=env.tfvars

Connect Instance

To connect to the EC2 public instance, use the following command: ssh -i <output_key_name>.pem ubuntu@<output_ec2_public_ip>

To connect to the EC2 private instance using AWS EC2 Instance Connect, use the following command: ssh -i <output_key_name>.pem ubuntu@<output_ec2_private_id> -o ProxyCommand='aws ec2-instance-connect open-tunnel --instance-id <output_ec2_private_id> --region us-east-1 --profile <profile>'

Providers

Name Version
aws 5.21.0

Modules

Name Source Version
ec2_private ./ec2 n/a
ec2_public ./ec2 n/a
keypair ./keypair n/a
vpc ./vpc n/a

Resources

Name Type
aws_ec2_instance_connect_endpoint.this resource
aws_ami.ubuntu data source

Inputs

Name Description Type Default Required
aws_profile Environment variable to specify a named profile string "poc" no
aws_region AWS Region string "us-east-1" no
instance_type Instance type to use for the instance. string "t3.micro" no
key_name Keypair name string "key-teste" no
name common name of resources string "teste" no
private_subnets_cidrBlock The IPv4 CIDR block for the Private Subnet string "172.23.0.0/24" no
public_subnets_cidrBlock The IPv4 CIDR block for the Public Subnet string "172.23.1.0/24" no
tags A mapping of tags map(string) {} no
vpc_cidrBlock The IPv4 CIDR block for the VPC string "172.23.0.0/23" no
vpn_name VPC Name string n/a yes

Outputs

Name Description
ec2_private_id n/a
ec2_private_ip n/a
ec2_public_ip n/a
key_name n/a

terraform-aws-basic-ec2's People

Contributors

ronigarcia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.