Skip to content

Fix: Add depends_on in ingress policies resources #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

mariammartins
Copy link
Contributor

This PR contains the addition of a depends_on with the resources that add projects to the perimeter, in the resources that create ingress policies, correcting the error generated by the VPC Service Controls module when it needs to add a project to the perimeter, and create an ingress rule for the same project, at the same time.

Error: Error creating ServicePerimeterIngressPolicy: googleapi: Error 400: Invalid Directional Policies set in Perimeter 'accessPolicies/ACCESS_CONTEXT_MANAGER_ID/servicePerimeters/SERVICE_PERIMETER_NAME': Error in IngressTo: 'projects/PROJECT_NUMBER is defined in IngressTo.resources, but it is not present in ServicePerimeterConfig.resources. Only resources protected by this Service Perimeter can be put in IngressTo.resources.

With the addition of this depends_on, the module will always add the project before creating the ingress policy for it.

@mariammartins mariammartins requested review from imrannayer and a team as code owners August 7, 2025 17:22
Copy link
Contributor

@apeabody apeabody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mariammartins!

@apeabody apeabody merged commit afa2f87 into terraform-google-modules:main Aug 7, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants