1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. appengine
  5. ServiceNetworkSettings
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

gcp.appengine.ServiceNetworkSettings

Explore with Pulumi AI

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

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const bucket = new gcp.storage.Bucket("bucket", {
    name: "appengine-static-content",
    location: "US",
});
const object = new gcp.storage.BucketObject("object", {
    name: "hello-world.zip",
    bucket: bucket.name,
    source: new pulumi.asset.FileAsset("./test-fixtures/hello-world.zip"),
});
const internalapp = new gcp.appengine.StandardAppVersion("internalapp", {
    versionId: "v1",
    service: "internalapp",
    deleteServiceOnDestroy: true,
    runtime: "nodejs20",
    entrypoint: {
        shell: "node ./app.js",
    },
    deployment: {
        zip: {
            sourceUrl: pulumi.interpolate`https://storage.googleapis.com/${bucket.name}/${object.name}`,
        },
    },
    envVariables: {
        port: "8080",
    },
});
const internalappServiceNetworkSettings = new gcp.appengine.ServiceNetworkSettings("internalapp", {
    service: internalapp.service,
    networkSettings: {
        ingressTrafficAllowed: "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY",
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

bucket = gcp.storage.Bucket("bucket",
    name="appengine-static-content",
    location="US")
object = gcp.storage.BucketObject("object",
    name="hello-world.zip",
    bucket=bucket.name,
    source=pulumi.FileAsset("./test-fixtures/hello-world.zip"))
internalapp = gcp.appengine.StandardAppVersion("internalapp",
    version_id="v1",
    service="internalapp",
    delete_service_on_destroy=True,
    runtime="nodejs20",
    entrypoint={
        "shell": "node ./app.js",
    },
    deployment={
        "zip": {
            "source_url": pulumi.Output.all(
                bucketName=bucket.name,
                objectName=object.name
).apply(lambda resolved_outputs: f"https://storage.googleapis.com/{resolved_outputs['bucketName']}/{resolved_outputs['objectName']}")
,
        },
    },
    env_variables={
        "port": "8080",
    })
internalapp_service_network_settings = gcp.appengine.ServiceNetworkSettings("internalapp",
    service=internalapp.service,
    network_settings={
        "ingress_traffic_allowed": "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY",
    })
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/appengine"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		bucket, err := storage.NewBucket(ctx, "bucket", &storage.BucketArgs{
			Name:     pulumi.String("appengine-static-content"),
			Location: pulumi.String("US"),
		})
		if err != nil {
			return err
		}
		object, err := storage.NewBucketObject(ctx, "object", &storage.BucketObjectArgs{
			Name:   pulumi.String("hello-world.zip"),
			Bucket: bucket.Name,
			Source: pulumi.NewFileAsset("./test-fixtures/hello-world.zip"),
		})
		if err != nil {
			return err
		}
		internalapp, err := appengine.NewStandardAppVersion(ctx, "internalapp", &appengine.StandardAppVersionArgs{
			VersionId:              pulumi.String("v1"),
			Service:                pulumi.String("internalapp"),
			DeleteServiceOnDestroy: pulumi.Bool(true),
			Runtime:                pulumi.String("nodejs20"),
			Entrypoint: &appengine.StandardAppVersionEntrypointArgs{
				Shell: pulumi.String("node ./app.js"),
			},
			Deployment: &appengine.StandardAppVersionDeploymentArgs{
				Zip: &appengine.StandardAppVersionDeploymentZipArgs{
					SourceUrl: pulumi.All(bucket.Name, object.Name).ApplyT(func(_args []interface{}) (string, error) {
						bucketName := _args[0].(string)
						objectName := _args[1].(string)
						return fmt.Sprintf("https://storage.googleapis.com/%v/%v", bucketName, objectName), nil
					}).(pulumi.StringOutput),
				},
			},
			EnvVariables: pulumi.StringMap{
				"port": pulumi.String("8080"),
			},
		})
		if err != nil {
			return err
		}
		_, err = appengine.NewServiceNetworkSettings(ctx, "internalapp", &appengine.ServiceNetworkSettingsArgs{
			Service: internalapp.Service,
			NetworkSettings: &appengine.ServiceNetworkSettingsNetworkSettingsArgs{
				IngressTrafficAllowed: pulumi.String("INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var bucket = new Gcp.Storage.Bucket("bucket", new()
    {
        Name = "appengine-static-content",
        Location = "US",
    });

    var @object = new Gcp.Storage.BucketObject("object", new()
    {
        Name = "hello-world.zip",
        Bucket = bucket.Name,
        Source = new FileAsset("./test-fixtures/hello-world.zip"),
    });

    var internalapp = new Gcp.AppEngine.StandardAppVersion("internalapp", new()
    {
        VersionId = "v1",
        Service = "internalapp",
        DeleteServiceOnDestroy = true,
        Runtime = "nodejs20",
        Entrypoint = new Gcp.AppEngine.Inputs.StandardAppVersionEntrypointArgs
        {
            Shell = "node ./app.js",
        },
        Deployment = new Gcp.AppEngine.Inputs.StandardAppVersionDeploymentArgs
        {
            Zip = new Gcp.AppEngine.Inputs.StandardAppVersionDeploymentZipArgs
            {
                SourceUrl = Output.Tuple(bucket.Name, @object.Name).Apply(values =>
                {
                    var bucketName = values.Item1;
                    var objectName = values.Item2;
                    return $"https://storage.googleapis.com/{bucketName}/{objectName}";
                }),
            },
        },
        EnvVariables = 
        {
            { "port", "8080" },
        },
    });

    var internalappServiceNetworkSettings = new Gcp.AppEngine.ServiceNetworkSettings("internalapp", new()
    {
        Service = internalapp.Service,
        NetworkSettings = new Gcp.AppEngine.Inputs.ServiceNetworkSettingsNetworkSettingsArgs
        {
            IngressTrafficAllowed = "INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.storage.Bucket;
import com.pulumi.gcp.storage.BucketArgs;
import com.pulumi.gcp.storage.BucketObject;
import com.pulumi.gcp.storage.BucketObjectArgs;
import com.pulumi.gcp.appengine.StandardAppVersion;
import com.pulumi.gcp.appengine.StandardAppVersionArgs;
import com.pulumi.gcp.appengine.inputs.StandardAppVersionEntrypointArgs;
import com.pulumi.gcp.appengine.inputs.StandardAppVersionDeploymentArgs;
import com.pulumi.gcp.appengine.inputs.StandardAppVersionDeploymentZipArgs;
import com.pulumi.gcp.appengine.ServiceNetworkSettings;
import com.pulumi.gcp.appengine.ServiceNetworkSettingsArgs;
import com.pulumi.gcp.appengine.inputs.ServiceNetworkSettingsNetworkSettingsArgs;
import com.pulumi.asset.FileAsset;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var bucket = new Bucket("bucket", BucketArgs.builder()
            .name("appengine-static-content")
            .location("US")
            .build());

        var object = new BucketObject("object", BucketObjectArgs.builder()
            .name("hello-world.zip")
            .bucket(bucket.name())
            .source(new FileAsset("./test-fixtures/hello-world.zip"))
            .build());

        var internalapp = new StandardAppVersion("internalapp", StandardAppVersionArgs.builder()
            .versionId("v1")
            .service("internalapp")
            .deleteServiceOnDestroy(true)
            .runtime("nodejs20")
            .entrypoint(StandardAppVersionEntrypointArgs.builder()
                .shell("node ./app.js")
                .build())
            .deployment(StandardAppVersionDeploymentArgs.builder()
                .zip(StandardAppVersionDeploymentZipArgs.builder()
                    .sourceUrl(Output.tuple(bucket.name(), object.name()).applyValue(values -> {
                        var bucketName = values.t1;
                        var objectName = values.t2;
                        return String.format("https://storage.googleapis.com/%s/%s", bucketName,objectName);
                    }))
                    .build())
                .build())
            .envVariables(Map.of("port", "8080"))
            .build());

        var internalappServiceNetworkSettings = new ServiceNetworkSettings("internalappServiceNetworkSettings", ServiceNetworkSettingsArgs.builder()
            .service(internalapp.service())
            .networkSettings(ServiceNetworkSettingsNetworkSettingsArgs.builder()
                .ingressTrafficAllowed("INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY")
                .build())
            .build());

    }
}
Copy
resources:
  bucket:
    type: gcp:storage:Bucket
    properties:
      name: appengine-static-content
      location: US
  object:
    type: gcp:storage:BucketObject
    properties:
      name: hello-world.zip
      bucket: ${bucket.name}
      source:
        fn::FileAsset: ./test-fixtures/hello-world.zip
  internalapp:
    type: gcp:appengine:StandardAppVersion
    properties:
      versionId: v1
      service: internalapp
      deleteServiceOnDestroy: true
      runtime: nodejs20
      entrypoint:
        shell: node ./app.js
      deployment:
        zip:
          sourceUrl: https://storage.googleapis.com/${bucket.name}/${object.name}
      envVariables:
        port: '8080'
  internalappServiceNetworkSettings:
    type: gcp:appengine:ServiceNetworkSettings
    name: internalapp
    properties:
      service: ${internalapp.service}
      networkSettings:
        ingressTrafficAllowed: INGRESS_TRAFFIC_ALLOWED_INTERNAL_ONLY
Copy

Create ServiceNetworkSettings Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ServiceNetworkSettings(name: string, args: ServiceNetworkSettingsArgs, opts?: CustomResourceOptions);
@overload
def ServiceNetworkSettings(resource_name: str,
                           args: ServiceNetworkSettingsArgs,
                           opts: Optional[ResourceOptions] = None)

@overload
def ServiceNetworkSettings(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           network_settings: Optional[ServiceNetworkSettingsNetworkSettingsArgs] = None,
                           service: Optional[str] = None,
                           project: Optional[str] = None)
func NewServiceNetworkSettings(ctx *Context, name string, args ServiceNetworkSettingsArgs, opts ...ResourceOption) (*ServiceNetworkSettings, error)
public ServiceNetworkSettings(string name, ServiceNetworkSettingsArgs args, CustomResourceOptions? opts = null)
public ServiceNetworkSettings(String name, ServiceNetworkSettingsArgs args)
public ServiceNetworkSettings(String name, ServiceNetworkSettingsArgs args, CustomResourceOptions options)
type: gcp:appengine:ServiceNetworkSettings
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ServiceNetworkSettingsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ServiceNetworkSettingsArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ServiceNetworkSettingsArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ServiceNetworkSettingsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ServiceNetworkSettingsArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var serviceNetworkSettingsResource = new Gcp.AppEngine.ServiceNetworkSettings("serviceNetworkSettingsResource", new()
{
    NetworkSettings = new Gcp.AppEngine.Inputs.ServiceNetworkSettingsNetworkSettingsArgs
    {
        IngressTrafficAllowed = "string",
    },
    Service = "string",
    Project = "string",
});
Copy
example, err := appengine.NewServiceNetworkSettings(ctx, "serviceNetworkSettingsResource", &appengine.ServiceNetworkSettingsArgs{
	NetworkSettings: &appengine.ServiceNetworkSettingsNetworkSettingsArgs{
		IngressTrafficAllowed: pulumi.String("string"),
	},
	Service: pulumi.String("string"),
	Project: pulumi.String("string"),
})
Copy
var serviceNetworkSettingsResource = new ServiceNetworkSettings("serviceNetworkSettingsResource", ServiceNetworkSettingsArgs.builder()
    .networkSettings(ServiceNetworkSettingsNetworkSettingsArgs.builder()
        .ingressTrafficAllowed("string")
        .build())
    .service("string")
    .project("string")
    .build());
Copy
service_network_settings_resource = gcp.appengine.ServiceNetworkSettings("serviceNetworkSettingsResource",
    network_settings={
        "ingress_traffic_allowed": "string",
    },
    service="string",
    project="string")
Copy
const serviceNetworkSettingsResource = new gcp.appengine.ServiceNetworkSettings("serviceNetworkSettingsResource", {
    networkSettings: {
        ingressTrafficAllowed: "string",
    },
    service: "string",
    project: "string",
});
Copy
type: gcp:appengine:ServiceNetworkSettings
properties:
    networkSettings:
        ingressTrafficAllowed: string
    project: string
    service: string
Copy

ServiceNetworkSettings Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ServiceNetworkSettings resource accepts the following input properties:

NetworkSettings This property is required. ServiceNetworkSettingsNetworkSettings
Ingress settings for this service. Will apply to all versions. Structure is documented below.
Service This property is required. string
The name of the service these settings apply to.
Project Changes to this property will trigger replacement. string
NetworkSettings This property is required. ServiceNetworkSettingsNetworkSettingsArgs
Ingress settings for this service. Will apply to all versions. Structure is documented below.
Service This property is required. string
The name of the service these settings apply to.
Project Changes to this property will trigger replacement. string
networkSettings This property is required. ServiceNetworkSettingsNetworkSettings
Ingress settings for this service. Will apply to all versions. Structure is documented below.
service This property is required. String
The name of the service these settings apply to.
project Changes to this property will trigger replacement. String
networkSettings This property is required. ServiceNetworkSettingsNetworkSettings
Ingress settings for this service. Will apply to all versions. Structure is documented below.
service This property is required. string
The name of the service these settings apply to.
project Changes to this property will trigger replacement. string
network_settings This property is required. ServiceNetworkSettingsNetworkSettingsArgs
Ingress settings for this service. Will apply to all versions. Structure is documented below.
service This property is required. str
The name of the service these settings apply to.
project Changes to this property will trigger replacement. str
networkSettings This property is required. Property Map
Ingress settings for this service. Will apply to all versions. Structure is documented below.
service This property is required. String
The name of the service these settings apply to.
project Changes to this property will trigger replacement. String

Outputs

All input properties are implicitly available as output properties. Additionally, the ServiceNetworkSettings resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ServiceNetworkSettings Resource

Get an existing ServiceNetworkSettings resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ServiceNetworkSettingsState, opts?: CustomResourceOptions): ServiceNetworkSettings
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        network_settings: Optional[ServiceNetworkSettingsNetworkSettingsArgs] = None,
        project: Optional[str] = None,
        service: Optional[str] = None) -> ServiceNetworkSettings
func GetServiceNetworkSettings(ctx *Context, name string, id IDInput, state *ServiceNetworkSettingsState, opts ...ResourceOption) (*ServiceNetworkSettings, error)
public static ServiceNetworkSettings Get(string name, Input<string> id, ServiceNetworkSettingsState? state, CustomResourceOptions? opts = null)
public static ServiceNetworkSettings get(String name, Output<String> id, ServiceNetworkSettingsState state, CustomResourceOptions options)
resources:  _:    type: gcp:appengine:ServiceNetworkSettings    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
NetworkSettings ServiceNetworkSettingsNetworkSettings
Ingress settings for this service. Will apply to all versions. Structure is documented below.
Project Changes to this property will trigger replacement. string
Service string
The name of the service these settings apply to.
NetworkSettings ServiceNetworkSettingsNetworkSettingsArgs
Ingress settings for this service. Will apply to all versions. Structure is documented below.
Project Changes to this property will trigger replacement. string
Service string
The name of the service these settings apply to.
networkSettings ServiceNetworkSettingsNetworkSettings
Ingress settings for this service. Will apply to all versions. Structure is documented below.
project Changes to this property will trigger replacement. String
service String
The name of the service these settings apply to.
networkSettings ServiceNetworkSettingsNetworkSettings
Ingress settings for this service. Will apply to all versions. Structure is documented below.
project Changes to this property will trigger replacement. string
service string
The name of the service these settings apply to.
network_settings ServiceNetworkSettingsNetworkSettingsArgs
Ingress settings for this service. Will apply to all versions. Structure is documented below.
project Changes to this property will trigger replacement. str
service str
The name of the service these settings apply to.
networkSettings Property Map
Ingress settings for this service. Will apply to all versions. Structure is documented below.
project Changes to this property will trigger replacement. String
service String
The name of the service these settings apply to.

Supporting Types

ServiceNetworkSettingsNetworkSettings
, ServiceNetworkSettingsNetworkSettingsArgs

IngressTrafficAllowed string
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, INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB.


IngressTrafficAllowed string
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, INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB.


ingressTrafficAllowed String
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, INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB.


ingressTrafficAllowed string
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, INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB.


ingress_traffic_allowed str
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, INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB.


ingressTrafficAllowed String
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, INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB.


Import

ServiceNetworkSettings can be imported using any of these accepted formats:

  • apps/{{project}}/services/{{service}}

  • {{project}}/{{service}}

  • {{service}}

When using the pulumi import command, ServiceNetworkSettings can be imported using one of the formats above. For example:

$ pulumi import gcp:appengine/serviceNetworkSettings:ServiceNetworkSettings default apps/{{project}}/services/{{service}}
Copy
$ pulumi import gcp:appengine/serviceNetworkSettings:ServiceNetworkSettings default {{project}}/{{service}}
Copy
$ pulumi import gcp:appengine/serviceNetworkSettings:ServiceNetworkSettings default {{service}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.