Open prajith-nair opened 7 months ago
Voting for Prioritization
Volunteering to Work on This Issue
Same problem here.
│ Error: Missing required argument
│
│ with module.network.module.vpc.aws_default_network_acl.this[0],
│ on .terraform\modules\network.vpc\main.tf line 1262, in resource "aws_default_network_acl" "this":
│ 1262: default_network_acl_id = aws_vpc.this[0].default_network_acl_id
│
│ The argument "default_network_acl_id" is required, but no definition was found.
Same problem here, this has actually become a blocker for me.
Still a problem in version 5.8.1
Well, same issue here. Interestingly, it works locally, but when I'm using the same code on an AWS CodeBuild pipeline, it raises the same error. Any workaround?
I get the error during the apply
, and subsequent runs during the plan
stage as well, effectively blocking our pipeline.
I observed the same issue and tested with 5.8.1 also and was able to reproduce, eg. Error: Missing required argument with module.vpc-standard.aws_default_network_acl.this[0], on .terraform/modules/vpc-standard/main.tf line 1280, in resource "aws_default_network_acl" "this": 1280: default_network_acl_id = aws_vpc.this[0].default_network_acl_id The argument "default_network_acl_id" is required, but no definition was found.
I traced this back to missing permission(s) in the IAM role, in my case the permissions were: ec2:CreateNetworkAclEntry ec2:DescribeNetworkAcls ec2:DeleteNetworkAclEntry
Once I added the permissions to the role the issue was no longer evident. @lacg This would also explain your issue as you will likely find your pipeline is using a different role to running it locally.
Hope that helps.
Thank you, I’ll try!
It works here now! Thank you @craigjbutler !
Terraform Core Version
v1.7.3
AWS Provider Version
v5.36.0
Affected Resource(s)
aws_vpc
Expected Behavior
when
manage_default_network_acl = true
is enabled, the parameter default_network_acl_id should not be defined.Actual Behavior
terraform apply
fails with The argument "default_network_acl_id" is required, but no definition was found.Relevant Error/Panic Output Snippet
Steps to Reproduce
create a vpc using terraform module terraform-aws-modules/vpc/aws with
manage_default_network_acl = true
and during next apply you will endup with below errorTerraform Configuration Files
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
No