From 5584fa86e25208dfc0cf27c77d385c6686e18d69 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Tue, 22 Jun 2021 15:41:35 +0000 Subject: [PATCH] Add app_engine_service_network_settings resource (#4810) Signed-off-by: Modular Magician --- .changelog/4810.txt | 3 + google/provider.go | 5 +- ...rce_app_engine_service_network_settings.go | 354 ++++++++++++++++++ ...service_network_settings_generated_test.go | 84 +++++ ...pp_engine_service_network_settings_test.go | 116 ++++++ ...ine_service_network_settings.html.markdown | 137 +++++++ website/google.erb | 4 + 7 files changed, 701 insertions(+), 2 deletions(-) create mode 100644 .changelog/4810.txt create mode 100644 google/resource_app_engine_service_network_settings.go create mode 100644 google/resource_app_engine_service_network_settings_generated_test.go create mode 100644 google/resource_app_engine_service_network_settings_test.go create mode 100644 website/docs/r/app_engine_service_network_settings.html.markdown diff --git a/.changelog/4810.txt b/.changelog/4810.txt new file mode 100644 index 00000000000..99056409798 --- /dev/null +++ b/.changelog/4810.txt @@ -0,0 +1,3 @@ +```release-note:new-resource +`google_app_engine_service_network_settings` +``` diff --git a/google/provider.go b/google/provider.go index 653bbbc9496..78dc929d6ec 100644 --- a/google/provider.go +++ b/google/provider.go @@ -766,9 +766,9 @@ func Provider() *schema.Provider { return provider } -// Generated resources: 197 +// Generated resources: 198 // Generated IAM resources: 87 -// Total generated resources: 284 +// Total generated resources: 285 func ResourceMap() map[string]*schema.Resource { resourceMap, _ := ResourceMapWithErrors() return resourceMap @@ -802,6 +802,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) { "google_app_engine_flexible_app_version": resourceAppEngineFlexibleAppVersion(), "google_app_engine_application_url_dispatch_rules": resourceAppEngineApplicationUrlDispatchRules(), "google_app_engine_service_split_traffic": resourceAppEngineServiceSplitTraffic(), + "google_app_engine_service_network_settings": resourceAppEngineServiceNetworkSettings(), "google_bigquery_dataset": resourceBigQueryDataset(), "google_bigquery_dataset_access": resourceBigQueryDatasetAccess(), "google_bigquery_job": resourceBigQueryJob(), diff --git a/google/resource_app_engine_service_network_settings.go b/google/resource_app_engine_service_network_settings.go new file mode 100644 index 00000000000..0d6b79cb522 --- /dev/null +++ b/google/resource_app_engine_service_network_settings.go @@ -0,0 +1,354 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package google + +import ( + "fmt" + "log" + "reflect" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +) + +func resourceAppEngineServiceNetworkSettings() *schema.Resource { + return &schema.Resource{ + Create: resourceAppEngineServiceNetworkSettingsCreate, + Read: resourceAppEngineServiceNetworkSettingsRead, + Update: resourceAppEngineServiceNetworkSettingsUpdate, + Delete: resourceAppEngineServiceNetworkSettingsDelete, + + Importer: &schema.ResourceImporter{ + State: resourceAppEngineServiceNetworkSettingsImport, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(4 * time.Minute), + Update: schema.DefaultTimeout(4 * time.Minute), + Delete: schema.DefaultTimeout(4 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "network_settings": { + Type: schema.TypeList, + Required: true, + Description: `Ingress settings for this service. Will apply to all versions.`, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ingress_traffic_allowed": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringInSlice([]string{"INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED", "INGRESS_TRAFFIC_ALLOWED_ALL", "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY", "INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB", ""}, false), + Description: `The ingress settings for version or service. Default value: "INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED" Possible values: ["INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED", "INGRESS_TRAFFIC_ALLOWED_ALL", "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY", "INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB"]`, + Default: "INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED", + }, + }, + }, + }, + "service": { + Type: schema.TypeString, + Required: true, + Description: `The name of the service these settings apply to.`, + }, + "project": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + }, + UseJSONNumber: true, + } +} + +func resourceAppEngineServiceNetworkSettingsCreate(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + userAgent, err := generateUserAgentString(d, config.userAgent) + if err != nil { + return err + } + + obj := make(map[string]interface{}) + idProp, err := expandAppEngineServiceNetworkSettingsService(d.Get("service"), d, config) + if err != nil { + return err + } else if v, ok := d.GetOkExists("service"); !isEmptyValue(reflect.ValueOf(idProp)) && (ok || !reflect.DeepEqual(v, idProp)) { + obj["id"] = idProp + } + networkSettingsProp, err := expandAppEngineServiceNetworkSettingsNetworkSettings(d.Get("network_settings"), d, config) + if err != nil { + return err + } else if v, ok := d.GetOkExists("network_settings"); !isEmptyValue(reflect.ValueOf(networkSettingsProp)) && (ok || !reflect.DeepEqual(v, networkSettingsProp)) { + obj["networkSettings"] = networkSettingsProp + } + + lockName, err := replaceVars(d, config, "apps/{{project}}") + if err != nil { + return err + } + mutexKV.Lock(lockName) + defer mutexKV.Unlock(lockName) + + url, err := replaceVars(d, config, "{{AppEngineBasePath}}apps/{{project}}/services/{{service}}?updateMask=networkSettings") + if err != nil { + return err + } + + log.Printf("[DEBUG] Creating new ServiceNetworkSettings: %#v", obj) + billingProject := "" + + project, err := getProject(d, config) + if err != nil { + return fmt.Errorf("Error fetching project for ServiceNetworkSettings: %s", err) + } + billingProject = project + + // err == nil indicates that the billing_project value was found + if bp, err := getBillingProject(d, config); err == nil { + billingProject = bp + } + + res, err := sendRequestWithTimeout(config, "PATCH", billingProject, url, userAgent, obj, d.Timeout(schema.TimeoutCreate)) + if err != nil { + return fmt.Errorf("Error creating ServiceNetworkSettings: %s", err) + } + + // Store the ID now + id, err := replaceVars(d, config, "apps/{{project}}/services/{{service}}") + if err != nil { + return fmt.Errorf("Error constructing id: %s", err) + } + d.SetId(id) + + err = appEngineOperationWaitTime( + config, res, project, "Creating ServiceNetworkSettings", userAgent, + d.Timeout(schema.TimeoutCreate)) + + if err != nil { + // The resource didn't actually create + d.SetId("") + return fmt.Errorf("Error waiting to create ServiceNetworkSettings: %s", err) + } + + log.Printf("[DEBUG] Finished creating ServiceNetworkSettings %q: %#v", d.Id(), res) + + return resourceAppEngineServiceNetworkSettingsRead(d, meta) +} + +func resourceAppEngineServiceNetworkSettingsRead(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + userAgent, err := generateUserAgentString(d, config.userAgent) + if err != nil { + return err + } + + url, err := replaceVars(d, config, "{{AppEngineBasePath}}apps/{{project}}/services/{{service}}") + if err != nil { + return err + } + + billingProject := "" + + project, err := getProject(d, config) + if err != nil { + return fmt.Errorf("Error fetching project for ServiceNetworkSettings: %s", err) + } + billingProject = project + + // err == nil indicates that the billing_project value was found + if bp, err := getBillingProject(d, config); err == nil { + billingProject = bp + } + + res, err := sendRequest(config, "GET", billingProject, url, userAgent, nil) + if err != nil { + return handleNotFoundError(err, d, fmt.Sprintf("AppEngineServiceNetworkSettings %q", d.Id())) + } + + if err := d.Set("project", project); err != nil { + return fmt.Errorf("Error reading ServiceNetworkSettings: %s", err) + } + + if err := d.Set("service", flattenAppEngineServiceNetworkSettingsService(res["id"], d, config)); err != nil { + return fmt.Errorf("Error reading ServiceNetworkSettings: %s", err) + } + if err := d.Set("network_settings", flattenAppEngineServiceNetworkSettingsNetworkSettings(res["networkSettings"], d, config)); err != nil { + return fmt.Errorf("Error reading ServiceNetworkSettings: %s", err) + } + + return nil +} + +func resourceAppEngineServiceNetworkSettingsUpdate(d *schema.ResourceData, meta interface{}) error { + config := meta.(*Config) + userAgent, err := generateUserAgentString(d, config.userAgent) + if err != nil { + return err + } + + billingProject := "" + + project, err := getProject(d, config) + if err != nil { + return fmt.Errorf("Error fetching project for ServiceNetworkSettings: %s", err) + } + billingProject = project + + obj := make(map[string]interface{}) + idProp, err := expandAppEngineServiceNetworkSettingsService(d.Get("service"), d, config) + if err != nil { + return err + } else if v, ok := d.GetOkExists("service"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, idProp)) { + obj["id"] = idProp + } + networkSettingsProp, err := expandAppEngineServiceNetworkSettingsNetworkSettings(d.Get("network_settings"), d, config) + if err != nil { + return err + } else if v, ok := d.GetOkExists("network_settings"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, networkSettingsProp)) { + obj["networkSettings"] = networkSettingsProp + } + + lockName, err := replaceVars(d, config, "apps/{{project}}") + if err != nil { + return err + } + mutexKV.Lock(lockName) + defer mutexKV.Unlock(lockName) + + url, err := replaceVars(d, config, "{{AppEngineBasePath}}apps/{{project}}/services/{{service}}") + if err != nil { + return err + } + + log.Printf("[DEBUG] Updating ServiceNetworkSettings %q: %#v", d.Id(), obj) + updateMask := []string{} + + if d.HasChange("service") { + updateMask = append(updateMask, "id") + } + + if d.HasChange("network_settings") { + updateMask = append(updateMask, "networkSettings") + } + // updateMask is a URL parameter but not present in the schema, so replaceVars + // won't set it + url, err = addQueryParams(url, map[string]string{"updateMask": strings.Join(updateMask, ",")}) + if err != nil { + return err + } + + // err == nil indicates that the billing_project value was found + if bp, err := getBillingProject(d, config); err == nil { + billingProject = bp + } + + res, err := sendRequestWithTimeout(config, "PATCH", billingProject, url, userAgent, obj, d.Timeout(schema.TimeoutUpdate)) + + if err != nil { + return fmt.Errorf("Error updating ServiceNetworkSettings %q: %s", d.Id(), err) + } else { + log.Printf("[DEBUG] Finished updating ServiceNetworkSettings %q: %#v", d.Id(), res) + } + + err = appEngineOperationWaitTime( + config, res, project, "Updating ServiceNetworkSettings", userAgent, + d.Timeout(schema.TimeoutUpdate)) + + if err != nil { + return err + } + + return resourceAppEngineServiceNetworkSettingsRead(d, meta) +} + +func resourceAppEngineServiceNetworkSettingsDelete(d *schema.ResourceData, meta interface{}) error { + log.Printf("[WARNING] AppEngine ServiceNetworkSettings resources"+ + " cannot be deleted from Google Cloud. The resource %s will be removed from Terraform"+ + " state, but will still be present on Google Cloud.", d.Id()) + d.SetId("") + + return nil +} + +func resourceAppEngineServiceNetworkSettingsImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + config := meta.(*Config) + if err := parseImportId([]string{ + "apps/(?P[^/]+)/services/(?P[^/]+)", + "(?P[^/]+)/(?P[^/]+)", + "(?P[^/]+)", + }, d, config); err != nil { + return nil, err + } + + // Replace import id for the resource id + id, err := replaceVars(d, config, "apps/{{project}}/services/{{service}}") + if err != nil { + return nil, fmt.Errorf("Error constructing id: %s", err) + } + d.SetId(id) + + return []*schema.ResourceData{d}, nil +} + +func flattenAppEngineServiceNetworkSettingsService(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + +func flattenAppEngineServiceNetworkSettingsNetworkSettings(v interface{}, d *schema.ResourceData, config *Config) interface{} { + if v == nil { + return nil + } + original := v.(map[string]interface{}) + if len(original) == 0 { + return nil + } + transformed := make(map[string]interface{}) + transformed["ingress_traffic_allowed"] = + flattenAppEngineServiceNetworkSettingsNetworkSettingsIngressTrafficAllowed(original["ingressTrafficAllowed"], d, config) + return []interface{}{transformed} +} +func flattenAppEngineServiceNetworkSettingsNetworkSettingsIngressTrafficAllowed(v interface{}, d *schema.ResourceData, config *Config) interface{} { + return v +} + +func expandAppEngineServiceNetworkSettingsService(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + return v, nil +} + +func expandAppEngineServiceNetworkSettingsNetworkSettings(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + l := v.([]interface{}) + if len(l) == 0 || l[0] == nil { + return nil, nil + } + raw := l[0] + original := raw.(map[string]interface{}) + transformed := make(map[string]interface{}) + + transformedIngressTrafficAllowed, err := expandAppEngineServiceNetworkSettingsNetworkSettingsIngressTrafficAllowed(original["ingress_traffic_allowed"], d, config) + if err != nil { + return nil, err + } else if val := reflect.ValueOf(transformedIngressTrafficAllowed); val.IsValid() && !isEmptyValue(val) { + transformed["ingressTrafficAllowed"] = transformedIngressTrafficAllowed + } + + return transformed, nil +} + +func expandAppEngineServiceNetworkSettingsNetworkSettingsIngressTrafficAllowed(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { + return v, nil +} diff --git a/google/resource_app_engine_service_network_settings_generated_test.go b/google/resource_app_engine_service_network_settings_generated_test.go new file mode 100644 index 00000000000..03cc2b13e50 --- /dev/null +++ b/google/resource_app_engine_service_network_settings_generated_test.go @@ -0,0 +1,84 @@ +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Magic Modules and manual +// changes will be clobbered when the file is regenerated. +// +// Please read more about how to change this file in +// .github/CONTRIBUTING.md. +// +// ---------------------------------------------------------------------------- + +package google + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccAppEngineServiceNetworkSettings_appEngineServiceNetworkSettingsExample(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": randString(t, 10), + } + + vcrTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccAppEngineServiceNetworkSettings_appEngineServiceNetworkSettingsExample(context), + }, + { + ResourceName: "google_app_engine_service_network_settings.liveapp", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccAppEngineServiceNetworkSettings_appEngineServiceNetworkSettingsExample(context map[string]interface{}) string { + return Nprintf(` +resource "google_storage_bucket" "bucket" { + name = "tf-test-appengine-static-content%{random_suffix}" +} + +resource "google_storage_bucket_object" "object" { + name = "hello-world.zip" + bucket = google_storage_bucket.bucket.name + source = "./test-fixtures/appengine/hello-world.zip" +} + +resource "google_app_engine_standard_app_version" "liveapp_v1" { + version_id = "v1" + service = "liveapp" + delete_service_on_destroy = true + + runtime = "nodejs10" + entrypoint { + shell = "node ./app.js" + } + deployment { + zip { + source_url = "https://storage.googleapis.com/${google_storage_bucket.bucket.name}/${google_storage_bucket_object.object.name}" + } + } + env_variables = { + port = "8080" + } +} + +resource "google_app_engine_service_network_settings" "liveapp" { + service = google_app_engine_standard_app_version.liveapp_v1.service + network_settings { + ingress_traffic_allowed = "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY" + } +} +`, context) +} diff --git a/google/resource_app_engine_service_network_settings_test.go b/google/resource_app_engine_service_network_settings_test.go new file mode 100644 index 00000000000..d51f65b99a3 --- /dev/null +++ b/google/resource_app_engine_service_network_settings_test.go @@ -0,0 +1,116 @@ +package google + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccAppEngineServiceNetworkSettings_update(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": randString(t, 10), + } + + vcrTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccAppEngineServiceNetworkSettings_basic(context), + }, + { + ResourceName: "google_app_engine_service_network_settings.main", + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAppEngineServiceNetworkSettings_update(context), + }, + { + ResourceName: "google_app_engine_service_network_settings.main", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccAppEngineServiceNetworkSettings_basic(context map[string]interface{}) string { + return Nprintf(` +resource "google_storage_bucket" "bucket" { + name = "tf-test-%{random_suffix}-ae-networksettings" +} + +resource "google_storage_bucket_object" "object" { + name = "hello-world.zip" + bucket = google_storage_bucket.bucket.name + source = "./test-fixtures/appengine/hello-world.zip" +} + +resource "google_app_engine_standard_app_version" "app" { + version_id = "v1" + service = "app-%{random_suffix}" + delete_service_on_destroy = true + + runtime = "nodejs10" + entrypoint { + shell = "node ./app.js" + } + deployment { + zip { + source_url = "https://storage.googleapis.com/${google_storage_bucket.bucket.name}/${google_storage_bucket_object.object.name}" + } + } + env_variables = { + port = "8080" + } +} + +resource "google_app_engine_service_network_settings" "main" { + service = google_app_engine_standard_app_version.app.service + network_settings { + ingress_traffic_allowed = "INGRESS_TRAFFIC_ALLOWED_ALL" + } +}`, context) +} + +func testAccAppEngineServiceNetworkSettings_update(context map[string]interface{}) string { + return Nprintf(` +resource "google_storage_bucket" "bucket" { + name = "tf-test-%{random_suffix}-ae-networksettings" +} + +resource "google_storage_bucket_object" "object" { + name = "hello-world.zip" + bucket = google_storage_bucket.bucket.name + source = "./test-fixtures/appengine/hello-world.zip" +} + +resource "google_app_engine_standard_app_version" "app" { + version_id = "v1" + service = "app-%{random_suffix}" + delete_service_on_destroy = true + + runtime = "nodejs10" + entrypoint { + shell = "node ./app.js" + } + deployment { + zip { + source_url = "https://storage.googleapis.com/${google_storage_bucket.bucket.name}/${google_storage_bucket_object.object.name}" + } + } + env_variables = { + port = "8080" + } +} + +resource "google_app_engine_service_network_settings" "main" { + service = google_app_engine_standard_app_version.app.service + network_settings { + ingress_traffic_allowed = "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY" + } +}`, context) +} diff --git a/website/docs/r/app_engine_service_network_settings.html.markdown b/website/docs/r/app_engine_service_network_settings.html.markdown new file mode 100644 index 00000000000..dc9eed042f7 --- /dev/null +++ b/website/docs/r/app_engine_service_network_settings.html.markdown @@ -0,0 +1,137 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file in +# .github/CONTRIBUTING.md. +# +# ---------------------------------------------------------------------------- +subcategory: "App Engine" +layout: "google" +page_title: "Google: google_app_engine_service_network_settings" +sidebar_current: "docs-google-app-engine-service-network-settings" +description: |- + A NetworkSettings resource is a container for ingress settings for a version or service. +--- + +# google\_app\_engine\_service\_network\_settings + +A NetworkSettings resource is a container for ingress settings for a version or service. + + +To get more information about ServiceNetworkSettings, see: + +* [API documentation](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services) + + +## Example Usage - App Engine Service Network Settings + + +```hcl +resource "google_storage_bucket" "bucket" { + name = "appengine-static-content" +} + +resource "google_storage_bucket_object" "object" { + name = "hello-world.zip" + bucket = google_storage_bucket.bucket.name + source = "./test-fixtures/appengine/hello-world.zip" +} + +resource "google_app_engine_standard_app_version" "liveapp_v1" { + version_id = "v1" + service = "liveapp" + delete_service_on_destroy = true + + runtime = "nodejs10" + entrypoint { + shell = "node ./app.js" + } + deployment { + zip { + source_url = "https://storage.googleapis.com/${google_storage_bucket.bucket.name}/${google_storage_bucket_object.object.name}" + } + } + env_variables = { + port = "8080" + } +} + +resource "google_app_engine_service_network_settings" "liveapp" { + service = google_app_engine_standard_app_version.liveapp_v1.service + network_settings { + ingress_traffic_allowed = "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY" + } +} +``` + +## Argument Reference + +The following arguments are supported: + + +* `service` - + (Required) + The name of the service these settings apply to. + +* `network_settings` - + (Required) + Ingress settings for this service. Will apply to all versions. + Structure is documented below. + + +The `network_settings` block supports: + +* `ingress_traffic_allowed` - + (Optional) + The ingress settings for version or service. + Default value is `INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED`. + Possible values are `INGRESS_TRAFFIC_ALLOWED_UNSPECIFIED`, `INGRESS_TRAFFIC_ALLOWED_ALL`, `INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY`, and `INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB`. + +- - - + + +* `project` - (Optional) The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + + +## Attributes Reference + +In addition to the arguments listed above, the following computed attributes are exported: + +* `id` - an identifier for the resource with format `apps/{{project}}/services/{{service}}` + + +## Timeouts + +This resource provides the following +[Timeouts](/docs/configuration/resources.html#timeouts) configuration options: + +- `create` - Default is 4 minutes. +- `update` - Default is 4 minutes. +- `delete` - Default is 4 minutes. + +## Import + + +ServiceNetworkSettings can be imported using any of these accepted formats: + +``` +$ terraform import google_app_engine_service_network_settings.default apps/{{project}}/services/{{service}} +$ terraform import google_app_engine_service_network_settings.default {{project}}/{{service}} +$ terraform import google_app_engine_service_network_settings.default {{service}} +``` + +## User Project Overrides + +This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override). diff --git a/website/google.erb b/website/google.erb index 47eb03d9437..2bfb0b41560 100644 --- a/website/google.erb +++ b/website/google.erb @@ -220,6 +220,10 @@ google_app_engine_flexible_app_version +
  • + google_app_engine_service_network_settings +
  • +
  • google_app_engine_service_split_traffic