Created
June 8, 2020 17:33
-
-
Save blogumi/6c33de59fe7a08865ca35379925a845a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define the Terraform source module to use: an RDS database module in this example | |
terraform { | |
source = "git::git@github.com:terraform-aws-modules/terraform-aws-rds?ref=v2.13.0" | |
} | |
# Define dependencies | |
dependency "vpc" { | |
config_path = "../path/to/vpc_module" | |
} | |
dependency "sg" { | |
config_path = "../path/to/security_group_module" | |
} | |
dependency "some_other_dep" { | |
config_path = "../other/variables/for/making/an/RDS_database" | |
} | |
# Terraform modules have ‘variables’ that need to be populated before that | |
# module can be run. In Terraform, these are provided by a static file. | |
# In Terragrunt, this `input` block can be used to dynamically supply those variables! | |
inputs = { | |
identifier = "backend" | |
db_subnet_group_name = dependency.vpc.outputs.database_subnet_group | |
vpc_security_group_ids = [dependency.sg.outputs.this_security_group_id] | |
other_necessary_variables = dependency.some_other_dep.outputs.any_output | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment