-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Org Security Policies (Hierarchical Firewalls) #3626
Org Security Policies (Hierarchical Firewalls) #3626
Conversation
This requires update of the client libraries ( It's still pending update support and more proper testing. If you have some ideas on how to handle those ops more cleanly let me know. |
Error from cloud build:
Unless you'd like to look into adding inspec support, I'd recommend adding an exclude for this resource in the relevant inspec.yaml file. |
New error from cloud build:
|
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=120098" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a first pass, have a few comments. I think the way you handled operations is totally fine- I can't think of anything obviously cleaner.
parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>" | ||
} | ||
|
||
resource "google_compute_organization_security_policy_rule" "<%= ctx[:primary_resource_id] %>" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is the test for the association resource, is the rule necessary to have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this is an (end-to-end) example, not a test. ;) But I don't mind removing it if it's clear for customers on the relationship of the 3 resources.
Hello! I am a robot who works on Magic Modules PRs. I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. Thanks for your contribution! A human will be with you soon. @ndmckinley, please review this PR or find an appropriate assignee. |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=122696" |
Hello! I am a robot who works on Magic Modules PRs. I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. Thanks for your contribution! A human will be with you soon. @danawillow, please review this PR or find an appropriate assignee. |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=122905" |
products/compute/api.yaml
Outdated
- !ruby/object:Api::Type::Array | ||
name: 'srcIpRanges' | ||
description: | | ||
Source IP address range in CIDR format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In validation.go, we have validateIpCidrRange
. Does that make sense to apply to these attributes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like validateFunc can't be used on arrays:
resource google_compute_organization_security_policy_rule: src_ip_ranges: ValidateFunc is not yet supported on lists or sets.
description: | | ||
A textual description for the organization security policy. | ||
- !ruby/object:Api::Type::String | ||
name: id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we normally just don't bother including server-defined ids unless they're actually necessary, like for referencing resources from others. Is this that sort of situation, or can this be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
policy_id
is needed to build the self_link for subsequent reads. Any way I can build the URL without the ID?
Format: organizations/{organization_id} or folders/{folder_id} | ||
required: true | ||
input: true | ||
properties: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could see name
and labels
being useful fields here. Any reason they're missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name
is the same as id
, not user defined:
$ gcloud beta compute org-security-policies describe test --organization 928204348109
---
creationTimestamp: '2020-07-28T15:47:24.153-07:00'
description: ''
displayName: test
fingerprint: Mj-VjR8Uz6g=
id: '819155619164'
kind: compute#securityPolicy
labelFingerprint: 42WmSpB8rSM=
name: '819155619164'
parent: organizations/928204348109
ruleTupleCount: 2
rules:
- action: goto_next
...
so not much value in including it IMO. labels
do not seem to be supported for OrganizationSecurityPolicies and this also seems to be a left over from Cloud Armor policies. They are not documented in the gcloud docs and when I try to create one with labels via API, the labels are not returned on a read call.
name: 'OrganizationSecurityPolicy' | ||
min_version: beta | ||
base_url: 'locations/global/securityPolicies?parentId={{parent}}' | ||
self_link: 'locations/global/securityPolicies/{{id}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://cloud.google.com/compute/docs/reference/rest/beta/organizationSecurityPolicies/get implies these can be read by name
. Is that not true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but name
is the same as id
.
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 107 files changed, 299 insertions(+), 56 deletions(-)) |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=136237" |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 107 files changed, 299 insertions(+), 56 deletions(-)) |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=136239" |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 108 files changed, 300 insertions(+), 56 deletions(-)) |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=136510" |
I don't have any further pending changes. Let me know on what you think about keeping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the info- almost there!
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 108 files changed, 300 insertions(+), 56 deletions(-)) |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=137492" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccEndpointsService_basic|TestAccFolderIamAuditConfig_multiple|TestAccRedisInstance_redisInstanceFullExample|TestAccRedisInstance_redisInstancePrivateServiceExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=137493" |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 108 files changed, 300 insertions(+), 56 deletions(-)) |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=137623" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceComputeNetworkEndpointGroup|TestAccDataSourceDnsManagedZone_basic|TestAccDataSourceDNSKeys_noDnsSec|TestAccDataSourceGoogleActiveFolder_space|TestAccDataSourceDNSKeys_basic|TestAccDataSourceGoogleActiveFolder_default|TestAccDataSourceGoogleBillingAccount_byDisplayName|TestAccDataSourceGoogleCloudFunctionsFunction_basic|TestAccDataSourceComputeBackendBucket_basic|TestAccDataSourceComputeBackendService_basic|TestAccDataSourceGoogleForwardingRule|TestAccDataSourceComputeImage|TestAccDataSourceGoogleComputeInstanceGroup_basic|TestAccDataSourceGoogleComputeInstanceGroup_withNamedPort|TestAccDataSourceGoogleComputeInstanceGroup_fromIGM|TestAccDataSourceComputeInstanceSerialPort_basic|TestAccDataSourceComputeInstance_basic|TestAccDataSourceGoogleNetwork|TestAccDataSourceComputeRouter|TestAccDataSourceComputeSslCertificate|TestAccDataSourceGoogleSslPolicy|TestAccDataSourceGoogleSubnetwork|TestAccDataSourceGoogleVpnGateway|TestAccContainerClusterDatasource_zonal|TestAccContainerClusterDatasource_regional|TestAccDataSourceGoogleFolderOrganizationPolicy_basic|TestAccDataSourceGoogleFolder_byFullName|TestAccDataSourceGoogleFolder_byShortName|TestAccDataSourceGoogleFolder_lookupOrganization|TestAccDataSourceGoogleFolder_byFullNameNotFound|TestAccDataKmsSecretCiphertext_basic|TestAccDataSourceGoogleOrganization_byDomain|TestAccDataSourceGoogleProject_basic|TestAccRedisInstanceDatasource_basic|TestAccDatasourceGoogleServiceAccountKey_basic|TestAccDatasourceGoogleServiceAccount_basic|TestAccDataSourceGoogleSQLCaCerts_basic|TestAccDataSourceGoogleMonitoringNotificationChannel_byDisplayName|TestAccDataSourceGoogleMonitoringNotificationChannel_byTypeAndLabel|TestAccDataSourceGoogleMonitoringNotificationChannel_UserLabel|TestAccDataSourceGoogleMonitoringNotificationChannel_byDisplayNameAndType|TestAccDataSourceGoogleMonitoringNotificationChannel_ErrorNotFound|TestAccDataSourceGoogleMonitoringNotificationChannel_ErrorNotUnique|TestAccDatasourceSecretManagerSecretVersion_basic|TestAccDatasourceSecretManagerSecretVersion_latest|TestAccDataSourceSqlDatabaseInstance_basic|TestAccBinaryAuthorizationAttestorIamBindingGenerated|TestAccBinaryAuthorizationAttestorIamMemberGenerated|TestAccBinaryAuthorizationAttestorIamPolicyGenerated|TestAccCloudFunctionsCloudFunctionIamBindingGenerated|TestAccCloudFunctionsCloudFunctionIamMemberGenerated|TestAccCloudFunctionsCloudFunctionIamPolicyGenerated|TestAccCloudRunServiceIamBindingGenerated|TestAccCloudRunServiceIamMemberGenerated|TestAccCloudRunServiceIamPolicyGenerated|TestAccComputeInstanceIamBindingGenerated|TestAccComputeInstanceIamMemberGenerated|TestAccComputeInstanceIamPolicyGenerated|TestAccComputeSubnetworkIamBindingGenerated|TestAccComputeSubnetworkIamMemberGenerated|TestAccDataCatalogEntryGroupIamBindingGenerated|TestAccComputeSubnetworkIamPolicyGenerated|TestAccDataCatalogEntryGroupIamMemberGenerated|TestAccIapAppEngineServiceIamBindingGenerated|TestAccDataCatalogEntryGroupIamPolicyGenerated|TestAccIapAppEngineServiceIamMemberGenerated|TestAccIapAppEngineServiceIamPolicyGenerated|TestAccIapAppEngineVersionIamBindingGenerated|TestAccIapAppEngineVersionIamMemberGenerated|TestAccIapAppEngineVersionIamPolicyGenerated|TestAccIapTunnelInstanceIamMemberGenerated|TestAccIapTunnelInstanceIamPolicyGenerated|TestAccIapWebBackendServiceIamBindingGenerated|TestAccIapTunnelInstanceIamBindingGenerated|TestAccIapWebBackendServiceIamPolicyGenerated|TestAccIapWebBackendServiceIamMemberGenerated|TestAccIapWebIamBindingGenerated|TestAccIapWebIamMemberGenerated|TestAccIapWebTypeAppEngineIamBindingGenerated|TestAccIapWebIamPolicyGenerated|TestAccIapWebTypeComputeIamBindingGenerated|TestAccIapWebTypeComputeIamMemberGenerated|TestAccPubsubTopicIamBindingGenerated|TestAccIapWebTypeComputeIamPolicyGenerated|TestAccIapWebTypeAppEngineIamMemberGenerated|TestAccPubsubTopicIamMemberGenerated|TestAccRuntimeConfigConfigIamBindingGenerated|TestAccPubsubTopicIamPolicyGenerated|TestAccIapWebTypeAppEngineIamPolicyGenerated|TestAccSecretManagerSecretIamMemberGenerated|TestAccRuntimeConfigConfigIamMemberGenerated|TestAccSecretManagerSecretIamBindingGenerated|TestAccRuntimeConfigConfigIamPolicyGenerated|TestAccSecretManagerSecretIamPolicyGenerated|TestAccServiceManagementServiceIamPolicyGenerated|TestAccSourceRepoRepositoryIamBindingGenerated|TestAccSourceRepoRepositoryIamMemberGenerated|TestAccServiceManagementServiceIamBindingGenerated|TestAccServiceManagementServiceIamMemberGenerated|TestAccSourceRepoRepositoryIamPolicyGenerated You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=137624" |
Release Note Template for Downstream PRs (will be copied)
Fixes hashicorp/terraform-provider-google#6535