@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
132 lines • 5.16 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServiceNetworkSettings = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* 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
*
* ```typescript
* 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",
* },
* });
* ```
*
* ## 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:
*
* ```sh
* $ pulumi import gcp:appengine/serviceNetworkSettings:ServiceNetworkSettings default apps/{{project}}/services/{{service}}
* ```
*
* ```sh
* $ pulumi import gcp:appengine/serviceNetworkSettings:ServiceNetworkSettings default {{project}}/{{service}}
* ```
*
* ```sh
* $ pulumi import gcp:appengine/serviceNetworkSettings:ServiceNetworkSettings default {{service}}
* ```
*/
class ServiceNetworkSettings extends pulumi.CustomResource {
/**
* Get an existing ServiceNetworkSettings resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new ServiceNetworkSettings(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ServiceNetworkSettings. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === ServiceNetworkSettings.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["networkSettings"] = state ? state.networkSettings : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["service"] = state ? state.service : undefined;
}
else {
const args = argsOrState;
if ((!args || args.networkSettings === undefined) && !opts.urn) {
throw new Error("Missing required property 'networkSettings'");
}
if ((!args || args.service === undefined) && !opts.urn) {
throw new Error("Missing required property 'service'");
}
resourceInputs["networkSettings"] = args ? args.networkSettings : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["service"] = args ? args.service : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ServiceNetworkSettings.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServiceNetworkSettings = ServiceNetworkSettings;
/** @internal */
ServiceNetworkSettings.__pulumiType = 'gcp:appengine/serviceNetworkSettings:ServiceNetworkSettings';
//# sourceMappingURL=serviceNetworkSettings.js.map