diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3fa8c86 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.terraform diff --git a/README.md b/README.md index ac59dab..602e33a 100644 --- a/README.md +++ b/README.md @@ -1,58 +1,66 @@ -# Wave Operations Engineering Development Challenge +# Overview -Applicants for the [Operations Engineering team](https://wave.bamboohr.co.uk/jobs/) at Wave must complete the following challenge, and submit a solution prior to the interviewing process. +This repo has two parts: -The purpose of this exercise is to create something that we can discuss during the on-site interview, and that's representative of the kind of things we do here on a daily basis. +1. The packer dir. It has everything to make an AWS EC2 image that has the app "baked in". The product of this dir is an AMI. -There isn't a hard deadline for this exercise; take as long as you need to complete it. However, in terms of total time spent actively working on the challenge, we ask that you not spend more than a few hours, as we value your time and expect to leave things open to discussion in the on-site interview. +2. the terraform dir . This is where some infrastucture gets lit up running that app. At this time it's just a lone vpc-less intance. -Send your completed submission to your contact at Wave. Feel free to email [ops.careers@waveapps.com](ops.careers@waveapps.com) if you have any questions. +I tried to keep this as simple as I could whle being functional. I also thorugh about security, usablity , and scalability -## Submission Instructions +aws.sh populates your environment with your aws creds. -1. Fork this project on GitHub - you'll need to create an account if you don't already have one -1. Complete the project as described below within your fork -1. Push all of your changes to your fork on GitHub and submit a pull request -1. Email your contact at Wave to let them know you have submitted a solution, and make sure to include your GitHub username in your email (so we can match applicants with pull requests) +# Packer -## Alternate Submission Instructions (if you don't want to publicize completing the challenge) +There are three parts that make this up. -1. Clone the repository -1. Complete your project as described below within your local repository -1. Email a patch file to your contact at Wave +image.json + the packer template + references the two files before. -## Project Description +provision.sh + a script run at ami build time that gets the app installed. + supprting software install is in this file. -There's a basic Python app available [here](https://github.com/wvchallenges/opseng-challenge-app). Your task is to host this app on AWS, using the current `HEAD` of the `master` branch as of when we test your submission. +rc.local + a start up script that ensures that the services is running as the instance comes up. + startup options are in this file. -The OS used for hosting, and the tools & techniques used to accomplish this are up to you. Once you're done, please submit a paragraph or two in your `README` about what you're particularly proud of in your implementation, and why. Be deliberate in your choices and design, as we'll use them as a starting point for our discussions. +# Terraform -### Deliverables +Just a lone instance at this time. -You should provide at least an executable bash script called `aws-app.sh`. You're welcome to include other files and install/use other tools in your repo as needed, but `aws-app.sh` is what we'll run to test your submission (see the evaluation section). +You need to make your own key pair and specify it in terraform.tfvars. -#### Notes +In tfvars you also need to enter the ami id of the ami created by packer above. -* **Do not check AWS keys or any other secret credentials into git** -* Prefix all of your AWS resources (when possible) with your first name (example: joanne.domain.com) -## Evaluation +# Pre-requisites and Requirements -We'll do the following, using on a stock OSX machine with Python 2.7.10 or higher (but <3.0), the `awscli` Python package installed, and appropriate AWS environment variables set: -``` -$ git clone / # Or we'll apply your patch file to a checked-out branch -$ cd -$ ./aws-app.sh -``` -We expect that this will output a URL, and we'll then visit that URL to confirm it has the output generated by the current `HEAD` of the `master` branch of the repo linked to above. +1. put your aws api keys into pass in: ( https://www.passwordstore.org/ ) -When we're evaluating your submission, some of the questions we'll be asking are: +pass opseng-challenge/access-key +pass opseng-challenge/secret-key + +2. packer from hashicorp ( https://www.packer.io/ ) + +3. terraform from hashicorp ( https://www.terraform.io/ ) + +# To Do + +Security +Auto Scaling +Try making this a docker image and using AWS ECS. + +# Bugs + +A temporary ssh key was committed to the repo and has since been removed form the repo and the cloud itself. + +The terraform data lookup for the ami will choose the latest image, you might want more granular control. + +Deployment process. There is no elegant way to get a new version deployed. + At this time the process would be: + 1. rerun packer to make a new image. + 2. rerun terraform for it to see the more recent ami. -* If we follow the steps above, do we end up with a working app at the URL specified? -* Does the working app reflect what's at the `HEAD` of the `master` branch right now, or at a point in the past? -* If we wanted to push out an updated version of the app's code, how much work would that be? -* Which application(s) and OS were chosen to host the app, and why? -* Which hosting strategy was selected, and did you have a good reason to pick that one? -* Are the decisions and strengths/weaknesses of this strategy discussed? -* How much of the hosting infrastructure is created when calling `aws-app.sh`, and how much does the script assume already exists or is created by hand in the console? diff --git a/aws-app.sh b/aws-app.sh new file mode 100755 index 0000000..a2f87ad --- /dev/null +++ b/aws-app.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +owd=`pwd` +cd packer +packer build image.json +cd ../terraform +terraform init +terraform get +terraform apply + +# Bugs: no error checking. + diff --git a/aws.sh b/aws.sh new file mode 100644 index 0000000..b278033 --- /dev/null +++ b/aws.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +export TF_VAR_aws_access_key="$(pass opseng-challenge/access-key)" +export TF_VAR_aws_secret_key="$(pass opseng-challenge/secret-key)" + +export AWS_ACCESS_KEY_ID="${TF_VAR_aws_access_key}" +export AWS_SECRET_ACCESS_KEY="${TF_VAR_aws_secret_key}" + +export TF_date="$(date +%Y%m%d%k%M%S)" + diff --git a/packer/image.json b/packer/image.json new file mode 100644 index 0000000..a42c9be --- /dev/null +++ b/packer/image.json @@ -0,0 +1,35 @@ +{ + "variables": { + "aws_access_key": "{{env `TF_VAR_aws_access_key`}}", + "aws_secret_key": "{{env `TF_VAR_aws_secret_key`}}" + }, + "builders": [{ + "type": "amazon-ebs", + "access_key": "{{user `aws_access_key`}}", + "secret_key": "{{user `aws_secret_key`}}", + "region": "us-east-1", + "source_ami_filter": { + "filters": { + "virtualization-type": "hvm", + "name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*", + "root-device-type": "ebs" + }, + "owners": ["099720109477"], + "most_recent": true + }, + "instance_type": "t2.micro", + "ssh_username": "ubuntu", + "ami_name": "opseng-challenge-app {{timestamp}}" + }], + "provisioners": [ + { + "type": "file", + "source": "./rc.local", + "destination": "/home/ubuntu/rc.local" + }, + { + "type": "shell", + "script": "./provision.sh" + } + ] +} diff --git a/packer/provision.sh b/packer/provision.sh new file mode 100644 index 0000000..4325a02 --- /dev/null +++ b/packer/provision.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +sudo apt-get update +sudo apt-get install -y git python-pip +mkdir deploy +cd deploy +git clone https://github.com/wvchallenges/opseng-challenge-app.git +cd opseng-challenge-app +sudo pip install -r requirements.txt +# gunicorn app:app --bind 0.0.0.0:8000 + +sudo cp /home/ubuntu/rc.local /etc/rc.local + + diff --git a/packer/rc.local b/packer/rc.local new file mode 100644 index 0000000..347195d --- /dev/null +++ b/packer/rc.local @@ -0,0 +1,5 @@ +#!/bin/bash + +cd /home/ubuntu/deploy/opseng-challenge-app +gunicorn app:app --bind 0.0.0.0:8000 + diff --git a/terraform/main.tf b/terraform/main.tf new file mode 100644 index 0000000..994f7b1 --- /dev/null +++ b/terraform/main.tf @@ -0,0 +1,163 @@ +variable "project" {} +variable "env" {} +variable "key_name" {} +variable "vpc_cidr" {} +variable "cidrs" {} +variable "azs" {} + +provider "aws" { + region = "us-east-1" +} + +data "aws_ami" "appimage" { + most_recent = true + owners = ["505545132866"] + filter { + name = "name" + values = ["opseng-challenge-app*"] + } +} + +resource "aws_vpc" "main" { + cidr_block = "${var.vpc_cidr}" + + lifecycle { + create_before_destroy = true + } + + tags { + Name = "${var.project}-${var.env}-vpc" + } +} + +resource "aws_security_group" "allow_all" { + name = "allow_all" + description = "Allow all inbound traffic" + vpc_id = "${aws_vpc.main.id}" + + ingress { + from_port = 0 + to_port = 0 + protocol = "-1" + 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_internet_gateway" "igw" { + vpc_id = "${aws_vpc.main.id}" +} + +resource "aws_subnet" "public" { + vpc_id = "${aws_vpc.main.id}" + cidr_block = "${element(split(",", var.cidrs), count.index)}" + availability_zone = "${element(split(",", var.azs), count.index)}" + count = "${length(split(",", var.cidrs))}" + + tags { + Name = "public_subnet" + } + + lifecycle { + create_before_destroy = true + } + + map_public_ip_on_launch = true + + tags { + Name = "${var.project}-${var.env}-subnet" + } +} + +resource "aws_route_table" "public" { + vpc_id = "${aws_vpc.main.id}" + + route { + cidr_block = "0.0.0.0/0" + gateway_id = "${aws_internet_gateway.igw.id}" + } + + lifecycle { + create_before_destroy = true + ignore_changes = ["route"] + } + + tags { + Name = "${var.project}-${var.env}-${element(split(",", var.azs), count.index)}" + } +} + +resource "aws_route_table_association" "public_assoc" { + count = "${length(split(",", var.cidrs))}" + subnet_id = "${element(aws_subnet.public.*.id, count.index)}" + route_table_id = "${aws_route_table.public.id}" +} + +resource "aws_instance" "web" { + count = 1 + ami = "${data.aws_ami.appimage.id}" + instance_type = "t2.micro" + key_name = "dthornton" + availability_zone = "us-east-1a" + security_groups = ["${aws_security_group.allow_all.id}"] + subnet_id = "${element(aws_subnet.public.*.id, count.index)}" + + lifecycle { + create_before_destroy = true + } + + tags { + Name = "${var.project}-${var.env}-${count.index}" + } + +} + +/* +resource "aws_lb_target_group" "target_group" { + name = "${var.project}-${var.env}-tg" + port = 80 + protocol = "HTTP" + vpc_id = "${aws_vpc.main.id}" +} +*/ + +/* +resource "aws_placement_group" "placementgroup" { + name = "${var.project}-${var.env}-pg" + strategy = "cluster" +} +*/ + +/* +resource "aws_launch_configuration" "launchconfig" { + name = "${var.project}-${var.env}-launch-config" + image_id = "${data.aws_ami.appimage.id}" + instance_type = "t2.micro" + key_name = "dthornton" +} +*/ + +/* +resource "aws_autoscaling_group" "asg" { + availability_zones = ["us-east-1a","us-east-1b"] + name = "${var.project}-${var.env}" + max_size = 5 + min_size = 2 + health_check_grace_period = 300 + health_check_type = "ELB" + desired_capacity = 4 + force_delete = true + placement_group = "${aws_placement_group.placementgroup.id}" + launch_configuration = "${aws_launch_configuration.launchconfig.name}" +} +*/ + +output "url" { + value = "http://${aws_instance.web.public_ip}:8000" +} diff --git a/terraform/terraform.tfstate b/terraform/terraform.tfstate new file mode 100644 index 0000000..8a151de --- /dev/null +++ b/terraform/terraform.tfstate @@ -0,0 +1,346 @@ +{ + "version": 3, + "terraform_version": "0.10.6", + "serial": 10, + "lineage": "b9159207-da2c-4e98-910d-877619982f1f", + "modules": [ + { + "path": [ + "root" + ], + "outputs": { + "url": { + "sensitive": false, + "type": "string", + "value": "http://34.237.144.72:8000" + } + }, + "resources": { + "aws_instance.web": { + "type": "aws_instance", + "depends_on": [], + "primary": { + "id": "i-0092d4dfcffee7906", + "attributes": { + "ami": "ami-58d37322", + "associate_public_ip_address": "true", + "availability_zone": "us-east-1a", + "disable_api_termination": "false", + "ebs_block_device.#": "0", + "ebs_optimized": "false", + "ephemeral_block_device.#": "0", + "iam_instance_profile": "", + "id": "i-0092d4dfcffee7906", + "instance_state": "running", + "instance_type": "t2.micro", + "ipv6_addresses.#": "0", + "key_name": "dthornton", + "monitoring": "false", + "network_interface.#": "0", + "network_interface_id": "eni-9b936a8d", + "primary_network_interface_id": "eni-9b936a8d", + "private_dns": "ip-10-10-1-14.ec2.internal", + "private_ip": "10.10.1.14", + "public_dns": "", + "public_ip": "34.237.144.72", + "root_block_device.#": "1", + "root_block_device.0.delete_on_termination": "true", + "root_block_device.0.iops": "100", + "root_block_device.0.volume_size": "8", + "root_block_device.0.volume_type": "gp2", + "security_groups.#": "0", + "source_dest_check": "true", + "subnet_id": "subnet-36c54a52", + "tags.%": "1", + "tags.Name": "david-opseng-challenge-dev-0", + "tenancy": "default", + "volume_tags.%": "0", + "vpc_security_group_ids.#": "1", + "vpc_security_group_ids.1011343189": "sg-288adf5a" + }, + "meta": { + "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { + "create": 600000000000, + "delete": 600000000000, + "update": 600000000000 + }, + "schema_version": "1" + }, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_internet_gateway.igw": { + "type": "aws_internet_gateway", + "depends_on": [ + "aws_vpc.main" + ], + "primary": { + "id": "igw-ffb60386", + "attributes": { + "id": "igw-ffb60386", + "tags.%": "0", + "vpc_id": "vpc-21ce6f59" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_route_table.public": { + "type": "aws_route_table", + "depends_on": [ + "aws_internet_gateway.igw", + "aws_vpc.main" + ], + "primary": { + "id": "rtb-e7f18b9d", + "attributes": { + "id": "rtb-e7f18b9d", + "propagating_vgws.#": "0", + "route.#": "1", + "route.2793025681.cidr_block": "0.0.0.0/0", + "route.2793025681.egress_only_gateway_id": "", + "route.2793025681.gateway_id": "igw-ffb60386", + "route.2793025681.instance_id": "", + "route.2793025681.ipv6_cidr_block": "", + "route.2793025681.nat_gateway_id": "", + "route.2793025681.network_interface_id": "", + "route.2793025681.vpc_peering_connection_id": "", + "tags.%": "1", + "tags.Name": "david-opseng-challenge-dev-us-east-1a", + "vpc_id": "vpc-21ce6f59" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_route_table_association.public_assoc.0": { + "type": "aws_route_table_association", + "depends_on": [ + "aws_route_table.public", + "aws_subnet.public.*" + ], + "primary": { + "id": "rtbassoc-1781266a", + "attributes": { + "id": "rtbassoc-1781266a", + "route_table_id": "rtb-e7f18b9d", + "subnet_id": "subnet-36c54a52" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_route_table_association.public_assoc.1": { + "type": "aws_route_table_association", + "depends_on": [ + "aws_route_table.public", + "aws_subnet.public.*" + ], + "primary": { + "id": "rtbassoc-33882f4e", + "attributes": { + "id": "rtbassoc-33882f4e", + "route_table_id": "rtb-e7f18b9d", + "subnet_id": "subnet-140ae23b" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_security_group.allow_all": { + "type": "aws_security_group", + "depends_on": [ + "aws_vpc.main" + ], + "primary": { + "id": "sg-288adf5a", + "attributes": { + "description": "Allow all inbound traffic", + "egress.#": "1", + "egress.482069346.cidr_blocks.#": "1", + "egress.482069346.cidr_blocks.0": "0.0.0.0/0", + "egress.482069346.description": "", + "egress.482069346.from_port": "0", + "egress.482069346.ipv6_cidr_blocks.#": "0", + "egress.482069346.prefix_list_ids.#": "0", + "egress.482069346.protocol": "-1", + "egress.482069346.security_groups.#": "0", + "egress.482069346.self": "false", + "egress.482069346.to_port": "0", + "id": "sg-288adf5a", + "ingress.#": "1", + "ingress.482069346.cidr_blocks.#": "1", + "ingress.482069346.cidr_blocks.0": "0.0.0.0/0", + "ingress.482069346.description": "", + "ingress.482069346.from_port": "0", + "ingress.482069346.ipv6_cidr_blocks.#": "0", + "ingress.482069346.protocol": "-1", + "ingress.482069346.security_groups.#": "0", + "ingress.482069346.self": "false", + "ingress.482069346.to_port": "0", + "name": "allow_all", + "owner_id": "505545132866", + "tags.%": "0", + "vpc_id": "vpc-21ce6f59" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_subnet.public.0": { + "type": "aws_subnet", + "depends_on": [ + "aws_vpc.main" + ], + "primary": { + "id": "subnet-36c54a52", + "attributes": { + "assign_ipv6_address_on_creation": "false", + "availability_zone": "us-east-1a", + "cidr_block": "10.10.1.0/24", + "id": "subnet-36c54a52", + "map_public_ip_on_launch": "true", + "tags.%": "1", + "tags.Name": "david-opseng-challenge-dev-subnet", + "vpc_id": "vpc-21ce6f59" + }, + "meta": { + "schema_version": "1" + }, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_subnet.public.1": { + "type": "aws_subnet", + "depends_on": [ + "aws_vpc.main" + ], + "primary": { + "id": "subnet-140ae23b", + "attributes": { + "assign_ipv6_address_on_creation": "false", + "availability_zone": "us-east-1b", + "cidr_block": "10.10.2.0/24", + "id": "subnet-140ae23b", + "map_public_ip_on_launch": "true", + "tags.%": "1", + "tags.Name": "david-opseng-challenge-dev-subnet", + "vpc_id": "vpc-21ce6f59" + }, + "meta": { + "schema_version": "1" + }, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_vpc.main": { + "type": "aws_vpc", + "depends_on": [], + "primary": { + "id": "vpc-21ce6f59", + "attributes": { + "assign_generated_ipv6_cidr_block": "false", + "cidr_block": "10.10.0.0/16", + "default_network_acl_id": "acl-527c592a", + "default_route_table_id": "rtb-10eb916a", + "default_security_group_id": "sg-a188ddd3", + "dhcp_options_id": "dopt-7fe61d1a", + "enable_classiclink": "false", + "enable_classiclink_dns_support": "false", + "enable_dns_hostnames": "false", + "enable_dns_support": "true", + "id": "vpc-21ce6f59", + "instance_tenancy": "default", + "main_route_table_id": "rtb-10eb916a", + "tags.%": "1", + "tags.Name": "david-opseng-challenge-dev-vpc" + }, + "meta": { + "schema_version": "1" + }, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "data.aws_ami.appimage": { + "type": "aws_ami", + "depends_on": [], + "primary": { + "id": "ami-58d37322", + "attributes": { + "architecture": "x86_64", + "block_device_mappings.#": "3", + "block_device_mappings.1634610537.device_name": "/dev/sdb", + "block_device_mappings.1634610537.ebs.%": "0", + "block_device_mappings.1634610537.no_device": "", + "block_device_mappings.1634610537.virtual_name": "ephemeral0", + "block_device_mappings.2547816212.device_name": "/dev/sda1", + "block_device_mappings.2547816212.ebs.%": "6", + "block_device_mappings.2547816212.ebs.delete_on_termination": "true", + "block_device_mappings.2547816212.ebs.encrypted": "false", + "block_device_mappings.2547816212.ebs.iops": "0", + "block_device_mappings.2547816212.ebs.snapshot_id": "snap-069c82e03b2dfec05", + "block_device_mappings.2547816212.ebs.volume_size": "8", + "block_device_mappings.2547816212.ebs.volume_type": "gp2", + "block_device_mappings.2547816212.no_device": "", + "block_device_mappings.2547816212.virtual_name": "", + "block_device_mappings.3850042718.device_name": "/dev/sdc", + "block_device_mappings.3850042718.ebs.%": "0", + "block_device_mappings.3850042718.no_device": "", + "block_device_mappings.3850042718.virtual_name": "ephemeral1", + "creation_date": "2017-10-27T20:11:58.000Z", + "filter.#": "1", + "filter.763425321.name": "name", + "filter.763425321.values.#": "1", + "filter.763425321.values.0": "opseng-challenge-app*", + "hypervisor": "xen", + "id": "ami-58d37322", + "image_id": "ami-58d37322", + "image_location": "505545132866/opseng-challenge-app 1509134953", + "image_type": "machine", + "most_recent": "true", + "name": "opseng-challenge-app 1509134953", + "owner_id": "505545132866", + "owners.#": "1", + "owners.0": "505545132866", + "product_codes.#": "0", + "public": "false", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "root_snapshot_id": "snap-069c82e03b2dfec05", + "sriov_net_support": "simple", + "state": "available", + "state_reason.%": "2", + "state_reason.code": "UNSET", + "state_reason.message": "UNSET", + "tags.%": "0", + "virtualization_type": "hvm" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "" + } + }, + "depends_on": [] + } + ] +} diff --git a/terraform/terraform.tfstate.backup b/terraform/terraform.tfstate.backup new file mode 100644 index 0000000..4d378e7 --- /dev/null +++ b/terraform/terraform.tfstate.backup @@ -0,0 +1,287 @@ +{ + "version": 3, + "terraform_version": "0.10.6", + "serial": 10, + "lineage": "b9159207-da2c-4e98-910d-877619982f1f", + "modules": [ + { + "path": [ + "root" + ], + "outputs": { + "url": { + "sensitive": false, + "type": "string", + "value": "http://34.237.1.135:8000" + } + }, + "resources": { + "aws_instance.web": { + "type": "aws_instance", + "depends_on": [ + "aws_security_group.allow_all", + "aws_subnet.public.*" + ], + "primary": { + "id": "i-085dc8a6b01f04dc0", + "attributes": { + "ami": "ami-58d37322", + "associate_public_ip_address": "true", + "availability_zone": "us-east-1a", + "disable_api_termination": "false", + "ebs_block_device.#": "0", + "ebs_optimized": "false", + "ephemeral_block_device.#": "0", + "iam_instance_profile": "", + "id": "i-085dc8a6b01f04dc0", + "instance_state": "running", + "instance_type": "t2.micro", + "ipv6_addresses.#": "0", + "key_name": "dthornton", + "monitoring": "false", + "network_interface.#": "0", + "network_interface_id": "eni-2b936a3d", + "primary_network_interface_id": "eni-2b936a3d", + "private_dns": "ip-10-10-1-252.ec2.internal", + "private_ip": "10.10.1.252", + "public_dns": "", + "public_ip": "34.237.1.135", + "root_block_device.#": "1", + "root_block_device.0.delete_on_termination": "true", + "root_block_device.0.iops": "100", + "root_block_device.0.volume_size": "8", + "root_block_device.0.volume_type": "gp2", + "security_groups.#": "0", + "source_dest_check": "true", + "subnet_id": "subnet-36c54a52", + "tags.%": "0", + "tenancy": "default", + "volume_tags.%": "0", + "vpc_security_group_ids.#": "1", + "vpc_security_group_ids.1011343189": "sg-288adf5a" + }, + "meta": { + "e2bfb730-ecaa-11e6-8f88-34363bc7c4c0": { + "create": 600000000000, + "delete": 600000000000, + "update": 600000000000 + }, + "schema_version": "1" + }, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_internet_gateway.igw": { + "type": "aws_internet_gateway", + "depends_on": [ + "aws_vpc.main" + ], + "primary": { + "id": "igw-ffb60386", + "attributes": { + "id": "igw-ffb60386", + "vpc_id": "vpc-21ce6f59" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_route_table.public": { + "type": "aws_route_table", + "depends_on": [ + "aws_internet_gateway.igw", + "aws_vpc.main" + ], + "primary": { + "id": "rtb-e7f18b9d", + "attributes": { + "id": "rtb-e7f18b9d", + "propagating_vgws.#": "0", + "route.#": "1", + "route.2793025681.cidr_block": "0.0.0.0/0", + "route.2793025681.egress_only_gateway_id": "", + "route.2793025681.gateway_id": "igw-ffb60386", + "route.2793025681.instance_id": "", + "route.2793025681.ipv6_cidr_block": "", + "route.2793025681.nat_gateway_id": "", + "route.2793025681.network_interface_id": "", + "route.2793025681.vpc_peering_connection_id": "", + "tags.%": "1", + "tags.Name": "david-opseng-challenge-dev-us-east-1a", + "vpc_id": "vpc-21ce6f59" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_route_table_association.public_assoc.0": { + "type": "aws_route_table_association", + "depends_on": [ + "aws_route_table.public", + "aws_subnet.public.*" + ], + "primary": { + "id": "rtbassoc-1781266a", + "attributes": { + "id": "rtbassoc-1781266a", + "route_table_id": "rtb-e7f18b9d", + "subnet_id": "subnet-36c54a52" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_route_table_association.public_assoc.1": { + "type": "aws_route_table_association", + "depends_on": [ + "aws_route_table.public", + "aws_subnet.public.*" + ], + "primary": { + "id": "rtbassoc-33882f4e", + "attributes": { + "id": "rtbassoc-33882f4e", + "route_table_id": "rtb-e7f18b9d", + "subnet_id": "subnet-140ae23b" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_security_group.allow_all": { + "type": "aws_security_group", + "depends_on": [ + "aws_vpc.main" + ], + "primary": { + "id": "sg-288adf5a", + "attributes": { + "description": "Allow all inbound traffic", + "egress.#": "1", + "egress.482069346.cidr_blocks.#": "1", + "egress.482069346.cidr_blocks.0": "0.0.0.0/0", + "egress.482069346.description": "", + "egress.482069346.from_port": "0", + "egress.482069346.ipv6_cidr_blocks.#": "0", + "egress.482069346.prefix_list_ids.#": "0", + "egress.482069346.protocol": "-1", + "egress.482069346.security_groups.#": "0", + "egress.482069346.self": "false", + "egress.482069346.to_port": "0", + "id": "sg-288adf5a", + "ingress.#": "1", + "ingress.482069346.cidr_blocks.#": "1", + "ingress.482069346.cidr_blocks.0": "0.0.0.0/0", + "ingress.482069346.description": "", + "ingress.482069346.from_port": "0", + "ingress.482069346.ipv6_cidr_blocks.#": "0", + "ingress.482069346.protocol": "-1", + "ingress.482069346.security_groups.#": "0", + "ingress.482069346.self": "false", + "ingress.482069346.to_port": "0", + "name": "allow_all", + "owner_id": "505545132866", + "tags.%": "0", + "vpc_id": "vpc-21ce6f59" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_subnet.public.0": { + "type": "aws_subnet", + "depends_on": [ + "aws_vpc.main" + ], + "primary": { + "id": "subnet-36c54a52", + "attributes": { + "assign_ipv6_address_on_creation": "false", + "availability_zone": "us-east-1a", + "cidr_block": "10.10.1.0/24", + "id": "subnet-36c54a52", + "map_public_ip_on_launch": "true", + "tags.%": "1", + "tags.Name": "david-opseng-challenge-dev-subnet", + "vpc_id": "vpc-21ce6f59" + }, + "meta": { + "schema_version": "1" + }, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_subnet.public.1": { + "type": "aws_subnet", + "depends_on": [ + "aws_vpc.main" + ], + "primary": { + "id": "subnet-140ae23b", + "attributes": { + "assign_ipv6_address_on_creation": "false", + "availability_zone": "us-east-1b", + "cidr_block": "10.10.2.0/24", + "id": "subnet-140ae23b", + "map_public_ip_on_launch": "true", + "tags.%": "1", + "tags.Name": "david-opseng-challenge-dev-subnet", + "vpc_id": "vpc-21ce6f59" + }, + "meta": { + "schema_version": "1" + }, + "tainted": false + }, + "deposed": [], + "provider": "" + }, + "aws_vpc.main": { + "type": "aws_vpc", + "depends_on": [], + "primary": { + "id": "vpc-21ce6f59", + "attributes": { + "assign_generated_ipv6_cidr_block": "false", + "cidr_block": "10.10.0.0/16", + "default_network_acl_id": "acl-527c592a", + "default_route_table_id": "rtb-10eb916a", + "default_security_group_id": "sg-a188ddd3", + "dhcp_options_id": "dopt-7fe61d1a", + "enable_classiclink": "false", + "enable_classiclink_dns_support": "false", + "enable_dns_hostnames": "false", + "enable_dns_support": "true", + "id": "vpc-21ce6f59", + "instance_tenancy": "default", + "main_route_table_id": "rtb-10eb916a", + "tags.%": "1", + "tags.Name": "david-opseng-challenge-dev-vpc" + }, + "meta": { + "schema_version": "1" + }, + "tainted": false + }, + "deposed": [], + "provider": "" + } + }, + "depends_on": [] + } + ] +} diff --git a/terraform/terraform.tfvars b/terraform/terraform.tfvars new file mode 100644 index 0000000..d28979a --- /dev/null +++ b/terraform/terraform.tfvars @@ -0,0 +1,6 @@ +project="david-opseng-challenge" +env="dev" +key_name="dthornton" +vpc_cidr="10.10.0.0/16" +cidrs="10.10.1.0/24,10.10.2.0/24" +azs="us-east-1a,us-east-1b"