UNPKG

@pulumi/gcp

Version:

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

161 lines 7.38 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.V2PolicyOrchestrator = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * ## Example Usage * * ### Osconfigv2 Policy Orchestrator Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const policyOrchestrator = new gcp.osconfig.V2PolicyOrchestrator("policy_orchestrator", { * policyOrchestratorId: "po", * state: "ACTIVE", * action: "UPSERT", * orchestratedResource: { * id: "test-orchestrated-resource", * osPolicyAssignmentV1Payload: { * osPolicies: [{ * id: "test-os-policy", * 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", * }, * }); * ``` * * ## Import * * PolicyOrchestrator can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/global/policyOrchestrators/{{policy_orchestrator_id}}` * * * `{{project}}/{{policy_orchestrator_id}}` * * * `{{policy_orchestrator_id}}` * * When using the `pulumi import` command, PolicyOrchestrator can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:osconfig/v2PolicyOrchestrator:V2PolicyOrchestrator default projects/{{project}}/locations/global/policyOrchestrators/{{policy_orchestrator_id}} * ``` * * ```sh * $ pulumi import gcp:osconfig/v2PolicyOrchestrator:V2PolicyOrchestrator default {{project}}/{{policy_orchestrator_id}} * ``` * * ```sh * $ pulumi import gcp:osconfig/v2PolicyOrchestrator:V2PolicyOrchestrator default {{policy_orchestrator_id}} * ``` */ class V2PolicyOrchestrator extends pulumi.CustomResource { /** * Get an existing V2PolicyOrchestrator 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 V2PolicyOrchestrator(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of V2PolicyOrchestrator. 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'] === V2PolicyOrchestrator.__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["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["policyOrchestratorId"] = state ? state.policyOrchestratorId : undefined; resourceInputs["project"] = state ? state.project : 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.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["policyOrchestratorId"] = args ? args.policyOrchestratorId : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["state"] = args ? args.state : undefined; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["effectiveLabels"] = 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(V2PolicyOrchestrator.__pulumiType, name, resourceInputs, opts); } } exports.V2PolicyOrchestrator = V2PolicyOrchestrator; /** @internal */ V2PolicyOrchestrator.__pulumiType = 'gcp:osconfig/v2PolicyOrchestrator:V2PolicyOrchestrator'; //# sourceMappingURL=v2policyOrchestrator.js.map