[ aws . compute-optimizer ]

get-lambda-function-recommendations

Description

Returns AWS Lambda function recommendations.

AWS Compute Optimizer generates recommendations for functions 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

See ‘aws help’ for descriptions of global parameters.

Synopsis

  get-lambda-function-recommendations
[--function-arns <value>]
[--account-ids <value>]
[--filters <value>]
[--next-token <value>]
[--max-results <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]

Options

--function-arns (list)

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

You can specify a qualified or unqualified ARN. If you specify an unqualified ARN without a function version suffix, Compute Optimizer will return recommendations for the latest ($LATEST ) version of the function. If you specify a qualified ARN with a version suffix, Compute Optimizer will return recommendations for the specified function version. For more information about using function versions, see Using versions in the AWS Lambda Developer Guide .

(string)

Syntax:

"string" "string" ...

--account-ids (list)

The IDs of the AWS accounts for which to return function 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 function recommendations.

Only one account ID can be specified per request.

(string)

Syntax:

"string" "string" ...

--filters (list)

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

(structure)

Describes a filter that returns a more specific list of AWS Lambda function recommendations.

name -> (string)

The name of the filter.

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

Specify FindingReasonCode to return recommendations with a specific finding reason code (e.g., MemoryUnderprovisioned ).

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:

  • Specify Optimized , NotOptimized , or Unavailable if you specified the name parameter as Finding .

  • Specify MemoryOverprovisioned , MemoryUnderprovisioned , InsufficientData , or Inconclusive if you specified the name parameter as FindingReasonCode .

(string)

Shorthand Syntax:

name=string,values=string,string ...

JSON Syntax:

[
  {
    "name": "Finding"|"FindingReasonCode",
    "values": ["string", ...]
  }
  ...
]

--next-token (string)

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

--max-results (integer)

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

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

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See ‘aws help’ for descriptions of global parameters.

Output

nextToken -> (string)

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

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

lambdaFunctionRecommendations -> (list)

An array of objects that describe function recommendations.

(structure)

Describes an AWS Lambda function recommendation.

functionArn -> (string)

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

functionVersion -> (string)

The version number of the current function.

accountId -> (string)

The AWS account ID of the function.

currentMemorySize -> (integer)

The amount of memory, in MB, that’s allocated to the current function.

numberOfInvocations -> (long)

The number of times your function code was executed during the look-back period.

utilizationMetrics -> (list)

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

(structure)

Describes a utilization metric of an AWS Lambda function.

name -> (string)

The name of the utilization metric.

statistic -> (string)

The statistic of the utilization metric.

value -> (double)

The value of the utilization metric.

lookbackPeriodInDays -> (double)

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

lastRefreshTimestamp -> (timestamp)

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

finding -> (string)

The finding classification for the function.

Findings for functions include:

  • **Optimized ** — The function is correctly provisioned to run your workload based on its current configuration and its utilization history. This finding classification does not include finding reason codes.

  • **NotOptimized ** — The function is performing at a higher level (over-provisioned) or at a lower level (under-provisioned) than required for your workload because its current configuration is not optimal. Over-provisioned resources might lead to unnecessary infrastructure cost, and under-provisioned resources might lead to poor application performance. This finding classification can include the MemoryUnderprovisioned and MemoryUnderprovisioned finding reason codes.

  • **Unavailable ** — Compute Optimizer was unable to generate a recommendation for the function. This could be because the function has not accumulated sufficient metric data, or the function does not qualify for a recommendation. This finding classification can include the InsufficientData and Inconclusive finding reason codes.

Note

Functions with a finding of unavailable are not returned unless you specify the filter parameter with a value of Unavailable in your GetLambdaFunctionRecommendations request.

findingReasonCodes -> (list)

The reason for the finding classification of the function.

Note

Functions that have a finding classification of Optimized don’t have a finding reason code.

Reason codes include:

  • **MemoryOverprovisioned ** — The function is over-provisioned when its memory configuration can be sized down while still meeting the performance requirements of your workload. An over-provisioned function might lead to unnecessary infrastructure cost. This finding reason code is part of the NotOptimized finding classification.

  • **MemoryUnderprovisioned ** — The function is under-provisioned when its memory configuration doesn’t meet the performance requirements of the workload. An under-provisioned function might lead to poor application performance. This finding reason code is part of the NotOptimized finding classification.

  • **InsufficientData ** — The function does not have sufficient metric data for Compute Optimizer to generate a recommendation. For more information, see the Supported resources and requirements in the AWS Compute Optimizer User Guide . This finding reason code is part of the Unavailable finding classification.

  • **Inconclusive ** — The function does not qualify for a recommendation, or there was an internal error. This finding reason code is part of the Unavailable finding classification.

(string)

memorySizeRecommendationOptions -> (list)

An array of objects that describe the memory configuration recommendation options for the function.

(structure)

Describes a recommendation option for an AWS Lambda function.

rank -> (integer)

The rank of the function recommendation option.

The top recommendation option is ranked as 1 .

memorySize -> (integer)

The memory size, in MB, of the function recommendation option.

projectedUtilizationMetrics -> (list)

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

(structure)

Describes a projected utilization metric of an AWS Lambda function recommendation option.

name -> (string)

The name of the projected utilization metric.

statistic -> (string)

The statistic of the projected utilization metric.

value -> (double)

The values of the projected utilization metrics.