-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Se agrega el proyecto ec2-with-keypair-rsa-public
- Loading branch information
1 parent
4487f89
commit cc8ecd3
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
resource "aws_instance" "web" { | ||
|
||
ami = "ami-082b5a644766e0e6f" | ||
instance_type = "t2.micro" | ||
key_name = "${aws_key_pair.keypair.key_name}" | ||
|
||
vpc_security_group_ids = [ "${aws_security_group.allow_ssh_anywhere.id}" ] | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#Se declara el keypair para la conexión a la instancia. | ||
|
||
resource "aws_key_pair" "keypair" { | ||
key_name = "terrafor-test-keypair" | ||
|
||
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDyy3ZmliPL87q47i9/Gjp1QXYt6NaeumfZOG5N0yKm7vmLM1rfR6V5c6vGX16kpf6bk7DgD6BY4yoMitJuMI3caLtG9ETH1RtLxpr9hsq8GtmcVihBVc6mMScC+e0eSC0544ZT/fCnRc9zGoYQV1qyhwoiljStBX4EziAc2k1POHVe7hGQZocCeA8nqdy3QJb6R7qcEMwLgyWvCPJV3pHNHP61OTOu0I6jiHII1buhFNcbzCJzWN5CHknF+QtoDIONmlIFvKQVKDLX5IhUX6Q3F+HnosrLpS6laRaKcMqgkqB3C+jdeJpobkVCwZfrVcXp3lSlhaUK2bLGABardtwv gilbarsan@HP-Pavilion-17-Notebook" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
provider "aws" { | ||
region = "us-west-2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#Generar security group en VPC por default. | ||
# el valor vpc_id = "vpc-f8ba509c" - Es el ID de la VPC por default. | ||
|
||
resource "aws_security_group" "allow_ssh_anywhere" { | ||
name = "allow_ssh_anywhere" | ||
description = "Allow all inbound traffic ssh" | ||
vpc_id = "vpc-f8ba509c" | ||
|
||
ingress { | ||
# TLS (change to whatever ports you need) | ||
from_port = 22 | ||
to_port = 22 | ||
protocol = "tcp" | ||
cidr_blocks = [ "0.0.0.0/0" ] | ||
} | ||
|
||
egress { | ||
from_port = 0 | ||
to_port = 0 | ||
protocol = "-1" | ||
cidr_blocks = ["0.0.0.0/0"] | ||
} | ||
} | ||
|