@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
125 lines • 5.62 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.RecommendationPreferences = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages AWS Compute Optimizer recommendation preferences.
*
* ## Example Usage
*
* ### Lookback Period Preference
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.computeoptimizer.RecommendationPreferences("example", {
* resourceType: "Ec2Instance",
* scope: {
* name: "AccountId",
* value: "123456789012",
* },
* lookBackPeriod: "DAYS_32",
* });
* ```
*
* ### Multiple Preferences
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.computeoptimizer.RecommendationPreferences("example", {
* resourceType: "Ec2Instance",
* scope: {
* name: "AccountId",
* value: "123456789012",
* },
* enhancedInfrastructureMetrics: "Active",
* externalMetricsPreference: {
* source: "Datadog",
* },
* preferredResources: [{
* includeLists: [
* "m5.xlarge",
* "r5",
* ],
* name: "Ec2InstanceTypes",
* }],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import recommendation preferences using the resource type, scope name and scope value. For example:
*
* ```sh
* $ pulumi import aws:computeoptimizer/recommendationPreferences:RecommendationPreferences example Ec2Instance,AccountId,123456789012
* ```
*/
class RecommendationPreferences extends pulumi.CustomResource {
/**
* Get an existing RecommendationPreferences 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 RecommendationPreferences(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of RecommendationPreferences. 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'] === RecommendationPreferences.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["enhancedInfrastructureMetrics"] = state ? state.enhancedInfrastructureMetrics : undefined;
resourceInputs["externalMetricsPreference"] = state ? state.externalMetricsPreference : undefined;
resourceInputs["inferredWorkloadTypes"] = state ? state.inferredWorkloadTypes : undefined;
resourceInputs["lookBackPeriod"] = state ? state.lookBackPeriod : undefined;
resourceInputs["preferredResources"] = state ? state.preferredResources : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["resourceType"] = state ? state.resourceType : undefined;
resourceInputs["savingsEstimationMode"] = state ? state.savingsEstimationMode : undefined;
resourceInputs["scope"] = state ? state.scope : undefined;
resourceInputs["utilizationPreferences"] = state ? state.utilizationPreferences : undefined;
}
else {
const args = argsOrState;
if ((!args || args.resourceType === undefined) && !opts.urn) {
throw new Error("Missing required property 'resourceType'");
}
resourceInputs["enhancedInfrastructureMetrics"] = args ? args.enhancedInfrastructureMetrics : undefined;
resourceInputs["externalMetricsPreference"] = args ? args.externalMetricsPreference : undefined;
resourceInputs["inferredWorkloadTypes"] = args ? args.inferredWorkloadTypes : undefined;
resourceInputs["lookBackPeriod"] = args ? args.lookBackPeriod : undefined;
resourceInputs["preferredResources"] = args ? args.preferredResources : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["resourceType"] = args ? args.resourceType : undefined;
resourceInputs["savingsEstimationMode"] = args ? args.savingsEstimationMode : undefined;
resourceInputs["scope"] = args ? args.scope : undefined;
resourceInputs["utilizationPreferences"] = args ? args.utilizationPreferences : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RecommendationPreferences.__pulumiType, name, resourceInputs, opts);
}
}
exports.RecommendationPreferences = RecommendationPreferences;
/** @internal */
RecommendationPreferences.__pulumiType = 'aws:computeoptimizer/recommendationPreferences:RecommendationPreferences';
//# sourceMappingURL=recommendationPreferences.js.map