Skip to content

googleAppEngineServiceNetworkSettings

A NetworkSettings resource is a container for ingress settings for a version or service.

To get more information about ServiceNetworkSettings, see:

Example Usage - App Engine Service Network Settings

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleStorageBucketBucket = new google.storageBucket.StorageBucket(
  this,
  "bucket",
  {
    location: "US",
    name: "appengine-static-content",
  }
);
const googleStorageBucketObjectObject =
  new google.storageBucketObject.StorageBucketObject(this, "object", {
    bucket: googleStorageBucketBucket.name,
    name: "hello-world.zip",
    source: "./test-fixtures/appengine/hello-world.zip",
  });
const googleAppEngineStandardAppVersionInternalapp =
  new google.appEngineStandardAppVersion.AppEngineStandardAppVersion(
    this,
    "internalapp",
    {
      delete_service_on_destroy: true,
      deployment: [
        {
          zip: [
            {
              source_url: `https://storage.googleapis.com/\${${googleStorageBucketBucket.name}}/\${${googleStorageBucketObjectObject.name}}`,
            },
          ],
        },
      ],
      entrypoint: [
        {
          shell: "node ./app.js",
        },
      ],
      env_variables: [
        {
          port: "8080",
        },
      ],
      runtime: "nodejs10",
      service: "internalapp",
      version_id: "v1",
    }
  );
const googleAppEngineServiceNetworkSettingsInternalapp =
  new google.appEngineServiceNetworkSettings.AppEngineServiceNetworkSettings(
    this,
    "internalapp_3",
    {
      network_settings: [
        {
          ingress_traffic_allowed: "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY",
        },
      ],
      service: googleAppEngineStandardAppVersionInternalapp.service,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
googleAppEngineServiceNetworkSettingsInternalapp.overrideLogicalId(
  "internalapp"
);

Argument Reference

The following arguments are supported:

  • service - (Required) The name of the service these settings apply to.

  • networkSettings - (Required) Ingress settings for this service. Will apply to all versions. Structure is documented below.

The networkSettings block supports:

  • ingressTrafficAllowed - (Optional) The ingress settings for version or service. Default value is ingressTrafficAllowedUnspecified. Possible values are ingressTrafficAllowedUnspecified, ingressTrafficAllowedAll, ingressTrafficAllowedInternalOnly, and ingressTrafficAllowedInternalAndLb.

  • 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 configuration options:

  • create - Default is 20 minutes.
  • update - Default is 20 minutes.
  • delete - Default is 20 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.