put_recommendation_preferences
async
¶
put_recommendation_preferences(
resource_type: ResourceType,
*,
config_overrides: Optional[AsyncComputeOptimizerClientConfig] = None,
scope: Optional[Scope] = None,
enhanced_infrastructure_metrics: Optional[EnhancedInfrastructureMetrics] = None,
inferred_workload_types: Optional[InferredWorkloadTypesPreference] = None,
external_metrics_preference: Optional[ExternalMetricsPreference] = None,
look_back_period: Optional[LookBackPeriodPreference] = None,
utilization_preferences: Optional[UtilizationPreferences] = None,
preferred_resources: Optional[PreferredResources] = None,
savings_estimation_mode: Optional[SavingsEstimationMode] = None,
) -> PutRecommendationPreferencesResponse
Creates a new recommendation preference or updates an existing recommendation preference, such as enhanced infrastructure metrics.
For more information, see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.
Parameters:
-
resource_type(ResourceType) –The target resource type of the recommendation preference to create.
The
Ec2Instanceoption encompasses standalone instances and instances that are part of Auto Scaling groups. TheAutoScalingGroupoption encompasses only instances that are part of an Auto Scaling group. -
scope(Optional[Scope], default:None) –An object that describes the scope of the recommendation preference to create.
You can create recommendation preferences at the organization level (for management accounts of an organization only), account level, and resource level. For more information, see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.
You cannot create recommendation preferences for Auto Scaling groups at the organization and account levels. You can create recommendation preferences for Auto Scaling groups only at the resource level by specifying a scope name of
ResourceArnand a scope value of the Auto Scaling group Amazon Resource Name (ARN). This will configure the preference for all instances that are part of the specified Auto Scaling group. You also cannot create recommendation preferences at the resource level for instances that are part of an Auto Scaling group. You can create recommendation preferences at the resource level only for standalone instances. -
enhanced_infrastructure_metrics(Optional[EnhancedInfrastructureMetrics], default:None) –The status of the enhanced infrastructure metrics recommendation preference to create or update.
Specify the
Activestatus to activate the preference, or specifyInactiveto deactivate the preference.For more information, see Enhanced infrastructure metrics in the Compute Optimizer User Guide.
-
inferred_workload_types(Optional[InferredWorkloadTypesPreference], default:None) –The status of the inferred workload types recommendation preference to create or update.
The inferred workload type feature is active by default. To deactivate it, create a recommendation preference.
Specify the
Inactivestatus to deactivate the feature, or specifyActiveto activate it.For more information, see Inferred workload types in the Compute Optimizer User Guide.
-
external_metrics_preference(Optional[ExternalMetricsPreference], default:None) –The provider of the external metrics recommendation preference to create or update.
Specify a valid provider in the
sourcefield to activate the preference. To delete this preference, see the DeleteRecommendationPreferences action.This preference can only be set for the
Ec2Instanceresource type.For more information, see External metrics ingestion in the Compute Optimizer User Guide.
-
look_back_period(Optional[LookBackPeriodPreference], default:None) –The preference to control the number of days the utilization metrics of the Amazon Web Services resource are analyzed. When this preference isn't specified, we use the default value
DAYS_14.You can only set this preference for the Amazon EC2 instance, Auto Scaling group, Amazon EBS volume, Amazon ECS service on Fargate, Amazon RDS DB instance, and Aurora DB cluster storage resource types.
-
Lookback period preferences for Amazon EC2 instances, Amazon EBS volumes, Amazon ECS services, Amazon RDS DB instances, and Aurora DB cluster storage resource types can be set at the organization, account, and resource levels.
-
Auto Scaling group lookback preferences can only be set at the resource level.
-
Amazon EBS volume lookback preferences can be set at the organization, account, and resource levels.
-
Amazon ECS service on Fargate lookback preferences can be set at the organization, account, and resource levels.
-
Amazon RDS DB instance lookback preferences can be set at the organization, account, and resource levels.
-
Aurora DB cluster storage lookback preferences can be set at the organization, account, and resource levels.
-
Changing the lookback period for Amazon EBS volumes to 14 days does not affect the 32-day lookback period used to determine whether an Amazon EBS volume is unattached.
-
-
utilization_preferences(Optional[UtilizationPreferences], default:None) –The preference to control the resource’s CPU utilization threshold, CPU utilization headroom, and memory utilization headroom. When this preference isn't specified, we use the following default values.
CPU utilization:
-
P99_5for threshold -
PERCENT_20for headroom
Memory utilization:
-
PERCENT_20for headroom
-
You can only set CPU and memory utilization preferences for the Amazon EC2 instance resource type.
-
The threshold setting isn’t available for memory utilization.
-
-
preferred_resources(Optional[PreferredResources], default:None) –The preference to control which resource type values are considered when generating rightsizing recommendations. You can specify this preference as a combination of include and exclude lists. You must specify either an
includeListorexcludeList. If the preference is an empty set of resource type values, an error occurs.You can only set this preference for the Amazon EC2 instance, Auto Scaling group, Amazon EBS volume, Amazon ECS service, Amazon RDS DB instance, and Aurora DB cluster storage resource types.
-
savings_estimation_mode(Optional[SavingsEstimationMode], default:None) –The status of the savings estimation mode preference to create or update.
Specify the
AfterDiscountsstatus to activate the preference, or specifyBeforeDiscountsto deactivate the preference.Only the account manager or delegated administrator of your organization can activate this preference.
For more information, see Savings estimation mode in the Compute Optimizer User Guide.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action.
-
InternalServerException–An internal error has occurred. Try your call again.
-
InvalidParameterValueException–The value supplied for the input parameter is out of range or not valid.
-
MissingAuthenticationToken–The request must contain either a valid (registered) Amazon Web Services access key ID or X.509 certificate.
-
OptInRequiredException–The account is not opted in to Compute Optimizer.
-
ResourceNotFoundException–A resource that is required for the action doesn't exist.
-
ServiceUnavailableException–The request has failed due to a temporary failure of the server.
-
ThrottlingException–The request was denied due to request throttling.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_compute_optimizer/_services/async_compute_optimizer.py
2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 | |