From 791b9ef6d986c585634a52b3ba46e89fc34db5a6 Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 19 Apr 2022 10:51:33 -0500 Subject: [PATCH] Add a new `network_tier` value `FIXED_STANDARD` to `google_compute_instance_template` & `google_compute_instance` resource (#5696) (#11536) * update instance template validatefunc values Co-authored-by: upodroid * add the change to instances as well * fix docs again * remove ValidateFunc Signed-off-by: Modular Magician --- .changelog/5696.txt | 12 ++++++++++++ google/resource_compute_instance.go | 16 +++++++--------- google/resource_compute_instance_template.go | 18 ++++++++---------- website/docs/r/compute_instance.html.markdown | 4 ++-- .../r/compute_instance_template.html.markdown | 6 +++--- 5 files changed, 32 insertions(+), 24 deletions(-) create mode 100644 .changelog/5696.txt diff --git a/.changelog/5696.txt b/.changelog/5696.txt new file mode 100644 index 00000000000..1f478f7dd41 --- /dev/null +++ b/.changelog/5696.txt @@ -0,0 +1,12 @@ +```release-note:enhancement +compute: added `FIXED_STANDARD` as a valid value to the field `network_interface.0.access_configs.0.network_tier` of `google_compute_instance_template` resource +``` +```release-note:enhancement +compute: added `STANDARD` as a valid value to the field `network_interface.0.ipv6_access_configs.0.network_tier` of `google_compute_instance_template` resource +``` +```release-note:enhancement +compute: added `FIXED_STANDARD` as a valid value to the field `network_interface.0.access_configs.0.network_tier` of `google_compute_instance` resource +``` +```release-note:enhancement +compute: added `STANDARD` as a valid value to the field `network_interface.0.ipv6_access_configs.0.network_tier` of `google_compute_instance` resource +``` diff --git a/google/resource_compute_instance.go b/google/resource_compute_instance.go index 70469c9c422..96e08d5f255 100644 --- a/google/resource_compute_instance.go +++ b/google/resource_compute_instance.go @@ -314,11 +314,10 @@ func resourceComputeInstance() *schema.Resource { }, "network_tier": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD"}, false), - Description: `The networking tier used for configuring this instance. One of PREMIUM or STANDARD.`, + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: `The networking tier used for configuring this instance. One of PREMIUM or STANDARD.`, }, "public_ptr_domain_name": { @@ -372,10 +371,9 @@ func resourceComputeInstance() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "network_tier": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{"PREMIUM"}, false), - Description: `The service-level to be provided for IPv6 traffic when the subnet has an external subnet. Only PREMIUM tier is valid for IPv6`, + Type: schema.TypeString, + Required: true, + Description: `The service-level to be provided for IPv6 traffic when the subnet has an external subnet. Only PREMIUM tier is valid for IPv6`, }, "public_ptr_domain_name": { Type: schema.TypeString, diff --git a/google/resource_compute_instance_template.go b/google/resource_compute_instance_template.go index 9bf4371f9d5..6a7d48fd1e7 100644 --- a/google/resource_compute_instance_template.go +++ b/google/resource_compute_instance_template.go @@ -339,12 +339,11 @@ func resourceComputeInstanceTemplate() *schema.Resource { Description: `The IP address that will be 1:1 mapped to the instance's network ip. If not given, one will be generated.`, }, "network_tier": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - Description: `The networking tier used for configuring this instance template. This field can take the following values: PREMIUM or STANDARD. If this field is not specified, it is assumed to be PREMIUM.`, - ValidateFunc: validation.StringInSlice([]string{"PREMIUM", "STANDARD"}, false), + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + Description: `The networking tier used for configuring this instance template. This field can take the following values: PREMIUM, STANDARD, FIXED_STANDARD. If this field is not specified, it is assumed to be PREMIUM.`, }, // Possibly configurable- this was added so we don't break if it's inadvertently set "public_ptr_domain_name": { @@ -401,10 +400,9 @@ func resourceComputeInstanceTemplate() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "network_tier": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{"PREMIUM"}, false), - Description: `The service-level to be provided for IPv6 traffic when the subnet has an external subnet. Only PREMIUM tier is valid for IPv6`, + Type: schema.TypeString, + Required: true, + Description: `The service-level to be provided for IPv6 traffic when the subnet has an external subnet. Only PREMIUM tier is valid for IPv6`, }, // Possibly configurable- this was added so we don't break if it's inadvertently set // (assuming the same ass access config) diff --git a/website/docs/r/compute_instance.html.markdown b/website/docs/r/compute_instance.html.markdown index 6f4f26fd678..5ab9730e3c2 100644 --- a/website/docs/r/compute_instance.html.markdown +++ b/website/docs/r/compute_instance.html.markdown @@ -318,7 +318,7 @@ specified, then this instance will have no external IPv6 Internet access. Struct to become verified as a domain owner. * `network_tier` - (Optional) The [networking tier][network-tier] used for configuring this instance. - This field can take the following values: PREMIUM or STANDARD. If this field is + This field can take the following values: PREMIUM, FIXED_STANDARD or STANDARD. If this field is not specified, it is assumed to be PREMIUM. The `ipv6_access_config` block supports: @@ -327,7 +327,7 @@ specified, then this instance will have no external IPv6 Internet access. Struct records for the external IPv6 ranges.. * `network_tier` - (Optional) The service-level to be provided for IPv6 traffic when the - subnet has an external subnet. Only PREMIUM tier is valid for IPv6. + subnet has an external subnet. Only PREMIUM or STANDARD tier is valid for IPv6. The `alias_ip_range` block supports: diff --git a/website/docs/r/compute_instance_template.html.markdown b/website/docs/r/compute_instance_template.html.markdown index 3875cb3e363..4980575fc82 100644 --- a/website/docs/r/compute_instance_template.html.markdown +++ b/website/docs/r/compute_instance_template.html.markdown @@ -391,13 +391,13 @@ specified, then this instance will have no external IPv6 Internet access. Struct network ip. If not given, one will be generated. * `network_tier` - (Optional) The [networking tier][network-tier] used for configuring - this instance template. This field can take the following values: PREMIUM or - STANDARD. If this field is not specified, it is assumed to be PREMIUM. + this instance template. This field can take the following values: PREMIUM, + STANDARD or FIXED_STANDARD. If this field is not specified, it is assumed to be PREMIUM. The `ipv6_access_config` block supports: * `network_tier` - (Optional) The service-level to be provided for IPv6 traffic when the - subnet has an external subnet. Only PREMIUM tier is valid for IPv6. + subnet has an external subnet. Only PREMIUM and STANDARD tier is valid for IPv6. The `alias_ip_range` block supports: