Terragrunt/Terraform doesn't create the vpc/sg in aws

2 scenarios

First
I have been struggling to create a simple infra (ec2, elb, sec group, vpc). What I do is draw the the infra in:
Cloudcraft,
Download as terraform code
and Run with terragrunt apply-all.

*The s3 bucket is created successfully

Hit multiple errors:
exit status 1
Cannot process module Module ~/aws-tf/vpc-sg-test/vpc-sg-test/eu-north-1/vpc (excluded: false, dependencies: [~/aws-tf/vpc-sg-test/vpc-sg-test/eu-north-1/aws-data]) because one of its dependencies, Module ~/aws-tf/vpc-sg-test/vpc-sg-test/eu-north-1/aws-data (excluded: false, dependencies: ), finished with an error: Hit multiple errors:
exit status 1.

Second
I cloned GitHub - antonbabenko/modules.tf-demo: Real modules.tf demo (updated May 2021). following the instructions + video. When I run apply-all, S3 bucket is created, but no resources added.

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Releasing state lock. This may take a few moments…
[terragrunt] [~/aws-tf/modules.tf-demo-master/web_app_reference_architecture_complete/eu-west-1/vpc] 2020/01/29 08:26:36 Detected 1 Hooks

[terragrunt] [~/aws-tf/modules.tf-demo-master/web_app_reference_architecture_complete/eu-west-1/vpc] 2020/01/29 08:26:36 Module ~/aws-tf/modules.tf-demo-master/web_app_reference_architecture_complete/eu-west-1/vpc has finished successfully!

Can you show the TF code?

this is for the vpc:

this is for all code:

Hi camo-ma,

For the first issue, we don’t have enough information in the log snippet you shared to fully understand what might be the issue. This indicates that terragrunt encountered an error trying to apply the module ~/aws-tf/vpc-sg-test/vpc-sg-test/eu-north-1/aws-data, but you haven’t shared the point in the logs with the terraform error for that module.

You can either:

  • Scroll through the logs to find the error from terraform.
  • Apply just that module to get the error message at the end of the logs. You can do this by cd-ing to that folder and running terragrunt apply.

For the second issue, we don’t actively maintain or use modules.tf, so we can’t really help you with that. I would suggest filing a github issue with this exact message in that repo and see if Anton Babenko (the maintainer) can help you out.

Best regards,
Yori

Thanks @yoriy for mentioning my name on this issue, so I can try to help @camo-ma to resolve the issue (we have moved to github issue).

I’d like to highlight that running terragrunt apply in a subdirectory is an easy way to figure out the problem.

2 Likes