ECI-1625: (fix) add depends_on to prevent race condition in default security list#119
Merged
Merged
Conversation
Two Terraform resources (module.vcn's lockdown resource and oci_core_default_security_list.dd_default) both manage the same VCN default security list. Without explicit ordering, they can apply concurrently: if lockdown wins, the list is left with empty egress rules and functions cannot reach OCIR, causing FunctionInvokeImageNotAvailable. Adding depends_on = [module.vcn] ensures the VCN module (and its lockdown resource) completes before dd_default writes the correct egress rules. Since lockdown has ignore_changes, it will not overwrite dd_default on subsequent applies. Fixes: ECI-1625 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9231e53 to
65c3683
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
depends_on = [module.vcn]tooci_core_default_security_list.dd_defaultin bothdatadog-integrationanddatadog-terraform-onboardingregional-stacks modules.Why
PR #99 (CLOUDS-7599) introduced a race condition where two Terraform resources simultaneously manage the same VCN default security list via
manage_default_resource_id:module.vcn[0](upstreamoracle-terraform-modules/vcn/oci) internally createsoci_core_default_security_list.lockdown, which writes empty rules (no egress, no ingress) and haslifecycle { ignore_changes = [...] }.oci_core_default_security_list.dd_default— writes the correct minimal rules: egress-all (required for OCIR image pulls) + two ICMP-only ingress rules.Both target the same security list ID. The OCI audit log shows two
UpdateSecurityListcalls ~158ms apart during apply. Iflockdownwins the race, the list is left with empty egress — functions cannot reach OCIR → 502FunctionInvokeImageNotAvailable. Becauselockdownhasignore_changes, Terraform won't self-correct on subsequent applies.depends_on = [module.vcn]enforces ordering: the entire VCN module (including its hiddenlockdownresource) completes beforedd_defaultwrites the correct rules. Sincelockdownhasignore_changes, it won't overwritedd_defaultafterward.References
dd-metrics-forwarderanddd-logs-forwardererror withFunctionInvokeImageNotAvailable#109