Description |
When attempting to deploy to your Azure Cloud via Terraform you may encounter a 404 error regarding a specific cloud config or activity log integration guid.
Activity Log error example: ERROR failed to run terraform apply: exist status 1 Error: [GET] https://demo.lacework.net/api/v2/CloudAccounts/DEMO_6E43532424H23424V2342JH3J42234AC [404] Not found
with module.az_activity_log.lacework_integration_azure_al.lacework, on .terraform/modules/az_activity_log/main.tf line 204, in resource "lacework_integration_azure_al" "lacework": 204: resource "lacework_integration_azure_al" "lacework {.... |
Scope | Azure Cloud, Terraform (Cloud Shell or local) |
Solution |
This issue is likely to occur if you have previously deployed via Terraform an integration for either Config or Activity Logs on this same Azure account and subsequently deleted it from the Lacework UI to prepare for the new deployment.
If you previously deployed via Terraform the state files may contain a reference to the previous integration. As you deleted from the Lacework UI, it did not remove this from Terraform. As a result, when running Terraform again for the new deployment it references the existing integration and attempts to make a GET request to this via the API endpoint:
GET ...api/v2/CloudAccounts/<integration_guid>
As this integration no longer exists, the API returns a 404 response. To resolve this issue, you can delete or tidy up the existing Terraform state files either locally or if previously deployed via Cloud Shell, the state files will exist within the folder “lacework” and then within azure-* folders.
This will clean up the state file and remove all existing references to the previous integration and resolve the 404 error the next time you run Terraform apply.
|