$ terraform plan
$ terraform apply
Created
November 27, 2017 00:22
-
-
Save kremso/a403d3eb83d8c2d0ea8db5d187014457 to your computer and use it in GitHub Desktop.
Terraform demo
This file contains hidden or 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
| provider "aws" { | |
| region = "eu-west-1" | |
| profile = "luigis" | |
| } | |
| resource "aws_instance" "demo_instance" { | |
| count = "1" | |
| ami = "ami-add175d4" | |
| instance_type = "t2.nano" | |
| associate_public_ip_address = true | |
| vpc_security_group_ids = ["${aws_security_group.demo_instance.id}"] | |
| tags { | |
| Name = "Demo instance" | |
| } | |
| root_block_device { | |
| volume_type = "gp2" | |
| volume_size = "10" | |
| } | |
| } | |
| resource "aws_security_group" "demo_instance" { | |
| description = "controls access to demo instance" | |
| name = "sgrp-demo" | |
| ingress { | |
| protocol = "tcp" | |
| from_port = 80 | |
| to_port = 80 | |
| 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_route53_zone" "primary" { | |
| name = "rubyslava.local" | |
| } | |
| resource "aws_route53_record" "demo" { | |
| zone_id = "${aws_route53_zone.primary.id}" | |
| name = "demo" | |
| type = "A" | |
| ttl = 300 | |
| records = ["${aws_instance.demo_instance.private_ip}"] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment