com.pulumi.aws.computeoptimizer.kotlin.RecommendationPreferencesArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.computeoptimizer.kotlin
import com.pulumi.aws.computeoptimizer.RecommendationPreferencesArgs.builder
import com.pulumi.aws.computeoptimizer.kotlin.inputs.RecommendationPreferencesExternalMetricsPreferenceArgs
import com.pulumi.aws.computeoptimizer.kotlin.inputs.RecommendationPreferencesExternalMetricsPreferenceArgsBuilder
import com.pulumi.aws.computeoptimizer.kotlin.inputs.RecommendationPreferencesPreferredResourceArgs
import com.pulumi.aws.computeoptimizer.kotlin.inputs.RecommendationPreferencesPreferredResourceArgsBuilder
import com.pulumi.aws.computeoptimizer.kotlin.inputs.RecommendationPreferencesScopeArgs
import com.pulumi.aws.computeoptimizer.kotlin.inputs.RecommendationPreferencesScopeArgsBuilder
import com.pulumi.aws.computeoptimizer.kotlin.inputs.RecommendationPreferencesUtilizationPreferenceArgs
import com.pulumi.aws.computeoptimizer.kotlin.inputs.RecommendationPreferencesUtilizationPreferenceArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* 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",
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.computeoptimizer.RecommendationPreferences("example",
* resource_type="Ec2Instance",
* scope={
* "name": "AccountId",
* "value": "123456789012",
* },
* look_back_period="DAYS_32")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.ComputeOptimizer.RecommendationPreferences("example", new()
* {
* ResourceType = "Ec2Instance",
* Scope = new Aws.ComputeOptimizer.Inputs.RecommendationPreferencesScopeArgs
* {
* Name = "AccountId",
* Value = "123456789012",
* },
* LookBackPeriod = "DAYS_32",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/computeoptimizer"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := computeoptimizer.NewRecommendationPreferences(ctx, "example", &computeoptimizer.RecommendationPreferencesArgs{
* ResourceType: pulumi.String("Ec2Instance"),
* Scope: &computeoptimizer.RecommendationPreferencesScopeArgs{
* Name: pulumi.String("AccountId"),
* Value: pulumi.String("123456789012"),
* },
* LookBackPeriod: pulumi.String("DAYS_32"),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.computeoptimizer.RecommendationPreferences;
* import com.pulumi.aws.computeoptimizer.RecommendationPreferencesArgs;
* import com.pulumi.aws.computeoptimizer.inputs.RecommendationPreferencesScopeArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new RecommendationPreferences("example", RecommendationPreferencesArgs.builder()
* .resourceType("Ec2Instance")
* .scope(RecommendationPreferencesScopeArgs.builder()
* .name("AccountId")
* .value("123456789012")
* .build())
* .lookBackPeriod("DAYS_32")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:computeoptimizer:RecommendationPreferences
* properties:
* 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",
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.computeoptimizer.RecommendationPreferences("example",
* resource_type="Ec2Instance",
* scope={
* "name": "AccountId",
* "value": "123456789012",
* },
* enhanced_infrastructure_metrics="Active",
* external_metrics_preference={
* "source": "Datadog",
* },
* preferred_resources=[{
* "include_lists": [
* "m5.xlarge",
* "r5",
* ],
* "name": "Ec2InstanceTypes",
* }])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.ComputeOptimizer.RecommendationPreferences("example", new()
* {
* ResourceType = "Ec2Instance",
* Scope = new Aws.ComputeOptimizer.Inputs.RecommendationPreferencesScopeArgs
* {
* Name = "AccountId",
* Value = "123456789012",
* },
* EnhancedInfrastructureMetrics = "Active",
* ExternalMetricsPreference = new Aws.ComputeOptimizer.Inputs.RecommendationPreferencesExternalMetricsPreferenceArgs
* {
* Source = "Datadog",
* },
* PreferredResources = new[]
* {
* new Aws.ComputeOptimizer.Inputs.RecommendationPreferencesPreferredResourceArgs
* {
* IncludeLists = new[]
* {
* "m5.xlarge",
* "r5",
* },
* Name = "Ec2InstanceTypes",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/computeoptimizer"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := computeoptimizer.NewRecommendationPreferences(ctx, "example", &computeoptimizer.RecommendationPreferencesArgs{
* ResourceType: pulumi.String("Ec2Instance"),
* Scope: &computeoptimizer.RecommendationPreferencesScopeArgs{
* Name: pulumi.String("AccountId"),
* Value: pulumi.String("123456789012"),
* },
* EnhancedInfrastructureMetrics: pulumi.String("Active"),
* ExternalMetricsPreference: &computeoptimizer.RecommendationPreferencesExternalMetricsPreferenceArgs{
* Source: pulumi.String("Datadog"),
* },
* PreferredResources: computeoptimizer.RecommendationPreferencesPreferredResourceArray{
* &computeoptimizer.RecommendationPreferencesPreferredResourceArgs{
* IncludeLists: pulumi.StringArray{
* pulumi.String("m5.xlarge"),
* pulumi.String("r5"),
* },
* Name: pulumi.String("Ec2InstanceTypes"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.computeoptimizer.RecommendationPreferences;
* import com.pulumi.aws.computeoptimizer.RecommendationPreferencesArgs;
* import com.pulumi.aws.computeoptimizer.inputs.RecommendationPreferencesScopeArgs;
* import com.pulumi.aws.computeoptimizer.inputs.RecommendationPreferencesExternalMetricsPreferenceArgs;
* import com.pulumi.aws.computeoptimizer.inputs.RecommendationPreferencesPreferredResourceArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new RecommendationPreferences("example", RecommendationPreferencesArgs.builder()
* .resourceType("Ec2Instance")
* .scope(RecommendationPreferencesScopeArgs.builder()
* .name("AccountId")
* .value("123456789012")
* .build())
* .enhancedInfrastructureMetrics("Active")
* .externalMetricsPreference(RecommendationPreferencesExternalMetricsPreferenceArgs.builder()
* .source("Datadog")
* .build())
* .preferredResources(RecommendationPreferencesPreferredResourceArgs.builder()
* .includeLists(
* "m5.xlarge",
* "r5")
* .name("Ec2InstanceTypes")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:computeoptimizer:RecommendationPreferences
* properties:
* 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
* ```
* @property enhancedInfrastructureMetrics The status of the enhanced infrastructure metrics recommendation preference. Valid values: `Active`, `Inactive`.
* @property externalMetricsPreference The provider of the external metrics recommendation preference. See External Metrics Preference below.
* @property inferredWorkloadTypes The status of the inferred workload types recommendation preference. Valid values: `Active`, `Inactive`.
* @property lookBackPeriod The preference to control the number of days the utilization metrics of the AWS resource are analyzed. Valid values: `DAYS_14`, `DAYS_32`, `DAYS_93`.
* @property preferredResources The preference to control which resource type values are considered when generating rightsizing recommendations. See Preferred Resources below.
* @property resourceType The target resource type of the recommendation preferences. Valid values: `Ec2Instance`, `AutoScalingGroup`, `RdsDBInstance`.
* @property savingsEstimationMode The status of the savings estimation mode preference. Valid values: `AfterDiscounts`, `BeforeDiscounts`.
* @property scope The scope of the recommendation preferences. See Scope below.
* @property utilizationPreferences The preference to control the resource’s CPU utilization threshold, CPU utilization headroom, and memory utilization headroom. See Utilization Preferences below.
*/
public data class RecommendationPreferencesArgs(
public val enhancedInfrastructureMetrics: Output? = null,
public val externalMetricsPreference: Output? = null,
public val inferredWorkloadTypes: Output? = null,
public val lookBackPeriod: Output? = null,
public val preferredResources: Output>? =
null,
public val resourceType: Output? = null,
public val savingsEstimationMode: Output? = null,
public val scope: Output? = null,
public val utilizationPreferences: Output>? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.computeoptimizer.RecommendationPreferencesArgs =
com.pulumi.aws.computeoptimizer.RecommendationPreferencesArgs.builder()
.enhancedInfrastructureMetrics(enhancedInfrastructureMetrics?.applyValue({ args0 -> args0 }))
.externalMetricsPreference(
externalMetricsPreference?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
)
.inferredWorkloadTypes(inferredWorkloadTypes?.applyValue({ args0 -> args0 }))
.lookBackPeriod(lookBackPeriod?.applyValue({ args0 -> args0 }))
.preferredResources(
preferredResources?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.resourceType(resourceType?.applyValue({ args0 -> args0 }))
.savingsEstimationMode(savingsEstimationMode?.applyValue({ args0 -> args0 }))
.scope(scope?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.utilizationPreferences(
utilizationPreferences?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
).build()
}
/**
* Builder for [RecommendationPreferencesArgs].
*/
@PulumiTagMarker
public class RecommendationPreferencesArgsBuilder internal constructor() {
private var enhancedInfrastructureMetrics: Output? = null
private var externalMetricsPreference:
Output? = null
private var inferredWorkloadTypes: Output? = null
private var lookBackPeriod: Output? = null
private var preferredResources: Output>? =
null
private var resourceType: Output? = null
private var savingsEstimationMode: Output? = null
private var scope: Output? = null
private var utilizationPreferences:
Output>? = null
/**
* @param value The status of the enhanced infrastructure metrics recommendation preference. Valid values: `Active`, `Inactive`.
*/
@JvmName("yufxwaofjxxdqimp")
public suspend fun enhancedInfrastructureMetrics(`value`: Output) {
this.enhancedInfrastructureMetrics = value
}
/**
* @param value The provider of the external metrics recommendation preference. See External Metrics Preference below.
*/
@JvmName("xbheieihvwwrbhab")
public suspend fun externalMetricsPreference(`value`: Output) {
this.externalMetricsPreference = value
}
/**
* @param value The status of the inferred workload types recommendation preference. Valid values: `Active`, `Inactive`.
*/
@JvmName("akubjcqygpkwvwhs")
public suspend fun inferredWorkloadTypes(`value`: Output) {
this.inferredWorkloadTypes = value
}
/**
* @param value The preference to control the number of days the utilization metrics of the AWS resource are analyzed. Valid values: `DAYS_14`, `DAYS_32`, `DAYS_93`.
*/
@JvmName("pxlqjjwfbrtsucyd")
public suspend fun lookBackPeriod(`value`: Output) {
this.lookBackPeriod = value
}
/**
* @param value The preference to control which resource type values are considered when generating rightsizing recommendations. See Preferred Resources below.
*/
@JvmName("wwhsmrgfcvbiiaxx")
public suspend fun preferredResources(`value`: Output>) {
this.preferredResources = value
}
@JvmName("wlkogodmntkdasxq")
public suspend fun preferredResources(vararg values: Output) {
this.preferredResources = Output.all(values.asList())
}
/**
* @param values The preference to control which resource type values are considered when generating rightsizing recommendations. See Preferred Resources below.
*/
@JvmName("qlbghdlqofgxfgqx")
public suspend fun preferredResources(values: List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy