@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
178 lines • 7.72 kB
JavaScript
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.InterceptDeployment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A deployment represents a zonal intercept backend ready to accept
* GENEVE-encapsulated traffic, e.g. a zonal instance group fronted by an
* internal passthrough load balancer. Deployments are always part of a
* global deployment group which represents a global intercept service.
*
* ## Example Usage
*
* ### Network Security Intercept Deployment Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const network = new gcp.compute.Network("network", {
* name: "example-network",
* autoCreateSubnetworks: false,
* });
* const subnetwork = new gcp.compute.Subnetwork("subnetwork", {
* name: "example-subnet",
* region: "us-central1",
* ipCidrRange: "10.1.0.0/16",
* network: network.name,
* });
* const healthCheck = new gcp.compute.RegionHealthCheck("health_check", {
* name: "example-hc",
* region: "us-central1",
* httpHealthCheck: {
* port: 80,
* },
* });
* const backendService = new gcp.compute.RegionBackendService("backend_service", {
* name: "example-bs",
* region: "us-central1",
* healthChecks: healthCheck.id,
* protocol: "UDP",
* loadBalancingScheme: "INTERNAL",
* });
* const forwardingRule = new gcp.compute.ForwardingRule("forwarding_rule", {
* name: "example-fwr",
* region: "us-central1",
* network: network.name,
* subnetwork: subnetwork.name,
* backendService: backendService.id,
* loadBalancingScheme: "INTERNAL",
* ports: ["6081"],
* ipProtocol: "UDP",
* });
* const deploymentGroup = new gcp.networksecurity.InterceptDeploymentGroup("deployment_group", {
* interceptDeploymentGroupId: "example-dg",
* location: "global",
* network: network.id,
* });
* const _default = new gcp.networksecurity.InterceptDeployment("default", {
* interceptDeploymentId: "example-deployment",
* location: "us-central1-a",
* forwardingRule: forwardingRule.id,
* interceptDeploymentGroup: deploymentGroup.id,
* description: "some description",
* labels: {
* foo: "bar",
* },
* });
* ```
*
* ## Import
*
* InterceptDeployment can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/interceptDeployments/{{intercept_deployment_id}}`
*
* * `{{project}}/{{location}}/{{intercept_deployment_id}}`
*
* * `{{location}}/{{intercept_deployment_id}}`
*
* When using the `pulumi import` command, InterceptDeployment can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:networksecurity/interceptDeployment:InterceptDeployment default projects/{{project}}/locations/{{location}}/interceptDeployments/{{intercept_deployment_id}}
* ```
*
* ```sh
* $ pulumi import gcp:networksecurity/interceptDeployment:InterceptDeployment default {{project}}/{{location}}/{{intercept_deployment_id}}
* ```
*
* ```sh
* $ pulumi import gcp:networksecurity/interceptDeployment:InterceptDeployment default {{location}}/{{intercept_deployment_id}}
* ```
*/
class InterceptDeployment extends pulumi.CustomResource {
/**
* Get an existing InterceptDeployment 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 InterceptDeployment(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of InterceptDeployment. 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'] === InterceptDeployment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["description"] = state?.description;
resourceInputs["effectiveLabels"] = state?.effectiveLabels;
resourceInputs["forwardingRule"] = state?.forwardingRule;
resourceInputs["interceptDeploymentGroup"] = state?.interceptDeploymentGroup;
resourceInputs["interceptDeploymentId"] = state?.interceptDeploymentId;
resourceInputs["labels"] = state?.labels;
resourceInputs["location"] = state?.location;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["pulumiLabels"] = state?.pulumiLabels;
resourceInputs["reconciling"] = state?.reconciling;
resourceInputs["state"] = state?.state;
resourceInputs["updateTime"] = state?.updateTime;
}
else {
const args = argsOrState;
if (args?.forwardingRule === undefined && !opts.urn) {
throw new Error("Missing required property 'forwardingRule'");
}
if (args?.interceptDeploymentGroup === undefined && !opts.urn) {
throw new Error("Missing required property 'interceptDeploymentGroup'");
}
if (args?.interceptDeploymentId === undefined && !opts.urn) {
throw new Error("Missing required property 'interceptDeploymentId'");
}
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
resourceInputs["description"] = args?.description;
resourceInputs["forwardingRule"] = args?.forwardingRule;
resourceInputs["interceptDeploymentGroup"] = args?.interceptDeploymentGroup;
resourceInputs["interceptDeploymentId"] = args?.interceptDeploymentId;
resourceInputs["labels"] = args?.labels;
resourceInputs["location"] = args?.location;
resourceInputs["project"] = args?.project;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
resourceInputs["reconciling"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(InterceptDeployment.__pulumiType, name, resourceInputs, opts);
}
}
exports.InterceptDeployment = InterceptDeployment;
/** @internal */
InterceptDeployment.__pulumiType = 'gcp:networksecurity/interceptDeployment:InterceptDeployment';
//# sourceMappingURL=interceptDeployment.js.map
;