@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
113 lines • 5.95 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! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServicePerimeterIngressPolicy = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* Manage a single IngressPolicy in the status (enforced) configuration for a service perimeter.
* IngressPolicies match requests based on ingressFrom and ingressTo stanzas. For an ingress policy to match,
* both the ingressFrom and ingressTo stanzas must be matched. If an IngressPolicy matches a request,
* the request is allowed through the perimeter boundary from outside the perimeter.
* For example, access from the internet can be allowed either based on an AccessLevel or,
* for traffic hosted on Google Cloud, the project of the source network.
* For access from private networks, using the project of the hosting network is required.
* Individual ingress policies can be limited by restricting which services and/
* or actions they match using the ingressTo field.
*
* > **Note:** By default, updates to this resource will remove the IngressPolicy from the
* from the perimeter and add it back in a non-atomic manner. To ensure that the new IngressPolicy
* is added before the old one is removed, add a `lifecycle` block with `createBeforeDestroy = true` to this resource.
* **Note:** If this resource is used alongside a `gcp.accesscontextmanager.ServicePerimeter` resource,
* the service perimeter resource must have a `lifecycle` block with `ignoreChanges = [status[0].ingress_policies]` so
* they don't fight over which ingress rules should be in the policy.
*
* To get more information about ServicePerimeterIngressPolicy, see:
*
* * [API documentation](https://cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.servicePerimeters#ingresspolicy)
* * How-to Guides
* * [Guide to Ingress and Egress Rules](https://cloud.google.com/vpc-service-controls/docs/ingress-egress-rules)
*
* ## Example Usage
*/
class ServicePerimeterIngressPolicy extends pulumi.CustomResource {
/**
* Get an existing ServicePerimeterIngressPolicy 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 ServicePerimeterIngressPolicy(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:accesscontextmanager/servicePerimeterIngressPolicy:ServicePerimeterIngressPolicy';
/**
* Returns true if the given object is an instance of ServicePerimeterIngressPolicy. 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'] === ServicePerimeterIngressPolicy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessPolicyId"] = state?.accessPolicyId;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["etag"] = state?.etag;
resourceInputs["ingressFrom"] = state?.ingressFrom;
resourceInputs["ingressTo"] = state?.ingressTo;
resourceInputs["perimeter"] = state?.perimeter;
resourceInputs["title"] = state?.title;
}
else {
const args = argsOrState;
if (args?.perimeter === undefined && !opts.urn) {
throw new Error("Missing required property 'perimeter'");
}
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["ingressFrom"] = args?.ingressFrom;
resourceInputs["ingressTo"] = args?.ingressTo;
resourceInputs["perimeter"] = args?.perimeter;
resourceInputs["title"] = args?.title;
resourceInputs["accessPolicyId"] = undefined /*out*/;
resourceInputs["etag"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ServicePerimeterIngressPolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServicePerimeterIngressPolicy = ServicePerimeterIngressPolicy;
//# sourceMappingURL=servicePerimeterIngressPolicy.js.map