UNPKG

@pulumi/gcp

Version:

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

192 lines • 8.53 kB
"use strict"; // *** 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.Framework = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Frameworks allow you to monitor and enforce compliance and security requirements. Manage compliance by assigning built-in or custom frameworks to resources. * * To get more information about Framework, see: * * * [API documentation](https://docs.cloud.google.com/security-command-center/docs/reference/cloudsecuritycompliance/rest/v1/organizations.locations.frameworks) * * ## Example Usage * * ### Cloudsecuritycompliance Framework Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const example = new gcp.cloudsecuritycompliance.Framework("example", { * organization: "123456789", * location: "global", * frameworkId: "example-framework", * displayName: "Terraform Framework Name", * description: "An Terraform description for the framework", * cloudControlDetails: [ * { * name: "organizations/123456789/locations/global/cloudControls/builtin-assess-resource-availability", * majorRevisionId: "1", * parameters: [{ * name: "location", * parameterValue: { * stringValue: "us-central1", * }, * }], * }, * { * name: "organizations/123456789/locations/global/cloudControls/builtin-cmek-key-in-use-for-bigquery-table", * majorRevisionId: "1", * parameters: [{ * name: "location", * parameterValue: { * stringListValue: { * values: [ * "us-central1", * "us-west1", * ], * }, * }, * }], * }, * { * name: "organizations/123456789/locations/global/cloudControls/builtin-enable-automatic-backups-cloud-sql", * majorRevisionId: "1", * parameters: [{ * name: "location", * parameterValue: { * boolValue: true, * }, * }], * }, * { * name: "organizations/123456789/locations/global/cloudControls/builtin-require-cmek-on-bigquery-datasets", * majorRevisionId: "1", * parameters: [{ * name: "location", * parameterValue: { * numberValue: 1, * }, * }], * }, * ], * }); * ``` * * ## Import * * Framework can be imported using any of these accepted formats: * * * `organizations/{{organization}}/locations/{{location}}/frameworks/{{framework_id}}` * * `{{organization}}/{{location}}/{{framework_id}}` * * When using the `pulumi import` command, Framework can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:cloudsecuritycompliance/framework:Framework default organizations/{{organization}}/locations/{{location}}/frameworks/{{framework_id}} * $ pulumi import gcp:cloudsecuritycompliance/framework:Framework default {{organization}}/{{location}}/{{framework_id}} * ``` */ class Framework extends pulumi.CustomResource { /** * Get an existing Framework 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 Framework(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:cloudsecuritycompliance/framework:Framework'; /** * Returns true if the given object is an instance of Framework. 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'] === Framework.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["categories"] = state?.categories; resourceInputs["cloudControlDetails"] = state?.cloudControlDetails; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["displayName"] = state?.displayName; resourceInputs["frameworkId"] = state?.frameworkId; resourceInputs["location"] = state?.location; resourceInputs["majorRevisionId"] = state?.majorRevisionId; resourceInputs["name"] = state?.name; resourceInputs["organization"] = state?.organization; resourceInputs["supportedCloudProviders"] = state?.supportedCloudProviders; resourceInputs["supportedEnforcementModes"] = state?.supportedEnforcementModes; resourceInputs["supportedTargetResourceTypes"] = state?.supportedTargetResourceTypes; resourceInputs["type"] = state?.type; } else { const args = argsOrState; if (args?.frameworkId === undefined && !opts.urn) { throw new Error("Missing required property 'frameworkId'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.organization === undefined && !opts.urn) { throw new Error("Missing required property 'organization'"); } resourceInputs["cloudControlDetails"] = args?.cloudControlDetails; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["displayName"] = args?.displayName; resourceInputs["frameworkId"] = args?.frameworkId; resourceInputs["location"] = args?.location; resourceInputs["organization"] = args?.organization; resourceInputs["categories"] = undefined /*out*/; resourceInputs["majorRevisionId"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["supportedCloudProviders"] = undefined /*out*/; resourceInputs["supportedEnforcementModes"] = undefined /*out*/; resourceInputs["supportedTargetResourceTypes"] = undefined /*out*/; resourceInputs["type"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Framework.__pulumiType, name, resourceInputs, opts); } } exports.Framework = Framework; //# sourceMappingURL=framework.js.map