Class RecommendationPreferences


  • public class RecommendationPreferences
    extends com.pulumi.resources.CustomResource
    Manages AWS Compute Optimizer recommendation preferences. ## Example Usage ### Lookback Period Preference
     
     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.ArrayList;
     import java.util.Arrays;
     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()
                 .scope(RecommendationPreferencesScopeArgs.builder()
                     .name("AccountId")
                     .value("123456789012")
                     .build())
                 .resourceType("Ec2Instance")
                 .lookBackPeriod("DAYS_32")
                 .build());
     
         }
     }
     
     
    ### Multiple Preferences
     
     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.ArrayList;
     import java.util.Arrays;
     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()
                 .scope(RecommendationPreferencesScopeArgs.builder()
                     .name("AccountId")
                     .value("123456789012")
                     .build())
                 .externalMetricsPreference(RecommendationPreferencesExternalMetricsPreferenceArgs.builder()
                     .source("Datadog")
                     .build())
                 .preferredResources(RecommendationPreferencesPreferredResourceArgs.builder()
                     .includeLists(                
                         "m5.xlarge",
                         "r5")
                     .name("Ec2InstanceTypes")
                     .build())
                 .resourceType("Ec2Instance")
                 .enhancedInfrastructureMetrics("Active")
                 .build());
     
         }
     }
     
     
    ## 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 ```
    • Constructor Detail

      • RecommendationPreferences

        public RecommendationPreferences​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • RecommendationPreferences

        public RecommendationPreferences​(java.lang.String name,
                                         RecommendationPreferencesArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • RecommendationPreferences

        public RecommendationPreferences​(java.lang.String name,
                                         RecommendationPreferencesArgs args,
                                         @Nullable
                                         com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • enhancedInfrastructureMetrics

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> enhancedInfrastructureMetrics()
        Returns:
        The status of the enhanced infrastructure metrics recommendation preference. Valid values: `Active`, `Inactive`.
      • externalMetricsPreference

        public com.pulumi.core.Output<java.util.Optional<RecommendationPreferencesExternalMetricsPreference>> externalMetricsPreference()
        Returns:
        The provider of the external metrics recommendation preference. See External Metrics Preference below.
      • inferredWorkloadTypes

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> inferredWorkloadTypes()
        Returns:
        The status of the inferred workload types recommendation preference. Valid values: `Active`, `Inactive`.
      • lookBackPeriod

        public com.pulumi.core.Output<java.lang.String> lookBackPeriod()
        Returns:
        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`.
      • preferredResources

        public com.pulumi.core.Output<java.util.Optional<java.util.List<RecommendationPreferencesPreferredResource>>> preferredResources()
        Returns:
        The preference to control which resource type values are considered when generating rightsizing recommendations. See Preferred Resources below.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • resourceType

        public com.pulumi.core.Output<java.lang.String> resourceType()
        Returns:
        The target resource type of the recommendation preferences. Valid values: `Ec2Instance`, `AutoScalingGroup`, `RdsDBInstance`, `AuroraDBClusterStorage`.
      • savingsEstimationMode

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> savingsEstimationMode()
        Returns:
        The status of the savings estimation mode preference. Valid values: `AfterDiscounts`, `BeforeDiscounts`.
      • scope

        public com.pulumi.core.Output<RecommendationPreferencesScope> scope()
        Returns:
        The scope of the recommendation preferences. See Scope below.
      • utilizationPreferences

        public com.pulumi.core.Output<java.util.Optional<java.util.List<RecommendationPreferencesUtilizationPreference>>> utilizationPreferences()
        Returns:
        The preference to control the resource’s CPU utilization threshold, CPU utilization headroom, and memory utilization headroom. See Utilization Preferences below.
      • get

        public static RecommendationPreferences get​(java.lang.String name,
                                                    com.pulumi.core.Output<java.lang.String> id,
                                                    @Nullable
                                                    RecommendationPreferencesState state,
                                                    @Nullable
                                                    com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.