UNPKG

@pulumi/gcp

Version:

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

172 lines • 8.35 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.V2PolicyOrchestratorForOrganization = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * PolicyOrchestrator helps managing project+zone level policy resources (e.g. * OS Policy Assignments), by providing tools to create, update and delete them * across projects and locations, at scale. * * ## Example Usage * * ### Osconfigv2 Policy Orchestrator For Organization Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const policyOrchestratorForOrganization = new gcp.osconfig.V2PolicyOrchestratorForOrganization("policy_orchestrator_for_organization", { * policyOrchestratorId: "po-org", * organizationId: "123456789", * state: "ACTIVE", * action: "UPSERT", * orchestratedResource: { * id: "test-orchestrated-resource-org", * osPolicyAssignmentV1Payload: { * osPolicies: [{ * id: "test-os-policy-org", * mode: "VALIDATION", * resourceGroups: [{ * resources: [{ * id: "resource-tf", * file: { * content: "file-content-tf", * path: "file-path-tf-1", * state: "PRESENT", * }, * }], * }], * }], * instanceFilter: { * inventories: [{ * osShortName: "windows-10", * }], * }, * rollout: { * disruptionBudget: { * percent: 100, * }, * minWaitDuration: "60s", * }, * }, * }, * labels: { * state: "active", * }, * orchestrationScope: { * selectors: [{ * locationSelector: { * includedLocations: [""], * }, * }], * }, * }); * ``` * * ## Import * * PolicyOrchestratorForOrganization can be imported using any of these accepted formats: * * * `organizations/{{organization_id}}/locations/global/policyOrchestrators/{{policy_orchestrator_id}}` * * * `{{organization_id}}/{{policy_orchestrator_id}}` * * When using the `pulumi import` command, PolicyOrchestratorForOrganization can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:osconfig/v2PolicyOrchestratorForOrganization:V2PolicyOrchestratorForOrganization default organizations/{{organization_id}}/locations/global/policyOrchestrators/{{policy_orchestrator_id}} * ``` * * ```sh * $ pulumi import gcp:osconfig/v2PolicyOrchestratorForOrganization:V2PolicyOrchestratorForOrganization default {{organization_id}}/{{policy_orchestrator_id}} * ``` */ class V2PolicyOrchestratorForOrganization extends pulumi.CustomResource { /** * Get an existing V2PolicyOrchestratorForOrganization 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 V2PolicyOrchestratorForOrganization(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of V2PolicyOrchestratorForOrganization. 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'] === V2PolicyOrchestratorForOrganization.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["action"] = state ? state.action : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined; resourceInputs["etag"] = state ? state.etag : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["orchestratedResource"] = state ? state.orchestratedResource : undefined; resourceInputs["orchestrationScope"] = state ? state.orchestrationScope : undefined; resourceInputs["orchestrationStates"] = state ? state.orchestrationStates : undefined; resourceInputs["organizationId"] = state ? state.organizationId : undefined; resourceInputs["policyOrchestratorId"] = state ? state.policyOrchestratorId : undefined; resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined; resourceInputs["reconciling"] = state ? state.reconciling : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; } else { const args = argsOrState; if ((!args || args.action === undefined) && !opts.urn) { throw new Error("Missing required property 'action'"); } if ((!args || args.orchestratedResource === undefined) && !opts.urn) { throw new Error("Missing required property 'orchestratedResource'"); } if ((!args || args.organizationId === undefined) && !opts.urn) { throw new Error("Missing required property 'organizationId'"); } if ((!args || args.policyOrchestratorId === undefined) && !opts.urn) { throw new Error("Missing required property 'policyOrchestratorId'"); } resourceInputs["action"] = args ? args.action : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["orchestratedResource"] = args ? args.orchestratedResource : undefined; resourceInputs["orchestrationScope"] = args ? args.orchestrationScope : undefined; resourceInputs["organizationId"] = args ? args.organizationId : undefined; resourceInputs["policyOrchestratorId"] = args ? args.policyOrchestratorId : undefined; resourceInputs["state"] = args ? args.state : undefined; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["etag"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["orchestrationStates"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["reconciling"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(V2PolicyOrchestratorForOrganization.__pulumiType, name, resourceInputs, opts); } } exports.V2PolicyOrchestratorForOrganization = V2PolicyOrchestratorForOrganization; /** @internal */ V2PolicyOrchestratorForOrganization.__pulumiType = 'gcp:osconfig/v2PolicyOrchestratorForOrganization:V2PolicyOrchestratorForOrganization'; //# sourceMappingURL=v2policyOrchestratorForOrganization.js.map