NEW: remote-state

This commit is contained in:
xpk
2020-08-07 10:12:46 +08:00
parent 6cb61312f7
commit be750e31a1
3 changed files with 28 additions and 0 deletions
@@ -0,0 +1,10 @@
data "terraform_remote_state" "vpc" {
backend = "local"
config = {
path = "../vpc-subnets/terraform.tfstate"
}
}
output "vpc_id" {
value = data.terraform_remote_state.vpc.outputs.vpc_id
}
+15
View File
@@ -0,0 +1,15 @@
variable "aws_access_key" {}
variable "aws_secret_key" {}
variable "aws_region" {}
provider "aws" {
access_key = var.aws_access_key
secret_key = var.aws_secret_key
region = var.aws_region
version = ">= 2.28.1"
}
variable "default-tags" {}
variable "vpc-cidr" {
default = "172.16.0.0/16"
}
+3
View File
@@ -25,3 +25,6 @@ module "vpc" {
} }
output "vpc_id" {
value = module.vpc.vpc_id
}