Skip to main content
added 3 characters in body
Source Link
Pierre.Vriens
  • 7.2k
  • 14
  • 37
  • 84

I believe you would be using multiple modules to create various resources(EC2,ELB, Etc) in AWS using Terraform. You can create a custom module having output value of each variable you want to configure per your requirement like aws-region, etc. 

Then source(import) this custom module into your resource module and use its values using $.

custom_module

output "aws_region" {
  value = "us-xyz-1"
}
output "aws_anyproperty" {
  value = "abc"
}

Add above custom_module as source in your resource module

module "custom_module" {
  source="../../../modules/custom_module"
}

provider "aws" {
  version="~> y.x"
  profile="${module.custom_module.aws_anyproperty}"
  region="${module.custom_module.aws_region}"
}

I believe you would be using multiple modules to create various resources(EC2,ELB, Etc) in AWS using Terraform. You can create a custom module having output value of each variable you want to configure per your requirement like aws-region, etc. Then source(import) this custom module into your resource module and use its values using $.

custom_module

output "aws_region" {
  value = "us-xyz-1"
}
output "aws_anyproperty" {
  value = "abc"
}

Add above custom_module as source in your resource module

module "custom_module" {
  source="../../../modules/custom_module"
}

provider "aws" {
  version="~> y.x"
  profile="${module.custom_module.aws_anyproperty}"
  region="${module.custom_module.aws_region}"
}

I believe you would be using multiple modules to create various resources(EC2,ELB, Etc) in AWS using Terraform. You can create a custom module having output value of each variable you want to configure per your requirement like aws-region, etc. 

Then source(import) this custom module into your resource module and use its values using $.

custom_module

output "aws_region" {
  value = "us-xyz-1"
}
output "aws_anyproperty" {
  value = "abc"
}

Add above custom_module as source in your resource module

module "custom_module" {
  source="../../../modules/custom_module"
}

provider "aws" {
  version="~> y.x"
  profile="${module.custom_module.aws_anyproperty}"
  region="${module.custom_module.aws_region}"
}

I believe you would be using multiple modules to create various resources(EC2,ELB, Etc) in AWS using Terraform. You can create a custom module having output value of each variable you want to configure per your requirement like aws-region, etc. Then source(import) this custom module into your resource module and use its values using $.

custom_module

output "aws_region" { value = "us-xyz-1" } output "aws_anyproperty" { value = "abc" }

Add above custom_module as source in your resource module

module "custom_module" { source="../../../modules/custom_module" }

provider "aws" { version="~> y.x" profile="${module.custom_module.aws_anyproperty}" region="${module.custom_module.aws_region}" }

output "aws_region" {
  value = "us-xyz-1"
}
output "aws_anyproperty" {
  value = "abc"
}

Add above custom_module as source in your resource module

module "custom_module" {
  source="../../../modules/custom_module"
}

provider "aws" {
  version="~> y.x"
  profile="${module.custom_module.aws_anyproperty}"
  region="${module.custom_module.aws_region}"
}

I believe you would be using multiple modules to create various resources(EC2,ELB, Etc) in AWS using Terraform. You can create a custom module having output value of each variable you want to configure per your requirement like aws-region, etc. Then source(import) this custom module into your resource module and use its values using $.

custom_module

output "aws_region" { value = "us-xyz-1" } output "aws_anyproperty" { value = "abc" }

Add above custom_module as source in your resource module

module "custom_module" { source="../../../modules/custom_module" }

provider "aws" { version="~> y.x" profile="${module.custom_module.aws_anyproperty}" region="${module.custom_module.aws_region}" }

I believe you would be using multiple modules to create various resources(EC2,ELB, Etc) in AWS using Terraform. You can create a custom module having output value of each variable you want to configure per your requirement like aws-region, etc. Then source(import) this custom module into your resource module and use its values using $.

custom_module

output "aws_region" {
  value = "us-xyz-1"
}
output "aws_anyproperty" {
  value = "abc"
}

Add above custom_module as source in your resource module

module "custom_module" {
  source="../../../modules/custom_module"
}

provider "aws" {
  version="~> y.x"
  profile="${module.custom_module.aws_anyproperty}"
  region="${module.custom_module.aws_region}"
}
Source Link
GGG
  • 21
  • 1

I believe you would be using multiple modules to create various resources(EC2,ELB, Etc) in AWS using Terraform. You can create a custom module having output value of each variable you want to configure per your requirement like aws-region, etc. Then source(import) this custom module into your resource module and use its values using $.

custom_module

output "aws_region" { value = "us-xyz-1" } output "aws_anyproperty" { value = "abc" }

Add above custom_module as source in your resource module

module "custom_module" { source="../../../modules/custom_module" }

provider "aws" { version="~> y.x" profile="${module.custom_module.aws_anyproperty}" region="${module.custom_module.aws_region}" }