hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.31k stars 1.73k forks source link

Add missing `instance_ip_mode` argument to the network section of `google_app_engine_flexible_app_version` resource (Beta-only field) #17510

Open gwendal-lecren opened 6 months ago

gwendal-lecren commented 6 months ago

Community Note

Description

The instance_ip_mode attribute from the network section is missing. This attribute basically allow to prevent instances from receiving an ephemeral external IP address: https://cloud.google.com/appengine/docs/flexible/reference/app-yaml?tab=python#network_settings

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_app_engine_flexible_app_version" "app" {
  ...
  network {
    name             = var.network
    subnetwork       = var.subnetwork
    session_affinity = true
    # Could be `internal` or `external` according to the documentation
    instance_ip_mode = "internal"
  }
  ...
}

References

This field is present in the Beta version of the API : https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#network

b/328654356

SarahFrench commented 6 months ago

Hi @gwendal-lecren, thanks for opening this issue! I took a look at the API that the google_app_engine_flexible_app_version resource maps to and I can't see a field for setting instance IP mode under network. Features that are available in gcloud aren't always available to the Terraform provider via the public APIs, or it may be that the API docs are out of date. Have you been able to set this field when using the AppEngine API directly?

gwendal-lecren commented 6 months ago

Hi @SarahFrench, thanks for getting back to me. I can see it in the v1beta API: https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#network

But you're right, it is not available in the v1 API: https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#network

In that case, shall it be available in the beta provider? https://registry.terraform.io/providers/hashicorp/google-beta/latest/docs/resources/app_engine_flexible_app_version#network

Thanks

SarahFrench commented 6 months ago

Ah, thanks! Then yes we'd add this as a field in the beta provider. I'll update the issue to flag that to the service team this issue has been forwarded to