Skip to content

Commit

Permalink
Add a new network_tier value FIXED_STANDARD to `google_compute_in…
Browse files Browse the repository at this point in the history
…stance_template` & `google_compute_instance` resource (#5696) (#11536)

* update instance template validatefunc values

Co-authored-by: upodroid <cy@borg.dev>

* add the change to instances as well

* fix docs again

* remove ValidateFunc

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Apr 19, 2022
1 parent ec31c96 commit 791b9ef
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 24 deletions.
12 changes: 12 additions & 0 deletions .changelog/5696.txt
Original file line number Diff line number Diff line change
@@ -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
```
16 changes: 7 additions & 9 deletions google/resource_compute_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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,
Expand Down
18 changes: 8 additions & 10 deletions google/resource_compute_instance_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/compute_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<a name="nested_ipv6_access_config"></a>The `ipv6_access_config` block supports:
Expand All @@ -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.

<a name="nested_alias_ip_range"></a>The `alias_ip_range` block supports:

Expand Down
6 changes: 3 additions & 3 deletions website/docs/r/compute_instance_template.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<a name="nested_ipv6_access_config"></a>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.

<a name="nested_alias_ip_range"></a>The `alias_ip_range` block supports:

Expand Down

0 comments on commit 791b9ef

Please sign in to comment.