put_recommendation_preferences
¶
put_recommendation_preferences(
resource_type: ResourceType,
*,
config_overrides: Optional[ComputeOptimizerClientConfig] = 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/compute_optimizer.py
2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 | |