Last active
January 27, 2017 00:25
-
-
Save remijouannet/7bb70eb133a1ba57c24c3521406aba0f to your computer and use it in GitHub Desktop.
terraform_osc
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
provider "aws" { | |
access_key = "AAAAAAAAAAAAAAAAAAAAAAAA" | |
secret_key = "SSSSSSSSSSSSSSSSS" | |
region = "eu-west-2" | |
skip_credentials_validation = true | |
skip_region_validation = true | |
endpoins { | |
ec2 = "fcu.eu-west-2.outscale.com" | |
} | |
} | |
resource "aws_internet_gateway" "default" { | |
vpc_id = "vpc-5555555" | |
} | |
resource "aws_subnet" "public" { | |
vpc_id = "vpc-5555555" | |
cidr_block = "10.0.0.0/24" | |
availability_zone = "eu-west-2a" | |
} | |
resource "aws_security_group" "bastion" { | |
name = "bastion" | |
description = "Allow SSH traffic from the internet" | |
ingress { | |
from_port = 22 | |
to_port = 22 | |
protocol = "tcp" | |
cidr_blocks = ["0.0.0.0/0"] | |
} | |
vpc_id = "vpc-5555555" | |
} | |
resource "aws_instance" "bastion" { | |
ami = "am-2222222" | |
availability_zone = "eu-west-2a" | |
instance_type = "t2.micro" | |
key_name = "yolo" | |
vpc_security_group_ids = ["${aws_security_group.bastion.id}"] | |
subnet_id = "${aws_subnet.public.id}" | |
} | |
resource "aws_eip" "bastion" { | |
instance = "${aws_instance.bastion.network_interface_id}" | |
vpc = true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment