@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
169 lines • 6.86 kB
JavaScript
// *** 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.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, { ...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?.createTime;
resourceInputs["description"] = state?.description;
resourceInputs["displayName"] = state?.displayName;
resourceInputs["location"] = state?.location;
resourceInputs["name"] = state?.name;
resourceInputs["preferenceSetId"] = state?.preferenceSetId;
resourceInputs["project"] = state?.project;
resourceInputs["updateTime"] = state?.updateTime;
resourceInputs["virtualMachinePreferences"] = state?.virtualMachinePreferences;
}
else {
const args = argsOrState;
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if (args?.preferenceSetId === undefined && !opts.urn) {
throw new Error("Missing required property 'preferenceSetId'");
}
resourceInputs["description"] = args?.description;
resourceInputs["displayName"] = args?.displayName;
resourceInputs["location"] = args?.location;
resourceInputs["preferenceSetId"] = args?.preferenceSetId;
resourceInputs["project"] = args?.project;
resourceInputs["virtualMachinePreferences"] = args?.virtualMachinePreferences;
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
;