Skip to content

Instantly share code, notes, and snippets.

@pporada-gl
Last active October 18, 2016 13:48
Show Gist options
  • Save pporada-gl/50edfb12f2f41844cd60c1e42e7ffc5a to your computer and use it in GitHub Desktop.
Save pporada-gl/50edfb12f2f41844cd60c1e42e7ffc5a to your computer and use it in GitHub Desktop.
variable "region" {}
variable "aws_access_key" {}
variable "aws_secret_key" {}
variable "env" {}
variable "company" {}
data "terraform_remote_state" "build-vpc" {
backend = "s3"
config {
region = "us-east-1"
bucket = "${var.env}-${var.company}-terraform-state"
key = "vpc/${var.env}.tfstate"
}
}
provider "aws" {
region = "${var.region}"
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
}
module "bastion" {
source = "modules/bastion"
env = "${var.env}"
instance_type = "${var.ec2_bastion_instance_type}"
bastion_key_name = "${var.ec2_bastion_key_name}"
bastion_key_path = "${var.ec2_bastion_key_path}"
vpc_id = "${data.terraform_remote_state.build-vpc.vpc_id}"
vpc_cidr = "${var.vpc_cidr}"
peered_vpc_cidr = "${var.peered_vpc_cidr}"
subnet_ids = "${data.terraform_remote_state.build-vpc.public_subnet_ids}"
company_ip = "${var.company_ip}"
shell_username = "${var.ec2_bastion_user}"
public_zone_id = "${data.terraform_remote_state.dns.public_zone_id}"
public_domain = "${data.terraform_remote_state.dns.public_domain}"
private_zone_id = "${data.terraform_remote_state.dns.private_zone_id}"
private_domain = "${data.terraform_remote_state.dns.private_domain}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment