feat(query): implemented query to cover "Ensure Legacy Networks Do Not Exist For Older Project" for terraform/gcp#7822
Merged
Merged
Conversation
… Exist For Older Projects
Contributor
Contributor
|
You should update the assets/similarityID_transition/terraform_gcp.yaml file with a new entry corresponding to this query with change: 2 |
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.








Reason for Proposed Changes
Proposed Changes
auto_create_subnetworksis not defined ir is set to true, when it's associated with a resource of typegoogle_projectthrough the fieldprojector when this field is missing, through the provider defined on the template.projectfield is defined inside the resource of typegoogle_compute_network. In these cases, the fieldprojectis defined on the following syntaxgoogle_project.<GOOGLE_PROJECT_NAME>.id. So the policy just checks if the google project resource name is the same as the one referenced on the field and if it is, it returns a positive result if the fieldauto_create_subnetworksis not defined or is defined to true.projectfield is not defined inside thegoogle_compute_networkresource, and in these scenarios, the resource uses the value present on the provider(for this case, it can begoogleorgoogle-beta). in all the examples found through some research, the provider is defined with the following syntax:project_idfrom thegoogle_projectresource, which differs from the first case, which uses the name of thegoogle_projectresource.auto_create_subnetworksis unsafe.auto_create_subnetworkswas found on the google terraform provider official git repository, and its default value is set totruewhich should return a positive result.I submit this contribution under the Apache-2.0 license.