Skip to content
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

add support for Cloud Armor Edge Policies #5794

Merged
merged 6 commits into from
Mar 24, 2022

Conversation

ScottSuarez
Copy link
Contributor

closes hashicorp/terraform-provider-google#10761

Release Note Template for Downstream PRs (will be copied)

compute: added support for field `type` to `google_compute_security_policy`
compute: added support for attaching a `edge_security_policy` to `google_compute_backend_bucket`

@ScottSuarez ScottSuarez requested a review from slevenick March 5, 2022 01:52
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 7 files changed, 241 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 7 files changed, 242 insertions(+), 6 deletions(-))
TF Validator: Diff ( 4 files changed, 26 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 4 files changed, 120 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic|TestAccDataSourceSqlDatabaseInstance_basic|TestAccBigqueryReservationAssignment_BasicHandWritten|TestAccCGCSnippet_sqlSqlserverInstanceAuthorizedNetworkExample|TestAccCloudBuildTrigger_cloudbuildTriggerPubsubConfigExample|TestAccCloudBuildTrigger_cloudbuildTriggerWebhookConfigExample|TestAccCloudBuildTrigger_cloudbuildTriggerManualExample|TestAccCloudBuildTrigger_cloudbuildTriggerFilenameExample|TestAccCloudBuildTrigger_cloudbuildTriggerBuildExample|TestAccCloudBuildTrigger_basic|TestAccCloudBuildTrigger_available_secrets_config|TestAccCloudBuildTrigger_cloudbuildTriggerServiceAccountExample|TestAccCloudBuildTrigger_disable|TestAccCloudBuildTrigger_fullStep|TestAccComputeBackendBucket_backendBucketSecurityPolicyExample|TestAccComputeBackendBucket_withSecurityPolicy|TestAccComputeSecurityPolicy_basic|TestAccComputeSecurityPolicy_update|TestAccContainerCluster_withAuthenticatorGroupsConfig You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=264834

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode: TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic|TestAccComputeBackendBucket_withSecurityPolicy|TestAccComputeBackendBucket_backendBucketSecurityPolicyExample|TestAccCGCSnippet_sqlSqlserverInstanceAuthorizedNetworkExample|TestAccComputeSecurityPolicy_update|TestAccContainerCluster_withAuthenticatorGroupsConfig|TestAccDataSourceSqlDatabaseInstance_basic Please fix these to complete your PR

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Looks like tests are failing?

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 7 files changed, 239 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 7 files changed, 240 insertions(+), 6 deletions(-))
TF Validator: Diff ( 4 files changed, 26 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 4 files changed, 119 insertions(+))

@ScottSuarez
Copy link
Contributor Author

/gcbrun

@ScottSuarez ScottSuarez requested a review from slevenick March 10, 2022 19:25
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 7 files changed, 239 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 7 files changed, 240 insertions(+), 6 deletions(-))
TF Validator: Diff ( 4 files changed, 26 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 4 files changed, 119 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic|TestAccDataSourceSqlDatabaseInstance_basic|TestAccApikeysKey_AndroidKey|TestAccApikeysKey_BasicKey|TestAccApikeysKey_IosKey|TestAccApikeysKey_MinimalKey|TestAccApikeysKey_ServerKey|TestAccArtifactRegistryRepository_create_mvn_snapshot|TestAccArtifactRegistryRepository_create_mvn_release|TestAccCGCSnippet_sqlMysqlInstanceBackupExample|TestAccCGCSnippet_sqlPostgresInstanceBackupExample|TestAccCGCSnippet_sqlSqlserverInstanceBackupExample|TestAccCGCSnippet_sqlSqlserverInstanceBackupLocationExample|TestAccCloudFunctionsFunction_secretEnvVar|TestAccComputeBackendBucket_backendBucketSecurityPolicyExample|TestAccComputeBackendBucket_withSecurityPolicy|TestAccContainerAwsCluster_BasicHandWritten|TestAccContainerCluster_withAuthenticatorGroupsConfig|TestAccContainerNodePool_gvnic|TestAccDataprocCluster_nonPreemptibleSecondary|TestAccDataprocCluster_updatable|TestAccDataprocCluster_withConfigOverrides You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=267025

@ScottSuarez
Copy link
Contributor Author

Everything should be kosher here @slevenick ^-^

@@ -0,0 +1,19 @@
// security_policy isn't set by Create / Update
Copy link
Contributor

Choose a reason for hiding this comment

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

This exists in the post_create, but what if the user goes from this field being unset on a bucket to setting it? Should the field be ForceNew or do we also need this in the Update call?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh this is used as post_update as well, makes sense

Copy link
Contributor

Choose a reason for hiding this comment

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

Can the update part of this be done by setting update_url on this specific field in the terraform.yaml? It allows calling a specific endpoint for a specific field

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this would complicate things further by having two separate pathways to do the same thing. This way unifies the codepaths. I would be against such a change.


spr := emptySecurityPolicyReference()
spr.SecurityPolicy = pol.RelativeLink()
op, err := config.NewComputeClient(userAgent).BackendBuckets.SetEdgeSecurityPolicy(project, obj["name"].(string), spr).Do()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do this through the HTTP client directly? It feels a little awkward to add a dependency on the client libraries to a mmv1-based resource

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ScottSuarez ScottSuarez requested a review from slevenick March 17, 2022 16:35
@ScottSuarez
Copy link
Contributor Author

fixed spacing, awaiting response for other suggestions

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 7 files changed, 239 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 7 files changed, 240 insertions(+), 6 deletions(-))
TF Validator: Diff ( 4 files changed, 26 insertions(+), 3 deletions(-))
TF OiCS: Diff ( 4 files changed, 119 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceSqlDatabaseInstance_basic|TestAccCGCSnippet_sqlMysqlInstanceBackupExample|TestAccCGCSnippet_sqlMysqlInstanceAuthorizedNetworkExample|TestAccCGCSnippet_sqlSqlserverInstanceBackupRetentionExample|TestAccCGCSnippet_sqlSqlserverInstanceBackupLocationExample|TestAccContainerCluster_withAuthenticatorGroupsConfig|TestAccLoggingLogView_BasicHandWritten|TestAccNetworkServicesEdgeCacheOrigin_networkServicesEdgeCacheOriginAdvancedExample|TestAccNetworkServicesEdgeCacheOrigin_updateAndImport|TestAccNetworkServicesEdgeCacheService_networkServicesEdgeCacheServiceAdvancedExample|TestAccNetworkServicesEdgeCacheService_updateAndImport|TestAccOSConfigPatchDeployment_osConfigPatchDeploymentDailyMidnightExample You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=269575

betsy-lichtenberg pushed a commit to betsy-lichtenberg/magic-modules that referenced this pull request Apr 25, 2022
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.

Add support for Cloud Armor Edge policies
3 participants