NEW: remote-state
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
@@ -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"
|
||||||
|
}
|
||||||
@@ -25,3 +25,6 @@ module "vpc" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output "vpc_id" {
|
||||||
|
value = module.vpc.vpc_id
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user