UNPKG

@pulumi/gcp

Version:

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

293 lines • 12.5 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.CloudControl = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Cloud controls are the building blocks that make up frameworks. Each cloud control is a unit encapsulating various platform-specific logic for prevention, detection, and audit. * * To get more information about CloudControl, see: * * * [API documentation](https://docs.cloud.google.com/security-command-center/docs/reference/cloudsecuritycompliance/rest/v1/organizations.locations.cloudControls) * * ## Example Usage * * ### Cloudsecuritycompliance Cloudcontrol Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const example = new gcp.cloudsecuritycompliance.CloudControl("example", { * organization: "123456789", * location: "global", * cloudControlId: "example-cloudcontrol", * displayName: "TF test CloudControl Name", * description: "A test cloud control for security compliance", * categories: ["CC_CATEGORY_INFRASTRUCTURE"], * severity: "HIGH", * findingCategory: "SECURITY_POLICY", * remediationSteps: "Review and update the security configuration according to best practices.", * supportedCloudProviders: ["GCP"], * rules: [{ * description: "Ensure compute instances have secure boot enabled", * ruleActionTypes: ["RULE_ACTION_TYPE_DETECTIVE"], * celExpression: { * expression: "resource.data.shieldedInstanceConfig.enableSecureBoot == true", * resourceTypesValues: { * values: ["compute.googleapis.com/Instance"], * }, * }, * }], * parameterSpecs: [ * { * name: "location", * displayName: "Resource Location", * description: "The location where the resource should be deployed", * valueType: "STRING", * isRequired: true, * defaultValue: { * stringValue: "us-central1", * }, * validation: { * regexpPattern: { * pattern: "^[a-z]+-[a-z]+[0-9]$", * }, * }, * }, * { * name: "enable_secure_boot", * displayName: "Enable Secure Boot", * description: "Whether to enable secure boot for instances", * valueType: "BOOLEAN", * isRequired: true, * defaultValue: { * boolValue: true, * }, * substitutionRules: [{ * attributeSubstitutionRule: { * attribute: "rules[0].cel_expression.expression", * }, * }], * validation: { * allowedValues: { * values: [{ * boolValue: true, * }], * }, * }, * }, * { * name: "max_instances", * displayName: "Maximum Instances", * description: "Maximum number of instances allowed", * valueType: "NUMBER", * isRequired: false, * defaultValue: { * numberValue: 10, * }, * substitutionRules: [{ * placeholderSubstitutionRule: { * attribute: "rules[0].description", * }, * }], * validation: { * intRange: { * min: "1", * max: "100", * }, * }, * }, * { * name: "allowed_regions", * displayName: "Allowed Regions", * description: "List of regions where resources can be deployed", * valueType: "STRINGLIST", * isRequired: true, * defaultValue: { * stringListValue: { * values: [ * "us-central1", * "us-east1", * "us-west1", * ], * }, * }, * validation: { * allowedValues: { * values: [ * { * stringListValue: { * values: [ * "us-central1", * "us-east1", * ], * }, * }, * { * stringListValue: { * values: [ * "us-west1", * "us-west2", * ], * }, * }, * ], * }, * }, * }, * { * name: "environment_type", * displayName: "Environment Type", * description: "The type of environment", * valueType: "STRING", * isRequired: true, * defaultValue: { * stringValue: "production", * }, * validation: { * allowedValues: { * values: [ * { * stringValue: "production", * }, * { * stringValue: "staging", * }, * { * numberValue: 1, * }, * ], * }, * }, * }, * ], * }); * ``` * * ## Import * * CloudControl can be imported using any of these accepted formats: * * * `organizations/{{organization}}/locations/{{location}}/cloudControls/{{cloud_control_id}}` * * `{{organization}}/{{location}}/{{cloud_control_id}}` * * When using the `pulumi import` command, CloudControl can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:cloudsecuritycompliance/cloudControl:CloudControl default organizations/{{organization}}/locations/{{location}}/cloudControls/{{cloud_control_id}} * $ pulumi import gcp:cloudsecuritycompliance/cloudControl:CloudControl default {{organization}}/{{location}}/{{cloud_control_id}} * ``` */ class CloudControl extends pulumi.CustomResource { /** * Get an existing CloudControl 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 CloudControl(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:cloudsecuritycompliance/cloudControl:CloudControl'; /** * Returns true if the given object is an instance of CloudControl. 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'] === CloudControl.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["categories"] = state?.categories; resourceInputs["cloudControlId"] = state?.cloudControlId; resourceInputs["createTime"] = state?.createTime; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["displayName"] = state?.displayName; resourceInputs["findingCategory"] = state?.findingCategory; resourceInputs["location"] = state?.location; resourceInputs["majorRevisionId"] = state?.majorRevisionId; resourceInputs["name"] = state?.name; resourceInputs["organization"] = state?.organization; resourceInputs["parameterSpecs"] = state?.parameterSpecs; resourceInputs["relatedFrameworks"] = state?.relatedFrameworks; resourceInputs["remediationSteps"] = state?.remediationSteps; resourceInputs["rules"] = state?.rules; resourceInputs["severity"] = state?.severity; resourceInputs["supportedCloudProviders"] = state?.supportedCloudProviders; resourceInputs["supportedEnforcementModes"] = state?.supportedEnforcementModes; resourceInputs["supportedTargetResourceTypes"] = state?.supportedTargetResourceTypes; } else { const args = argsOrState; if (args?.cloudControlId === undefined && !opts.urn) { throw new Error("Missing required property 'cloudControlId'"); } 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["categories"] = args?.categories; resourceInputs["cloudControlId"] = args?.cloudControlId; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["displayName"] = args?.displayName; resourceInputs["findingCategory"] = args?.findingCategory; resourceInputs["location"] = args?.location; resourceInputs["organization"] = args?.organization; resourceInputs["parameterSpecs"] = args?.parameterSpecs; resourceInputs["remediationSteps"] = args?.remediationSteps; resourceInputs["rules"] = args?.rules; resourceInputs["severity"] = args?.severity; resourceInputs["supportedCloudProviders"] = args?.supportedCloudProviders; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["majorRevisionId"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["relatedFrameworks"] = undefined /*out*/; resourceInputs["supportedEnforcementModes"] = undefined /*out*/; resourceInputs["supportedTargetResourceTypes"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CloudControl.__pulumiType, name, resourceInputs, opts); } } exports.CloudControl = CloudControl; //# sourceMappingURL=cloudControl.js.map