diff --git a/apps/api_gateway_resource/main.tf b/apps/api_gateway_resource/main.tf index c568ad90..b21d3b6a 100644 --- a/apps/api_gateway_resource/main.tf +++ b/apps/api_gateway_resource/main.tf @@ -1,9 +1 @@ -provider "aws" { -} - -module "aws_core_data" { - source = "../../data_providers/aws_account_core_data" - providers = { - aws = "aws" - } -} +provider "aws" {} diff --git a/apps/cloudwatch_lambda/main.tf b/apps/cloudwatch_lambda/main.tf index 2b18d536..b21d3b6a 100644 --- a/apps/cloudwatch_lambda/main.tf +++ b/apps/cloudwatch_lambda/main.tf @@ -1,10 +1 @@ -provider "aws" { -} - -module "aws_core_data" { - //source = "git@github.com:albumprinter/eops_tf_modules.git//data_providers/aws_account_core_data" - source = "../../data_providers/aws_account_core_data" - providers = { - aws = "aws" - } -} +provider "aws" {} diff --git a/apps/cloudwatch_lambda_schedule/main.tf b/apps/cloudwatch_lambda_schedule/main.tf index 7c6fd567..05821dd8 100644 --- a/apps/cloudwatch_lambda_schedule/main.tf +++ b/apps/cloudwatch_lambda_schedule/main.tf @@ -1,11 +1,2 @@ -providers = { - aws = "aws" - } +provider "aws" {} -module "aws_core_data" { - //source = "git@github.com:albumprinter/eops_tf_modules.git//data_providers/aws_account_core_data" - source = "../../data_providers/aws_account_core_data" - providers = { - aws = "aws" - } -} diff --git a/apps/cluster/main.tf b/apps/cluster/main.tf index fa7977c0..0ba4da65 100644 --- a/apps/cluster/main.tf +++ b/apps/cluster/main.tf @@ -1,16 +1,9 @@ -provider "aws" { -} +provider "aws" {} module "aws_core_data" { -// source = "git@github.com:albumprinter/eops_tf_modules.git//data_providers/aws_account_core_data" - source = "../../data_providers/aws_account_core_data" + source = "../../data_providers/shared-vpc-data" + account_type = "${var.account_type}" providers = { - aws = "aws" - } + aws = "aws" + } } - -// For local development use instead: -//module "aws_core_data" { -// source = "../../data_providers/aws_account_core_data" -//} - diff --git a/apps/cluster/variables.tf b/apps/cluster/variables.tf index 8b1a1cef..45386935 100644 --- a/apps/cluster/variables.tf +++ b/apps/cluster/variables.tf @@ -1,9 +1,7 @@ variable "region" { default = "eu-west-1" } -variable "account_type" { - default = "sandbox" -} +variable "account_type" {} variable "tags_business_unit" { default = "Albumprinter" } @@ -33,7 +31,7 @@ variable "private" { variable "response_template" { type = "map" - default ={ + default = { "application/json" = "" } } @@ -42,7 +40,7 @@ variable "instance_count" { default = 1 } variable "iam_policy_document" { - default =<USAGE: Module will peer the "Main" VPC from the source account with the target "Main" VPC. +This module will not work with the Shared VPCs

Required Parameters:

These must be set in your call to this module: diff --git a/apps/vpc_peering/main.tf b/apps/vpc_peering/main.tf index 7e29a4fd..f8b71d4e 100644 --- a/apps/vpc_peering/main.tf +++ b/apps/vpc_peering/main.tf @@ -1,27 +1,14 @@ # Data sources module "local_data" { - //source = "git@github.com:albumprinter/eops_tf_modules.git//data_providers/local-get-data" source = "../../data_providers/local-get-data" # See repo for possible outputs } -//data "aws_caller_identity" "current" {} - -//data "terraform_remote_state" "terraform-ap" { -// backend = "s3" -// -// config { -// bucket = "${var.tf-remote-state-bucket-name}" -// key = "${data.aws_caller_identity.current.account_id}/vpcPeering_DB-ecom1/terraform.tfstate" -// region = "eu-west-1" -// acl = "bucket-owner-full-control" -// } -//} provider "aws" { - region = "eu-west-1" - alias = "source_provider" + region = "eu-west-1" + alias = "source_provider" version = "~> 0.1" assume_role { role_arn = "arn:aws:iam::${var.peer_source_account_id}:role/main_provisioner" @@ -40,8 +27,8 @@ data "aws_caller_identity" "source_account" { } provider "aws" { - region = "eu-west-1" - alias = "target_provider" + region = "eu-west-1" + alias = "target_provider" version = "~> 0.1" assume_role { role_arn = "arn:aws:iam::${var.peer_target_account_id}:role/main_provisioner" diff --git a/data_providers/shared-vpc-data/data.tf b/data_providers/shared-vpc-data/data.tf index 6c3193d2..0f92feb8 100644 --- a/data_providers/shared-vpc-data/data.tf +++ b/data_providers/shared-vpc-data/data.tf @@ -33,3 +33,9 @@ data "aws_subnet" "private" { count = "${length(data.aws_subnet_ids.private.ids)}" id = "${data.aws_subnet_ids.private.ids[count.index]}" } +data "aws_caller_identity" "current" {} +data "aws_availability_zones" "available" {} + +data "aws_vpc_endpoint_service" "s3" { + service = "s3" +} diff --git a/data_providers/shared-vpc-data/outputs.tf b/data_providers/shared-vpc-data/outputs.tf index 12d36326..5ef2cfe1 100644 --- a/data_providers/shared-vpc-data/outputs.tf +++ b/data_providers/shared-vpc-data/outputs.tf @@ -13,3 +13,18 @@ output "public_subnet_ids" { output "private_subnet_ids" { value = ["${data.aws_subnet_ids.private.ids}"] } +output "account_id" { + value = "${data.aws_caller_identity.current.account_id}" +} + +output "availability_zones" { + value = "${data.aws_availability_zones.available.names}" +} + +output "public_subnets" { + value = "${data.aws_subnet_ids.public.ids}" +} + +output "private_subnets" { + value = "${data.aws_subnet_ids.private.ids}" +}