AWS Compute Optimizer

2020/12/03 - AWS Compute Optimizer - 1 new 2 updated api methods

Changes  This release enables AWS Compute Optimizer to analyze and generate optimization recommendations for EBS volumes that are attached to instances.

GetEBSVolumeRecommendations (new) Link ¶

Returns Amazon Elastic Block Store (Amazon EBS) volume recommendations.

AWS Compute Optimizer generates recommendations for Amazon EBS volumes that meet a specific set of requirements. For more information, see the Supported resources and requirements in the AWS Compute Optimizer User Guide .

See also: AWS API Documentation

Request Syntax

client.get_ebs_volume_recommendations(
    volumeArns=[
        'string',
    ],
    nextToken='string',
    maxResults=123,
    filters=[
        {
            'name': 'Finding',
            'values': [
                'string',
            ]
        },
    ],
    accountIds=[
        'string',
    ]
)
type volumeArns

list

param volumeArns

The Amazon Resource Name (ARN) of the volumes for which to return recommendations.

  • (string) --

type nextToken

string

param nextToken

The token to advance to the next page of volume recommendations.

type maxResults

integer

param maxResults

The maximum number of volume recommendations to return with a single request.

To retrieve the remaining results, make another request with the returned NextToken value.

type filters

list

param filters

An array of objects that describe a filter that returns a more specific list of volume recommendations.

  • (dict) --

    Describes a filter that returns a more specific list of Amazon Elastic Block Store (Amazon EBS) volume recommendations.

    This filter is used with the GetEBSVolumeRecommendations action.

    • name (string) --

      The name of the filter.

      Specify Finding to return recommendations with a specific finding classification (e.g., Optimized ).

    • values (list) --

      The value of the filter.

      The valid values are Optimized , or NotOptimized .

      • (string) --

type accountIds

list

param accountIds

The IDs of the AWS accounts for which to return volume recommendations.

If your account is the management account of an organization, use this parameter to specify the member accounts for which you want to return volume recommendations.

Only one account ID can be specified per request.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'nextToken': 'string',
    'volumeRecommendations': [
        {
            'volumeArn': 'string',
            'accountId': 'string',
            'currentConfiguration': {
                'volumeType': 'string',
                'volumeSize': 123,
                'volumeBaselineIOPS': 123,
                'volumeBurstIOPS': 123,
                'volumeBaselineThroughput': 123,
                'volumeBurstThroughput': 123
            },
            'finding': 'Optimized'|'NotOptimized',
            'utilizationMetrics': [
                {
                    'name': 'VolumeReadOpsPerSecond'|'VolumeWriteOpsPerSecond'|'VolumeReadBytesPerSecond'|'VolumeWriteBytesPerSecond',
                    'statistic': 'Maximum'|'Average',
                    'value': 123.0
                },
            ],
            'lookBackPeriodInDays': 123.0,
            'volumeRecommendationOptions': [
                {
                    'configuration': {
                        'volumeType': 'string',
                        'volumeSize': 123,
                        'volumeBaselineIOPS': 123,
                        'volumeBurstIOPS': 123,
                        'volumeBaselineThroughput': 123,
                        'volumeBurstThroughput': 123
                    },
                    'performanceRisk': 123.0,
                    'rank': 123
                },
            ],
            'lastRefreshTimestamp': datetime(2015, 1, 1)
        },
    ],
    'errors': [
        {
            'identifier': 'string',
            'code': 'string',
            'message': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      The token to use to advance to the next page of volume recommendations.

      This value is null when there are no more pages of volume recommendations to return.

    • volumeRecommendations (list) --

      An array of objects that describe volume recommendations.

      • (dict) --

        Describes an Amazon Elastic Block Store (Amazon EBS) volume recommendation.

        • volumeArn (string) --

          The Amazon Resource Name (ARN) of the current volume.

        • accountId (string) --

          The AWS account ID of the volume.

        • currentConfiguration (dict) --

          An array of objects that describe the current configuration of the volume.

          • volumeType (string) --

            The volume type.

            This can be gp2 for General Purpose SSD, io1 or io2 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

          • volumeSize (integer) --

            The size of the volume, in GiB.

          • volumeBaselineIOPS (integer) --

            The baseline IOPS of the volume.

          • volumeBurstIOPS (integer) --

            The burst IOPS of the volume.

          • volumeBaselineThroughput (integer) --

            The baseline throughput of the volume.

          • volumeBurstThroughput (integer) --

            The burst throughput of the volume.

        • finding (string) --

          The finding classification for the volume.

          Findings for volumes include:

          • NotOptimized —A volume is considered not optimized when AWS Compute Optimizer identifies a recommendation that can provide better performance for your workload.

          • Optimized —An volume is considered optimized when Compute Optimizer determines that the volume is correctly provisioned to run your workload based on the chosen volume type. For optimized resources, Compute Optimizer might recommend a new generation volume type.

        • utilizationMetrics (list) --

          An array of objects that describe the utilization metrics of the volume.

          • (dict) --

            Describes a utilization metric of an Amazon Elastic Block Store (Amazon EBS) volume.

            Compare the utilization metric data of your resource against its projected utilization metric data to determine the performance difference between your current resource and the recommended option.

            • name (string) --

              The name of the utilization metric.

              The following utilization metrics are available:

              • VolumeReadOpsPerSecond - The completed read operations per second from the volume in a specified period of time. Unit: Count

              • VolumeWriteOpsPerSecond - The completed write operations per second to the volume in a specified period of time. Unit: Count

              • VolumeReadBytesPerSecond - The bytes read per second from the volume in a specified period of time. Unit: Bytes

              • VolumeWriteBytesPerSecond - The bytes written to the volume in a specified period of time. Unit: Bytes

            • statistic (string) --

              The statistic of the utilization metric.

              The following statistics are available:

              • Average - This is the value of Sum / SampleCount during the specified period, or the average value observed during the specified period.

              • Maximum - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.

            • value (float) --

              The value of the utilization metric.

        • lookBackPeriodInDays (float) --

          The number of days for which utilization metrics were analyzed for the volume.

        • volumeRecommendationOptions (list) --

          An array of objects that describe the recommendation options for the volume.

          • (dict) --

            Describes a recommendation option for an Amazon Elastic Block Store (Amazon EBS) instance.

            • configuration (dict) --

              An array of objects that describe a volume configuration.

              • volumeType (string) --

                The volume type.

                This can be gp2 for General Purpose SSD, io1 or io2 for Provisioned IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard for Magnetic volumes.

              • volumeSize (integer) --

                The size of the volume, in GiB.

              • volumeBaselineIOPS (integer) --

                The baseline IOPS of the volume.

              • volumeBurstIOPS (integer) --

                The burst IOPS of the volume.

              • volumeBaselineThroughput (integer) --

                The baseline throughput of the volume.

              • volumeBurstThroughput (integer) --

                The burst throughput of the volume.

            • performanceRisk (float) --

              The performance risk of the volume recommendation option.

              Performance risk is the likelihood of the recommended volume type not meeting the performance requirement of your workload.

              The lowest performance risk is categorized as 0 , and the highest as 5 .

            • rank (integer) --

              The rank of the volume recommendation option.

              The top recommendation option is ranked as 1 .

        • lastRefreshTimestamp (datetime) --

          The time stamp of when the volume recommendation was last refreshed.

    • errors (list) --

      An array of objects that describe errors of the request.

      For example, an error is returned if you request recommendations for an unsupported volume.

      • (dict) --

        Describes an error experienced when getting recommendations.

        For example, an error is returned if you request recommendations for an unsupported Auto Scaling group, or if you request recommendations for an instance of an unsupported instance family.

        • identifier (string) --

          The ID of the error.

        • code (string) --

          The error code.

        • message (string) --

          The message, or reason, for the error.

GetEC2InstanceRecommendations (updated) Link ¶
Changes (response)
{'instanceRecommendations': {'recommendationSources': {'recommendationSourceType': {'EbsVolume'}}}}

Returns Amazon EC2 instance recommendations.

AWS Compute Optimizer generates recommendations for Amazon Elastic Compute Cloud (Amazon EC2) instances that meet a specific set of requirements. For more information, see the Supported resources and requirements in the AWS Compute Optimizer User Guide .

See also: AWS API Documentation

Request Syntax

client.get_ec2_instance_recommendations(
    instanceArns=[
        'string',
    ],
    nextToken='string',
    maxResults=123,
    filters=[
        {
            'name': 'Finding'|'RecommendationSourceType',
            'values': [
                'string',
            ]
        },
    ],
    accountIds=[
        'string',
    ]
)
type instanceArns

list

param instanceArns

The Amazon Resource Name (ARN) of the instances for which to return recommendations.

  • (string) --

type nextToken

string

param nextToken

The token to advance to the next page of instance recommendations.

type maxResults

integer

param maxResults

The maximum number of instance recommendations to return with a single request.

To retrieve the remaining results, make another request with the returned NextToken value.

type filters

list

param filters

An array of objects that describe a filter that returns a more specific list of instance recommendations.

  • (dict) --

    Describes a filter that returns a more specific list of recommendations.

    This filter is used with the GetAutoScalingGroupRecommendations and GetEC2InstanceRecommendations actions.

    • name (string) --

      The name of the filter.

      Specify Finding to return recommendations with a specific finding classification (e.g., Overprovisioned ).

      Specify RecommendationSourceType to return recommendations of a specific resource type (e.g., AutoScalingGroup ).

    • values (list) --

      The value of the filter.

      The valid values for this parameter are as follows, depending on what you specify for the name parameter and the resource type that you wish to filter results for:

      • Specify Optimized or NotOptimized if you specified the name parameter as Finding and you want to filter results for Auto Scaling groups.

      • Specify Underprovisioned , Overprovisioned , or Optimized if you specified the name parameter as Finding and you want to filter results for EC2 instances.

      • Specify Ec2Instance or AutoScalingGroup if you specified the name parameter as RecommendationSourceType .

      • (string) --

type accountIds

list

param accountIds

The IDs of the AWS accounts for which to return instance recommendations.

If your account is the management account of an organization, use this parameter to specify the member accounts for which you want to return instance recommendations.

Only one account ID can be specified per request.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'nextToken': 'string',
    'instanceRecommendations': [
        {
            'instanceArn': 'string',
            'accountId': 'string',
            'instanceName': 'string',
            'currentInstanceType': 'string',
            'finding': 'Underprovisioned'|'Overprovisioned'|'Optimized'|'NotOptimized',
            'utilizationMetrics': [
                {
                    'name': 'Cpu'|'Memory'|'EBS_READ_OPS_PER_SECOND'|'EBS_WRITE_OPS_PER_SECOND'|'EBS_READ_BYTES_PER_SECOND'|'EBS_WRITE_BYTES_PER_SECOND',
                    'statistic': 'Maximum'|'Average',
                    'value': 123.0
                },
            ],
            'lookBackPeriodInDays': 123.0,
            'recommendationOptions': [
                {
                    'instanceType': 'string',
                    'projectedUtilizationMetrics': [
                        {
                            'name': 'Cpu'|'Memory'|'EBS_READ_OPS_PER_SECOND'|'EBS_WRITE_OPS_PER_SECOND'|'EBS_READ_BYTES_PER_SECOND'|'EBS_WRITE_BYTES_PER_SECOND',
                            'statistic': 'Maximum'|'Average',
                            'value': 123.0
                        },
                    ],
                    'performanceRisk': 123.0,
                    'rank': 123
                },
            ],
            'recommendationSources': [
                {
                    'recommendationSourceArn': 'string',
                    'recommendationSourceType': 'Ec2Instance'|'AutoScalingGroup'|'EbsVolume'
                },
            ],
            'lastRefreshTimestamp': datetime(2015, 1, 1)
        },
    ],
    'errors': [
        {
            'identifier': 'string',
            'code': 'string',
            'message': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      The token to use to advance to the next page of instance recommendations.

      This value is null when there are no more pages of instance recommendations to return.

    • instanceRecommendations (list) --

      An array of objects that describe instance recommendations.

      • (dict) --

        Describes an Amazon EC2 instance recommendation.

        • instanceArn (string) --

          The Amazon Resource Name (ARN) of the current instance.

        • accountId (string) --

          The AWS account ID of the instance.

        • instanceName (string) --

          The name of the current instance.

        • currentInstanceType (string) --

          The instance type of the current instance.

        • finding (string) --

          The finding classification for the instance.

          Findings for instances include:

          • Underprovisioned —An instance is considered under-provisioned when at least one specification of your instance, such as CPU, memory, or network, does not meet the performance requirements of your workload. Under-provisioned instances may lead to poor application performance.

          • Overprovisioned —An instance is considered over-provisioned when at least one specification of your instance, such as CPU, memory, or network, can be sized down while still meeting the performance requirements of your workload, and no specification is under-provisioned. Over-provisioned instances may lead to unnecessary infrastructure cost.

          • Optimized —An instance is considered optimized when all specifications of your instance, such as CPU, memory, and network, meet the performance requirements of your workload and is not over provisioned. An optimized instance runs your workloads with optimal performance and infrastructure cost. For optimized resources, AWS Compute Optimizer might recommend a new generation instance type.

        • utilizationMetrics (list) --

          An array of objects that describe the utilization metrics of the instance.

          • (dict) --

            Describes a utilization metric of a resource, such as an Amazon EC2 instance.

            Compare the utilization metric data of your resource against its projected utilization metric data to determine the performance difference between your current resource and the recommended option.

            • name (string) --

              The name of the utilization metric.

              The following utilization metrics are available:

              • Cpu - The percentage of allocated EC2 compute units that are currently in use on the instance. This metric identifies the processing power required to run an application on the instance. Depending on the instance type, tools in your operating system can show a lower percentage than CloudWatch when the instance is not allocated a full processor core. Units: Percent

              • Memory - The percentage of memory that is currently in use on the instance. This metric identifies the amount of memory required to run an application on the instance. Units: Percent

              Note

              The Memory metric is returned only for resources that have the unified CloudWatch agent installed on them. For more information, see Enabling Memory Utilization with the CloudWatch Agent.

              • EBS_READ_OPS_PER_SECOND - The completed read operations from all EBS volumes attached to the instance in a specified period of time. Unit: Count

              • EBS_WRITE_OPS_PER_SECOND - The completed write operations to all EBS volumes attached to the instance in a specified period of time. Unit: Count

              • EBS_READ_BYTES_PER_SECOND - The bytes read from all EBS volumes attached to the instance in a specified period of time. Unit: Bytes

              • EBS_WRITE_BYTES_PER_SECOND - The bytes written to all EBS volumes attached to the instance in a specified period of time. Unit: Bytes

            • statistic (string) --

              The statistic of the utilization metric.

              The following statistics are available:

              • Average - This is the value of Sum / SampleCount during the specified period, or the average value observed during the specified period.

              • Maximum - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.

            • value (float) --

              The value of the utilization metric.

        • lookBackPeriodInDays (float) --

          The number of days for which utilization metrics were analyzed for the instance.

        • recommendationOptions (list) --

          An array of objects that describe the recommendation options for the instance.

          • (dict) --

            Describes a recommendation option for an Amazon EC2 instance.

            • instanceType (string) --

              The instance type of the instance recommendation.

            • projectedUtilizationMetrics (list) --

              An array of objects that describe the projected utilization metrics of the instance recommendation option.

              Note

              The Cpu and Memory metrics are the only projected utilization metrics returned. Additionally, the Memory metric is returned only for resources that have the unified CloudWatch agent installed on them. For more information, see Enabling Memory Utilization with the CloudWatch Agent.

              • (dict) --

                Describes a utilization metric of a resource, such as an Amazon EC2 instance.

                Compare the utilization metric data of your resource against its projected utilization metric data to determine the performance difference between your current resource and the recommended option.

                • name (string) --

                  The name of the utilization metric.

                  The following utilization metrics are available:

                  • Cpu - The percentage of allocated EC2 compute units that are currently in use on the instance. This metric identifies the processing power required to run an application on the instance. Depending on the instance type, tools in your operating system can show a lower percentage than CloudWatch when the instance is not allocated a full processor core. Units: Percent

                  • Memory - The percentage of memory that is currently in use on the instance. This metric identifies the amount of memory required to run an application on the instance. Units: Percent

                  Note

                  The Memory metric is returned only for resources that have the unified CloudWatch agent installed on them. For more information, see Enabling Memory Utilization with the CloudWatch Agent.

                  • EBS_READ_OPS_PER_SECOND - The completed read operations from all EBS volumes attached to the instance in a specified period of time. Unit: Count

                  • EBS_WRITE_OPS_PER_SECOND - The completed write operations to all EBS volumes attached to the instance in a specified period of time. Unit: Count

                  • EBS_READ_BYTES_PER_SECOND - The bytes read from all EBS volumes attached to the instance in a specified period of time. Unit: Bytes

                  • EBS_WRITE_BYTES_PER_SECOND - The bytes written to all EBS volumes attached to the instance in a specified period of time. Unit: Bytes

                • statistic (string) --

                  The statistic of the utilization metric.

                  The following statistics are available:

                  • Average - This is the value of Sum / SampleCount during the specified period, or the average value observed during the specified period.

                  • Maximum - The highest value observed during the specified period. Use this value to determine high volumes of activity for your application.

                • value (float) --

                  The value of the utilization metric.

            • performanceRisk (float) --

              The performance risk of the instance recommendation option.

              Performance risk is the likelihood of the recommended instance type not meeting the performance requirement of your workload.

              The lowest performance risk is categorized as 0 , and the highest as 5 .

            • rank (integer) --

              The rank of the instance recommendation option.

              The top recommendation option is ranked as 1 .

        • recommendationSources (list) --

          An array of objects that describe the source resource of the recommendation.

          • (dict) --

            Describes the source of a recommendation, such as an Amazon EC2 instance or Auto Scaling group.

            • recommendationSourceArn (string) --

              The Amazon Resource Name (ARN) of the recommendation source.

            • recommendationSourceType (string) --

              The resource type of the recommendation source.

        • lastRefreshTimestamp (datetime) --

          The time stamp of when the instance recommendation was last refreshed.

    • errors (list) --

      An array of objects that describe errors of the request.

      For example, an error is returned if you request recommendations for an instance of an unsupported instance family.

      • (dict) --

        Describes an error experienced when getting recommendations.

        For example, an error is returned if you request recommendations for an unsupported Auto Scaling group, or if you request recommendations for an instance of an unsupported instance family.

        • identifier (string) --

          The ID of the error.

        • code (string) --

          The error code.

        • message (string) --

          The message, or reason, for the error.

GetRecommendationSummaries (updated) Link ¶
Changes (response)
{'recommendationSummaries': {'recommendationResourceType': {'EbsVolume'}}}

Returns the optimization findings for an account.

For example, it returns the number of Amazon EC2 instances in an account that are under-provisioned, over-provisioned, or optimized. It also returns the number of Auto Scaling groups in an account that are not optimized, or optimized.

See also: AWS API Documentation

Request Syntax

client.get_recommendation_summaries(
    accountIds=[
        'string',
    ],
    nextToken='string',
    maxResults=123
)
type accountIds

list

param accountIds

The IDs of the AWS accounts for which to return recommendation summaries.

If your account is the management account of an organization, use this parameter to specify the member accounts for which you want to return recommendation summaries.

Only one account ID can be specified per request.

  • (string) --

type nextToken

string

param nextToken

The token to advance to the next page of recommendation summaries.

type maxResults

integer

param maxResults

The maximum number of recommendation summaries to return with a single request.

To retrieve the remaining results, make another request with the returned NextToken value.

rtype

dict

returns

Response Syntax

{
    'nextToken': 'string',
    'recommendationSummaries': [
        {
            'summaries': [
                {
                    'name': 'Underprovisioned'|'Overprovisioned'|'Optimized'|'NotOptimized',
                    'value': 123.0
                },
            ],
            'recommendationResourceType': 'Ec2Instance'|'AutoScalingGroup'|'EbsVolume',
            'accountId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      The token to use to advance to the next page of recommendation summaries.

      This value is null when there are no more pages of recommendation summaries to return.

    • recommendationSummaries (list) --

      An array of objects that summarize a recommendation.

      • (dict) --

        A summary of a recommendation.

        • summaries (list) --

          An array of objects that describe a recommendation summary.

          • (dict) --

            The summary of a recommendation.

            • name (string) --

              The finding classification of the recommendation.

            • value (float) --

              The value of the recommendation summary.

        • recommendationResourceType (string) --

          The resource type of the recommendation.

        • accountId (string) --

          The AWS account ID of the recommendation summary.