simple Flashcards
aws_security_group
name = “allow_ssh”
vpc_id = data.aws_vpc.default.id
description = “Allow SSH inbound traffic”
ingress {
from_port = 22
to_port = 22
protocol = “tcp”
cidr_blocks = [“73.45.229.14/32”]
}
egress {
from_port = 0
to_port = 0
protocol = “-1”
cidr_blocks = [“0.0.0.0/0”]
}
data “aws_vpc”
default = true
data aws_subnet
vpc_id = data.aws_vpc.default.id
filter {
name = “availability-zone”
values = [“us-west-2a”] }
aws_instance
ami = data.aws_ami.amzn2_ami.id
instance_type = “t2.micro”
key_name = “my-key-pair”
vpc_security_group_ids = [aws_security_group.allow_ssh.id]
associate_public_ip_address = true
subnet_id = data.aws_subnet.default.id
tags = {
Name = “example-instance”
}
data “aws_ami”
most_recent = true
owners = [“amazon”]
filter {
name = “name”
values = [“amzn2-ami-kernel-*-x86_64-gp2”]
}
aws_key
key_name = “my-key-pair”
public_key = file(“/home/silvia/udemy/me/simple/simple.pub”)