UNPKG

@pulumi/gcp

Version:

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

169 lines 7.21 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.PreferenceSet = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages the PreferenceSet resource. * * To get more information about PreferenceSet, see: * * * [API documentation](https://cloud.google.com/migration-center/docs/reference/rest/v1) * * How-to Guides * * [Managing Migration Preferences](https://cloud.google.com/migration-center/docs/migration-preferences) * * ## Example Usage * * ### Preference Set Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.migrationcenter.PreferenceSet("default", { * location: "us-central1", * preferenceSetId: "preference-set-test", * description: "Terraform integration test description", * displayName: "Terraform integration test display", * virtualMachinePreferences: { * vmwareEnginePreferences: { * cpuOvercommitRatio: 1.5, * }, * sizingOptimizationStrategy: "SIZING_OPTIMIZATION_STRATEGY_SAME_AS_SOURCE", * targetProduct: "COMPUTE_MIGRATION_TARGET_PRODUCT_COMPUTE_ENGINE", * }, * }); * ``` * ### Preference Set Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.migrationcenter.PreferenceSet("default", { * location: "us-central1", * preferenceSetId: "preference-set-test", * description: "Terraform integration test description", * displayName: "Terraform integration test display", * virtualMachinePreferences: { * vmwareEnginePreferences: { * cpuOvercommitRatio: 1.5, * storageDeduplicationCompressionRatio: 1.3, * commitmentPlan: "ON_DEMAND", * }, * sizingOptimizationStrategy: "SIZING_OPTIMIZATION_STRATEGY_SAME_AS_SOURCE", * targetProduct: "COMPUTE_MIGRATION_TARGET_PRODUCT_COMPUTE_ENGINE", * commitmentPlan: "COMMITMENT_PLAN_ONE_YEAR", * regionPreferences: { * preferredRegions: ["us-central1"], * }, * soleTenancyPreferences: { * commitmentPlan: "ON_DEMAND", * cpuOvercommitRatio: 1.2, * hostMaintenancePolicy: "HOST_MAINTENANCE_POLICY_DEFAULT", * nodeTypes: [{ * nodeName: "tf-test", * }], * }, * computeEnginePreferences: { * licenseType: "LICENSE_TYPE_BRING_YOUR_OWN_LICENSE", * machinePreferences: { * allowedMachineSeries: [{ * code: "C3", * }], * }, * }, * }, * }); * ``` * * ## Import * * PreferenceSet can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/preferenceSets/{{preference_set_id}}` * * * `{{project}}/{{location}}/{{preference_set_id}}` * * * `{{location}}/{{preference_set_id}}` * * When using the `pulumi import` command, PreferenceSet can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:migrationcenter/preferenceSet:PreferenceSet default projects/{{project}}/locations/{{location}}/preferenceSets/{{preference_set_id}} * ``` * * ```sh * $ pulumi import gcp:migrationcenter/preferenceSet:PreferenceSet default {{project}}/{{location}}/{{preference_set_id}} * ``` * * ```sh * $ pulumi import gcp:migrationcenter/preferenceSet:PreferenceSet default {{location}}/{{preference_set_id}} * ``` */ class PreferenceSet extends pulumi.CustomResource { /** * Get an existing PreferenceSet 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 PreferenceSet(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of PreferenceSet. 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'] === PreferenceSet.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["preferenceSetId"] = state ? state.preferenceSetId : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; resourceInputs["virtualMachinePreferences"] = state ? state.virtualMachinePreferences : undefined; } else { const args = argsOrState; if ((!args || args.location === undefined) && !opts.urn) { throw new Error("Missing required property 'location'"); } if ((!args || args.preferenceSetId === undefined) && !opts.urn) { throw new Error("Missing required property 'preferenceSetId'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["preferenceSetId"] = args ? args.preferenceSetId : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["virtualMachinePreferences"] = args ? args.virtualMachinePreferences : undefined; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(PreferenceSet.__pulumiType, name, resourceInputs, opts); } } exports.PreferenceSet = PreferenceSet; /** @internal */ PreferenceSet.__pulumiType = 'gcp:migrationcenter/preferenceSet:PreferenceSet'; //# sourceMappingURL=preferenceSet.js.map