UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

88 lines 5.02 kB
"use strict"; // *** 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.ServicePerimeterIngressPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = 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, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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 ? state.accessPolicyId : undefined; resourceInputs["etag"] = state ? state.etag : undefined; resourceInputs["ingressFrom"] = state ? state.ingressFrom : undefined; resourceInputs["ingressTo"] = state ? state.ingressTo : undefined; resourceInputs["perimeter"] = state ? state.perimeter : undefined; resourceInputs["title"] = state ? state.title : undefined; } else { const args = argsOrState; if ((!args || args.perimeter === undefined) && !opts.urn) { throw new Error("Missing required property 'perimeter'"); } resourceInputs["ingressFrom"] = args ? args.ingressFrom : undefined; resourceInputs["ingressTo"] = args ? args.ingressTo : undefined; resourceInputs["perimeter"] = args ? args.perimeter : undefined; resourceInputs["title"] = args ? args.title : undefined; resourceInputs["accessPolicyId"] = undefined /*out*/; resourceInputs["etag"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ServicePerimeterIngressPolicy.__pulumiType, name, resourceInputs, opts); } } exports.ServicePerimeterIngressPolicy = ServicePerimeterIngressPolicy; /** @internal */ ServicePerimeterIngressPolicy.__pulumiType = 'gcp:accesscontextmanager/servicePerimeterIngressPolicy:ServicePerimeterIngressPolicy'; //# sourceMappingURL=servicePerimeterIngressPolicy.js.map