UNPKG

@pulumi/gcp

Version:

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

106 lines 4.69 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.OrganizationSecurityPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Organization security policies are used to control incoming/outgoing traffic. * * To get more information about OrganizationSecurityPolicy, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/organizationSecurityPolicies) * * How-to Guides * * [Creating a firewall policy](https://cloud.google.com/vpc/docs/using-firewall-policies#create-policy) * * ## Example Usage * * ### Organization Security Policy Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const policy = new gcp.compute.OrganizationSecurityPolicy("policy", { * displayName: "tf-test", * parent: "organizations/123456789", * }); * ``` * * ## Import * * OrganizationSecurityPolicy can be imported using any of these accepted formats: * * * `locations/global/securityPolicies/{{policy_id}}` * * * `{{policy_id}}` * * When using the `pulumi import` command, OrganizationSecurityPolicy can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/organizationSecurityPolicy:OrganizationSecurityPolicy default locations/global/securityPolicies/{{policy_id}} * ``` * * ```sh * $ pulumi import gcp:compute/organizationSecurityPolicy:OrganizationSecurityPolicy default {{policy_id}} * ``` */ class OrganizationSecurityPolicy extends pulumi.CustomResource { /** * Get an existing OrganizationSecurityPolicy 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 OrganizationSecurityPolicy(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of OrganizationSecurityPolicy. 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'] === OrganizationSecurityPolicy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["fingerprint"] = state ? state.fingerprint : undefined; resourceInputs["parent"] = state ? state.parent : undefined; resourceInputs["policyId"] = state ? state.policyId : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.displayName === undefined) && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if ((!args || args.parent === undefined) && !opts.urn) { throw new Error("Missing required property 'parent'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["parent"] = args ? args.parent : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["fingerprint"] = undefined /*out*/; resourceInputs["policyId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(OrganizationSecurityPolicy.__pulumiType, name, resourceInputs, opts); } } exports.OrganizationSecurityPolicy = OrganizationSecurityPolicy; /** @internal */ OrganizationSecurityPolicy.__pulumiType = 'gcp:compute/organizationSecurityPolicy:OrganizationSecurityPolicy'; //# sourceMappingURL=organizationSecurityPolicy.js.map