From f32a6479de5370fd2c711399eb247d0a3c1ceee2 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Fri, 22 Sep 2023 16:31:56 +0000 Subject: [PATCH] adding security policy field to instance (#8878) * adding security policy field to networkInterfaceAccessConfig * adding security policy to networkInterface instead of networkInterfaceAccessConfig * finishing solution 1 and adding integration tests and doc * cleanups for solution 1 * wrapping update security policy for beta * replacing the networks in tests * fixing code review by implementing the solution two * replacing networks in tests * fixing nic read for instance_template resource * adding checking for access config security policy while flattening to prevent the instance template to break * fixing error while creating instance with empty security_policy * changing region for tests which use network_edge_security_service * comment all failing tests but one to test if it runs alone * making the tests running serially * fixing the tests to be called only by the serial one * fixing code review comments * fixing missing compute_image data from merge * fixing code review Signed-off-by: Modular Magician --- .changelog/8878.txt | 3 +++ .../compute/compute_instance_network_interface_helpers.go | 1 + website/docs/r/compute_instance.html.markdown | 1 + 3 files changed, 5 insertions(+) create mode 100644 .changelog/8878.txt diff --git a/.changelog/8878.txt b/.changelog/8878.txt new file mode 100644 index 00000000000..5a727589eb3 --- /dev/null +++ b/.changelog/8878.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +compute: added `network_interface.security_policy` field to `google_compute_instance` resource (beta) +``` diff --git a/google/services/compute/compute_instance_network_interface_helpers.go b/google/services/compute/compute_instance_network_interface_helpers.go index dc27f81d596..b0eeecc98a6 100644 --- a/google/services/compute/compute_instance_network_interface_helpers.go +++ b/google/services/compute/compute_instance_network_interface_helpers.go @@ -8,6 +8,7 @@ import ( "github.com/hashicorp/errwrap" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" + "google.golang.org/api/compute/v1" ) diff --git a/website/docs/r/compute_instance.html.markdown b/website/docs/r/compute_instance.html.markdown index bbb897168f8..00e16e34114 100644 --- a/website/docs/r/compute_instance.html.markdown +++ b/website/docs/r/compute_instance.html.markdown @@ -317,6 +317,7 @@ specified, then this instance will have no external IPv6 Internet access. Struct * `queue_count` - (Optional) The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It will be empty if not specified. +* `security_policy` - (Optional) [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html) A full or partial URL to a security policy to add to this instance. If this field is set to an empty string it will remove the associated security policy. The `access_config` block supports: