Skip to content

Instantly share code, notes, and snippets.

@blogumi
Created June 8, 2020 17:33
Show Gist options
  • Save blogumi/6c33de59fe7a08865ca35379925a845a to your computer and use it in GitHub Desktop.
Save blogumi/6c33de59fe7a08865ca35379925a845a to your computer and use it in GitHub Desktop.
# 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