Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- provider "aws" {
- access_key = "xxxxxxxxxxxxxx"
- secret_key = "yyyyyyyyyyyyyyyyyyyyyy"
- region = "us-west-2"
- }
- resource "aws_security_group" "myweb" {
- name = "web-node"
- description = "Web Security Group"
- ingress {
- from_port = 80
- to_port = 80
- protocol = "tcp"
- cidr_blocks = ["0.0.0.0/0"]
- }
- ingress {
- 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"]
- }
- }
- resource "aws_instance" "myweb" {
- ami = "ami-7f43f307"
- instance_type = "t2.micro"
- key_name = "test"
- security_groups = ["${aws_security_group.myweb.name}"]
- tags {
- Name = "terraform-instance"
- }
- }
Add Comment
Please, Sign In to add comment