Closed reggora-mmatney closed 1 year ago
Thanks for the wonderfully detailed bug report, working on this right now.
Thanks @theopolis! Can we expect this to be patched in v0.14.1
and is there a rough timeline on when it will be released?
Thanks for your patience, I know this bug is frustrating, I will schedule a release soon.
Describe the bug
It looks like this change https://github.com/lacework/terraform-aws-agentless-scanning/pull/101 released yesterday https://github.com/lacework/terraform-aws-agentless-scanning/releases/tag/v0.14.0 might have introduced a bug that causes a reoccurring drift in the Terraform plan.
The new
aws_default_network_acl
resource added in https://github.com/lacework/terraform-aws-agentless-scanning/pull/101 adopts the default network ACL, which is expected.However, the new resource configuration does not include an explicit association with the
agentless_scan_public_subnet
created here - https://github.com/lacework/terraform-aws-agentless-scanning/blob/2ba767d27d01e493f1a6433bce206644a15b2d52/main.tf#L937-L948If you refer to the AWS provider documentation - https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/default_network_acl#managing-subnets-in-a-default-network-acl
Since the
agentless_scan_public_subnet
is not explicitly associated with the new default network ACL, it is resulting in a permanent drift in the Terraform state where the implicit association of the subnet is removed on every planSteps to reproduce
Update Lacework module to
v0.14.0
and runterraform plan
. The plan will show a change to remove the subnet id association from the default network ACL resource. When applied, the subnet gets immediately re-associated with the default network ACL by AWS since within a VPC, all subnets must be associated with a network ACL. The subsequent plan then shows the change to remove the subnet id association from the default network ACL resource. Rinse and repeat.Expected behavior
The plan should not show a change to disassociate the subnet from the default network ACL.
Screenshots
Version Information
Additional context
This should be fixed by adding the
agentless_scan_public_subnet
id to thesubnet_ids
argument in the default network ACL resourceE.G. something like