broad-zoo-34077
04/28/2022, 1:56 PMlittle-author-61621
some-forest-96430
04/28/2022, 2:16 PMsome-forest-96430
04/28/2022, 2:18 PMlocals {
....
}
dependency "vpc" {
config_path = "../../vpc/${local.aws_service_name}"
mock_outputs_allowed_terraform_commands = ["init", "plan", "destroy", "apply", "import"]
mock_outputs = {
azs = ["eu-west-1a", "eu-west-1c"]
vpc_id = "vpc-99999999"
elasticache_subnets = ["172.0.9.0/24", "172.0.10.0/24"]
}
}
terraform {
source = "git::<ssh://git@github.com/cloudposse/terraform-aws-elasticache-redis.git//?ref=0.42.0>"
}
# Include all settings from the root terragrunt.hcl file
include {
path = find_in_parent_folders()
}
# the following part is filled in line with <https://github.com/cloudposse/terraform-aws-elasticache-redis#inputs>
# you may define your own parameters accordingly
inputs = {
name = local.aws_service_name
environment = local.environment
availability_zones = dependency.vpc.outputs.azs
vpc_id = dependency.vpc.outputs.vpc_id
#use_existing_security_groups = false
create_security_group = true
# give the following parameter as a list of objects. for more check this <https://github.com/cloudposse/terraform-aws-elasticache-redis/issues/153>
additional_security_group_rules = [{type = "ingress", from_port = 6379, to_port = 6379, protocol = "tcp", cidr_blocks = ["20.0.0.0/24", "20.0.1.0/24"]}]
subnets = dependency.vpc.outputs.elasticache_subnets
cluster_size = 1
instance_type = "cache.t3.small"
apply_immediately = true
automatic_failover_enabled = false
engine_version = "4.0.10"
family = "redis4.0"
multi_az_enabled = false
at_rest_encryption_enabled = false
transit_encryption_enabled = false
cloudwatch_metric_alarms_enabled = false
snapshot_retention_limit = 7
tags = {
...
}
}
some-forest-96430
04/28/2022, 2:19 PMsome-forest-96430
04/28/2022, 2:21 PMlocals {
aws_service_name = basename(get_terragrunt_dir())
}
terraform {
source = "git::<ssh://git@github.com/terraform-aws-modules/terraform-aws-vpc.git//.?ref=v3.12.0>"
}
include {
path = find_in_parent_folders()
}
# the following part is filled in line with <https://github.com/terraform-aws-modules/terraform-aws-vpc#inputs>
# you may define your own parameters accordingly
inputs = {
name = local.aws_service_name
region = local.aws_region
cidr = "20.0.0.0/16"
public_subnets = ["20.0.0.0/24", "20.0.1.0/24"]
private_subnets = ["20.0.3.0/24", "20.0.4.0/24"]
database_subnets = ["20.0.6.0/24", "20.0.7.0/24"]
elasticache_subnets = ["20.0.9.0/24", "20.0.10.0/24"]
azs = ["eu-west-1a", "eu-west-1c"]
public_subnet_suffix = "public"
private_subnet_suffix = "private"
database_subnet_suffix = "database"
elasticache_subnet_suffix = "elasticache"
create_database_subnet_route_table = true
enable_nat_gateway = true
vpc_tags = {}
private_subnet_tags = {
"Subnet" = "Private",
}
public_subnet_tags = {
"Subnet" = "Public"
}
tags = {
terraform = "true"
environment = local.aws_service_name
# please write your own department
department = ""
name = local.aws_service_name
}
}
little-author-61621
run-all
commands, not terragrunt show
directlylittle-author-61621
show
to mock_outputs_allowed_terraform_commands
?some-forest-96430
04/28/2022, 2:28 PMterragrunt run-all plan -out tfplan.binary
terragrunt show $(find . -name tfplan.binary)
some-forest-96430
04/28/2022, 2:32 PMrun-all plan
and show
commands sequentially has a known issue, thus I tried to do it with plan
and show
and still getting the same error. It is related to terragrunt itself, but I just wanted know if have you seen this problem anywhere else.little-author-61621
run-all
before. I know the --terragrunt-ignore-external-dependencies
is meant to be for run-all
but I’m curious if using it with terragrunt show
helps as well?some-forest-96430
04/28/2022, 3:09 PMterragrunt show --terragrunt-ignore-external-dependencies
? if so, I can trysome-forest-96430
04/28/2022, 3:13 PM$ terragrunt show tfplan-3.binary --terragrunt-ignore-external-dependencies
ERRO[0020] .../terragrunt.hcl is a dependency of .../terragrunt.hcl but detected no outputs. Either the target module has not been applied yet, or the module has no outputs. If this is expected, set the skip_outputs flag to true on the dependency block.
ERRO[0020] Unable to determine underlying exit code, so Terragrunt will exit with error code 1
little-author-61621
show
to mock_outputs_allowed_terraform_commands
help with anything?some-forest-96430
04/28/2022, 3:31 PMsome-forest-96430
04/28/2022, 4:13 PMterragrunt run-all plan -out tfplan.binary
to terragrunt plan -out tfplan.binary
here.little-author-61621
mock_outputs_allowed_terraform_commands
work?some-forest-96430
04/28/2022, 4:18 PMrun-all plan
little-author-61621
run-all plan
maybe --terragrunt-ignore-external-dependencies
is needed?some-forest-96430
04/28/2022, 4:20 PMsome-forest-96430
04/28/2022, 4:23 PMlittle-author-61621
some-forest-96430
04/28/2022, 4:46 PM