Class: Aws::Lambda::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb

Overview

An API client for Lambda. To construct a client, you need to configure a :region and :credentials.

client = Aws::Lambda::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

For details on configuring region and credentials see the developer guide.

See #initialize for a full list of supported configuration options.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#api_requests, #stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :credentials (required, Aws::CredentialProvider)

    Your AWS credentials. This can be an instance of any one of the following classes:

    • Aws::Credentials - Used for configuring static, non-refreshing credentials.

    • Aws::SharedCredentials - Used for loading static credentials from a shared file, such as ~/.aws/config.

    • Aws::AssumeRoleCredentials - Used when you need to assume a role.

    • Aws::AssumeRoleWebIdentityCredentials - Used when you need to assume a role after providing credentials via the web.

    • Aws::SSOCredentials - Used for loading credentials from AWS SSO using an access token generated from aws login.

    • Aws::ProcessCredentials - Used for loading credentials from a process that outputs to stdout.

    • Aws::InstanceProfileCredentials - Used for loading credentials from an EC2 IMDS on an EC2 instance.

    • Aws::ECSCredentials - Used for loading credentials from instances running in ECS.

    • Aws::CognitoIdentityCredentials - Used for loading credentials from the Cognito Identity service.

    When :credentials are not configured directly, the following locations will be searched for credentials:

    • Aws.config[:credentials]
    • The :access_key_id, :secret_access_key, and :session_token options.
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • ~/.aws/credentials
    • ~/.aws/config
    • EC2/ECS IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of Aws::InstanceProfileCredentails or Aws::ECSCredentials to enable retries and extended timeouts. Instance profile credential fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED'] to true.
  • :region (required, String)

    The AWS region to connect to. The configured :region is used to determine the service :endpoint. When not passed, a default :region is searched for in the following locations:

    • Aws.config[:region]
    • ENV['AWS_REGION']
    • ENV['AMAZON_REGION']
    • ENV['AWS_DEFAULT_REGION']
    • ~/.aws/credentials
    • ~/.aws/config
  • :access_key_id (String)
  • :active_endpoint_cache (Boolean) — default: false

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false.

  • :adaptive_retry_wait_to_fill (Boolean) — default: true

    Used only in adaptive retry mode. When true, the request will sleep until there is sufficent client side capacity to retry the request. When false, the request will raise a RetryCapacityNotAvailableError and will not retry instead of sleeping.

  • :client_side_monitoring (Boolean) — default: false

    When true, client-side metrics will be collected for all API requests from this client.

  • :client_side_monitoring_client_id (String) — default: ""

    Allows you to provide an identifier for this client which will be attached to all generated client side metrics. Defaults to an empty string.

  • :client_side_monitoring_host (String) — default: "127.0.0.1"

    Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_port (Integer) — default: 31000

    Required for publishing client metrics. The port that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) — default: Aws::ClientSideMonitoring::Publisher

    Allows you to provide a custom client-side monitoring publisher class. By default, will use the Client Side Monitoring Agent Publisher.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types.

  • :correct_clock_skew (Boolean) — default: true

    Used only in standard and adaptive retry modes. Specifies whether to apply a clock skew correction and retry requests with skewed client clocks.

  • :defaults_mode (String) — default: "legacy"

    See DefaultsModeConfiguration for a list of the accepted modes and the configuration defaults that are included.

  • :disable_host_prefix_injection (Boolean) — default: false

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available.

  • :disable_request_compression (Boolean) — default: false

    When set to 'true' the request body will not be compressed for supported operations.

  • :endpoint (String)

    The client endpoint is normally constructed from the :region option. You should only configure an :endpoint when connecting to test or custom endpoints. This should be a valid HTTP(S) URI.

  • :endpoint_cache_max_entries (Integer) — default: 1000

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000.

  • :endpoint_cache_max_threads (Integer) — default: 10

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.

  • :endpoint_cache_poll_interval (Integer) — default: 60

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec.

  • :endpoint_discovery (Boolean) — default: false

    When set to true, endpoint discovery will be enabled for operations when available.

  • :event_stream_handler (Proc)

    When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way.

  • :ignore_configured_endpoint_urls (Boolean)

    Setting to true disables use of endpoint URLs provided via environment variables and the shared configuration file.

  • :input_event_stream_handler (Proc)

    When an EventStream or Proc object is provided, it can be used for sending events for the event stream.

  • :log_formatter (Aws::Log::Formatter) — default: Aws::Log::Formatter.default

    The log formatter.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the :logger at.

  • :logger (Logger)

    The Logger instance to send log messages to. If this option is not set, logging will be disabled.

  • :max_attempts (Integer) — default: 3

    An integer representing the maximum number attempts that will be made for a single request, including the initial attempt. For example, setting this value to 5 will result in a request being retried up to 4 times. Used in standard and adaptive retry modes.

  • :output_event_stream_handler (Proc)

    When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way.

  • :profile (String) — default: "default"

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used.

  • :request_min_compression_size_bytes (Integer) — default: 10240

    The minimum size in bytes that triggers compression for request bodies. The value must be non-negative integer value between 0 and 10485780 bytes inclusive.

  • :retry_backoff (Proc)

    A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. This option is only used in the legacy retry mode.

  • :retry_base_delay (Float) — default: 0.3

    The base delay in seconds used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_jitter (Symbol) — default: :none

    A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number. This option is only used in the legacy retry mode.

    @see https://www.awsarchitectureblog.com/2015/03/backoff.html

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors, auth errors, endpoint discovery, and errors from expired credentials. This option is only used in the legacy retry mode.

  • :retry_max_delay (Integer) — default: 0

    The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_mode (String) — default: "legacy"

    Specifies which retry algorithm to use. Values are:

    • legacy - The pre-existing retry behavior. This is default value if no retry mode is provided.

    • standard - A standardized set of retry rules across the AWS SDKs. This includes support for retry quotas, which limit the number of unsuccessful retries a client can make.

    • adaptive - An experimental retry mode that includes all the functionality of standard mode along with automatic client side throttling. This is a provisional mode that may change behavior in the future.

  • :sdk_ua_app_id (String)

    A unique and opaque application ID that is appended to the User-Agent header as app/. It should have a maximum length of 50.

  • :secret_access_key (String)
  • :session_token (String)
  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled.

  • :token_provider (Aws::TokenProvider)

    A Bearer Token Provider. This can be an instance of any one of the following classes:

    • Aws::StaticTokenProvider - Used for configuring static, non-refreshing tokens.

    • Aws::SSOTokenProvider - Used for loading tokens from AWS SSO using an access token generated from aws login.

    When :token_provider is not configured directly, the Aws::TokenProviderChain will be used to search for tokens configured for your profile in shared configuration files.

  • :use_dualstack_endpoint (Boolean)

    When set to true, dualstack enabled endpoints (with .aws TLD) will be used if available.

  • :use_fips_endpoint (Boolean)

    When set to true, fips compatible endpoints will be used if available. When a fips region is used, the region is normalized and this config is set to true.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request.

  • :endpoint_provider (Aws::Lambda::EndpointProvider)

    The endpoint provider used to resolve endpoints. Any object that responds to #resolve_endpoint(parameters) where parameters is a Struct similar to Aws::Lambda::EndpointParameters

  • :http_proxy (URI::HTTP, String)

    A proxy to send requests through. Formatted like 'http://proxy.com:123'.

  • :http_open_timeout (Float) — default: 15

    The number of seconds to wait when opening a HTTP session before raising a Timeout::Error.

  • :http_read_timeout (Float) — default: 60

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_idle_timeout (Float) — default: 5

    The number of seconds a connection is allowed to sit idle before it is considered stale. Stale connections are closed and removed from the pool before making a request.

  • :http_continue_timeout (Float) — default: 1

    The number of seconds to wait for a 100-continue response before sending the request body. This option has no effect unless the request has "Expect" header set to "100-continue". Defaults to nil which disables this behaviour. This value can safely be set per request on the session.

  • :ssl_timeout (Float) — default: nil

    Sets the SSL timeout in seconds.

  • :http_wire_trace (Boolean) — default: false

    When true, HTTP debug output will be sent to the :logger.

  • :ssl_verify_peer (Boolean) — default: true

    When true, SSL peer certificates are verified when establishing a connection.

  • :ssl_ca_bundle (String)

    Full path to the SSL certificate authority bundle file that should be used when verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_directory (String)

    Full path of the directory that contains the unbundled SSL certificate authority files for verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.



396
397
398
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 396

def initialize(*args)
  super
end

Instance Method Details

#add_layer_version_permission(params = {}) ⇒ Types::AddLayerVersionPermissionResponse

Adds permissions to the resource-based policy of a version of an Lambda layer. Use this action to grant layer usage permission to other accounts. You can grant permission to a single account, all accounts in an organization, or all Amazon Web Services accounts.

To revoke permission, call RemoveLayerVersionPermission with the statement ID that you specified when you added it.

Examples:

Request syntax with placeholder values


resp = client.add_layer_version_permission({
  layer_name: "LayerName", # required
  version_number: 1, # required
  statement_id: "StatementId", # required
  action: "LayerPermissionAllowedAction", # required
  principal: "LayerPermissionAllowedPrincipal", # required
  organization_id: "OrganizationId",
  revision_id: "String",
})

Response structure


resp.statement #=> String
resp.revision_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :layer_name (required, String)

    The name or Amazon Resource Name (ARN) of the layer.

  • :version_number (required, Integer)

    The version number.

  • :statement_id (required, String)

    An identifier that distinguishes the policy from others on the same layer version.

  • :action (required, String)

    The API action that grants access to the layer. For example, lambda:GetLayerVersion.

  • :principal (required, String)

    An account ID, or * to grant layer usage permission to all accounts in an organization, or all Amazon Web Services accounts (if organizationId is not specified). For the last case, make sure that you really do want all Amazon Web Services accounts to have usage permission to this layer.

  • :organization_id (String)

    With the principal set to *, grant permission to all accounts in the specified organization.

  • :revision_id (String)

    Only update the policy if the revision ID matches the ID specified. Use this option to avoid modifying a policy that has changed since you last read it.

Returns:

See Also:



470
471
472
473
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 470

def add_layer_version_permission(params = {}, options = {})
  req = build_request(:add_layer_version_permission, params)
  req.send_request(options)
end

#add_permission(params = {}) ⇒ Types::AddPermissionResponse

Grants an Amazon Web Service, Amazon Web Services account, or Amazon Web Services organization permission to use a function. You can apply the policy at the function level, or specify a qualifier to restrict access to a single version or alias. If you use a qualifier, the invoker must use the full Amazon Resource Name (ARN) of that version or alias to invoke the function. Note: Lambda does not support adding policies to version $LATEST.

To grant permission to another account, specify the account ID as the Principal. To grant permission to an organization defined in Organizations, specify the organization ID as the PrincipalOrgID. For Amazon Web Services, the principal is a domain-style identifier that the service defines, such as s3.amazonaws.com or sns.amazonaws.com. For Amazon Web Services, you can also specify the ARN of the associated resource as the SourceArn. If you grant permission to a service principal without specifying the source, other accounts could potentially configure resources in their account to invoke your Lambda function.

This operation adds a statement to a resource-based permissions policy for the function. For more information about function policies, see Using resource-based policies for Lambda.

Examples:

Request syntax with placeholder values


resp = client.add_permission({
  function_name: "FunctionName", # required
  statement_id: "StatementId", # required
  action: "Action", # required
  principal: "Principal", # required
  source_arn: "Arn",
  source_account: "SourceOwner",
  event_source_token: "EventSourceToken",
  qualifier: "Qualifier",
  revision_id: "String",
  principal_org_id: "PrincipalOrgID",
  function_url_auth_type: "NONE", # accepts NONE, AWS_IAM
})

Response structure


resp.statement #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function, version, or alias.

    Name formats

    • Function namemy-function (name-only), my-function:v1 (with alias).

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :statement_id (required, String)

    A statement identifier that differentiates the statement from others in the same policy.

  • :action (required, String)

    The action that the principal can use on the function. For example, lambda:InvokeFunction or lambda:GetFunction.

  • :principal (required, String)

    The Amazon Web Service or Amazon Web Services account that invokes the function. If you specify a service, use SourceArn or SourceAccount to limit who can invoke the function through that service.

  • :source_arn (String)

    For Amazon Web Services, the ARN of the Amazon Web Services resource that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic.

    Note that Lambda configures the comparison using the StringLike operator.

  • :source_account (String)

    For Amazon Web Service, the ID of the Amazon Web Services account that owns the resource. Use this together with SourceArn to ensure that the specified account owns the resource. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account.

  • :event_source_token (String)

    For Alexa Smart Home functions, a token that the invoker must supply.

  • :qualifier (String)

    Specify a version or alias to add permissions to a published version of the function.

  • :revision_id (String)

    Update the policy only if the revision ID matches the ID that's specified. Use this option to avoid modifying a policy that has changed since you last read it.

  • :principal_org_id (String)

    The identifier for your organization in Organizations. Use this to grant permissions to all the Amazon Web Services accounts under this organization.

  • :function_url_auth_type (String)

    The type of authentication that your function URL uses. Set to AWS_IAM if you want to restrict access to authenticated users only. Set to NONE if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs.

Returns:

See Also:



602
603
604
605
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 602

def add_permission(params = {}, options = {})
  req = build_request(:add_permission, params)
  req.send_request(options)
end

#create_alias(params = {}) ⇒ Types::AliasConfiguration

Creates an alias for a Lambda function version. Use aliases to provide clients with a function identifier that you can update to invoke a different version.

You can also map an alias to split invocation requests between two versions. Use the RoutingConfig parameter to specify a second version and the percentage of invocation requests that it receives.

Examples:

Request syntax with placeholder values


resp = client.create_alias({
  function_name: "FunctionName", # required
  name: "Alias", # required
  function_version: "Version", # required
  description: "Description",
  routing_config: {
    additional_version_weights: {
      "AdditionalVersion" => 1.0,
    },
  },
})

Response structure


resp.alias_arn #=> String
resp.name #=> String
resp.function_version #=> String
resp.description #=> String
resp.routing_config.additional_version_weights #=> Hash
resp.routing_config.additional_version_weights["AdditionalVersion"] #=> Float
resp.revision_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function name - MyFunction.

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Partial ARN - 123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :name (required, String)

    The name of the alias.

  • :function_version (required, String)

    The function version that the alias invokes.

  • :description (String)

    A description of the alias.

  • :routing_config (Types::AliasRoutingConfiguration)

    The routing configuration of the alias.

Returns:

See Also:



687
688
689
690
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 687

def create_alias(params = {}, options = {})
  req = build_request(:create_alias, params)
  req.send_request(options)
end

#create_code_signing_config(params = {}) ⇒ Types::CreateCodeSigningConfigResponse

Creates a code signing configuration. A code signing configuration defines a list of allowed signing profiles and defines the code-signing validation policy (action to be taken if deployment validation checks fail).

Examples:

Request syntax with placeholder values


resp = client.create_code_signing_config({
  description: "Description",
  allowed_publishers: { # required
    signing_profile_version_arns: ["Arn"], # required
  },
  code_signing_policies: {
    untrusted_artifact_on_deployment: "Warn", # accepts Warn, Enforce
  },
})

Response structure


resp.code_signing_config.code_signing_config_id #=> String
resp.code_signing_config.code_signing_config_arn #=> String
resp.code_signing_config.description #=> String
resp.code_signing_config.allowed_publishers.signing_profile_version_arns #=> Array
resp.code_signing_config.allowed_publishers.signing_profile_version_arns[0] #=> String
resp.code_signing_config.code_signing_policies.untrusted_artifact_on_deployment #=> String, one of "Warn", "Enforce"
resp.code_signing_config.last_modified #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :description (String)

    Descriptive name for this code signing configuration.

  • :allowed_publishers (required, Types::AllowedPublishers)

    Signing profiles for this code signing configuration.

  • :code_signing_policies (Types::CodeSigningPolicies)

    The code signing policies define the actions to take if the validation checks fail.

Returns:

See Also:



741
742
743
744
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 741

def create_code_signing_config(params = {}, options = {})
  req = build_request(:create_code_signing_config, params)
  req.send_request(options)
end

#create_event_source_mapping(params = {}) ⇒ Types::EventSourceMappingConfiguration

Creates a mapping between an event source and an Lambda function. Lambda reads items from the event source and invokes the function.

For details about how to configure different event sources, see the following topics.

The following error handling options are available only for stream sources (DynamoDB and Kinesis):

  • BisectBatchOnFunctionError – If the function returns an error, split the batch in two and retry.

  • DestinationConfig – Send discarded records to an Amazon SQS queue or Amazon SNS topic.

  • MaximumRecordAgeInSeconds – Discard records older than the specified age. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires

  • MaximumRetryAttempts – Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires.

  • ParallelizationFactor – Process multiple batches from each shard concurrently.

For information about which configuration parameters apply to each event source, see the following topics.

Examples:

Request syntax with placeholder values


resp = client.create_event_source_mapping({
  event_source_arn: "Arn",
  function_name: "FunctionName", # required
  enabled: false,
  batch_size: 1,
  filter_criteria: {
    filters: [
      {
        pattern: "Pattern",
      },
    ],
  },
  maximum_batching_window_in_seconds: 1,
  parallelization_factor: 1,
  starting_position: "TRIM_HORIZON", # accepts TRIM_HORIZON, LATEST, AT_TIMESTAMP
  starting_position_timestamp: Time.now,
  destination_config: {
    on_success: {
      destination: "DestinationArn",
    },
    on_failure: {
      destination: "DestinationArn",
    },
  },
  maximum_record_age_in_seconds: 1,
  bisect_batch_on_function_error: false,
  maximum_retry_attempts: 1,
  tumbling_window_in_seconds: 1,
  topics: ["Topic"],
  queues: ["Queue"],
  source_access_configurations: [
    {
      type: "BASIC_AUTH", # accepts BASIC_AUTH, VPC_SUBNET, VPC_SECURITY_GROUP, SASL_SCRAM_512_AUTH, SASL_SCRAM_256_AUTH, VIRTUAL_HOST, CLIENT_CERTIFICATE_TLS_AUTH, SERVER_ROOT_CA_CERTIFICATE
      uri: "URI",
    },
  ],
  self_managed_event_source: {
    endpoints: {
      "KAFKA_BOOTSTRAP_SERVERS" => ["Endpoint"],
    },
  },
  function_response_types: ["ReportBatchItemFailures"], # accepts ReportBatchItemFailures
  amazon_managed_kafka_event_source_config: {
    consumer_group_id: "URI",
  },
  self_managed_kafka_event_source_config: {
    consumer_group_id: "URI",
  },
  scaling_config: {
    maximum_concurrency: 1,
  },
  document_db_event_source_config: {
    database_name: "DatabaseName",
    collection_name: "CollectionName",
    full_document: "UpdateLookup", # accepts UpdateLookup, Default
  },
})

Response structure


resp.uuid #=> String
resp.starting_position #=> String, one of "TRIM_HORIZON", "LATEST", "AT_TIMESTAMP"
resp.starting_position_timestamp #=> Time
resp.batch_size #=> Integer
resp.maximum_batching_window_in_seconds #=> Integer
resp.parallelization_factor #=> Integer
resp.event_source_arn #=> String
resp.filter_criteria.filters #=> Array
resp.filter_criteria.filters[0].pattern #=> String
resp.function_arn #=> String
resp.last_modified #=> Time
resp.last_processing_result #=> String
resp.state #=> String
resp.state_transition_reason #=> String
resp.destination_config.on_success.destination #=> String
resp.destination_config.on_failure.destination #=> String
resp.topics #=> Array
resp.topics[0] #=> String
resp.queues #=> Array
resp.queues[0] #=> String
resp.source_access_configurations #=> Array
resp.source_access_configurations[0].type #=> String, one of "BASIC_AUTH", "VPC_SUBNET", "VPC_SECURITY_GROUP", "SASL_SCRAM_512_AUTH", "SASL_SCRAM_256_AUTH", "VIRTUAL_HOST", "CLIENT_CERTIFICATE_TLS_AUTH", "SERVER_ROOT_CA_CERTIFICATE"
resp.source_access_configurations[0].uri #=> String
resp.self_managed_event_source.endpoints #=> Hash
resp.self_managed_event_source.endpoints["EndPointType"] #=> Array
resp.self_managed_event_source.endpoints["EndPointType"][0] #=> String
resp.maximum_record_age_in_seconds #=> Integer
resp.bisect_batch_on_function_error #=> Boolean
resp.maximum_retry_attempts #=> Integer
resp.tumbling_window_in_seconds #=> Integer
resp.function_response_types #=> Array
resp.function_response_types[0] #=> String, one of "ReportBatchItemFailures"
resp.amazon_managed_kafka_event_source_config.consumer_group_id #=> String
resp.self_managed_kafka_event_source_config.consumer_group_id #=> String
resp.scaling_config.maximum_concurrency #=> Integer
resp.document_db_event_source_config.database_name #=> String
resp.document_db_event_source_config.collection_name #=> String
resp.document_db_event_source_config.full_document #=> String, one of "UpdateLookup", "Default"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :event_source_arn (String)

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

    • Amazon Kinesis – The ARN of the data stream or a stream consumer.

    • Amazon DynamoDB Streams – The ARN of the stream.

    • Amazon Simple Queue Service – The ARN of the queue.

    • Amazon Managed Streaming for Apache Kafka – The ARN of the cluster or the ARN of the VPC connection (for cross-account event source mappings).

    • Amazon MQ – The ARN of the broker.

    • Amazon DocumentDB – The ARN of the DocumentDB change stream.

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function nameMyFunction.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Version or Alias ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD.

    • Partial ARN123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.

  • :enabled (Boolean)

    When true, the event source mapping is active. When false, Lambda pauses polling and invocation.

    Default: True

  • :batch_size (Integer)

    The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).

    • Amazon Kinesis – Default 100. Max 10,000.

    • Amazon DynamoDB Streams – Default 100. Max 10,000.

    • Amazon Simple Queue Service – Default 10. For standard queues the max is 10,000. For FIFO queues the max is 10.

    • Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000.

    • Self-managed Apache Kafka – Default 100. Max 10,000.

    • Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000.

    • DocumentDB – Default 100. Max 10,000.

  • :filter_criteria (Types::FilterCriteria)

    An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see Lambda event filtering.

  • :maximum_batching_window_in_seconds (Integer)

    The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure MaximumBatchingWindowInSeconds to any value from 0 seconds to 300 seconds in increments of seconds.

    For streams and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is 500 ms. Note that because you can only change MaximumBatchingWindowInSeconds in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. To restore the default batching window, you must create a new event source mapping.

    Related setting: For streams and Amazon SQS event sources, when you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

  • :parallelization_factor (Integer) — default: Kinesis and DynamoDB Streams only

    The number of batches to process from each shard concurrently.

  • :starting_position (String)

    The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Stream event sources. AT_TIMESTAMP is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed Apache Kafka.

  • :starting_position_timestamp (Time, DateTime, Date, Integer, String)

    With StartingPosition set to AT_TIMESTAMP, the time from which to start reading. StartingPositionTimestamp cannot be in the future.

  • :destination_config (Types::DestinationConfig) — default: Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Kafka only

    A configuration object that specifies the destination of an event after Lambda processes it.

  • :maximum_record_age_in_seconds (Integer) — default: Kinesis and DynamoDB Streams only

    Discard records older than the specified age. The default value is infinite (-1).

  • :bisect_batch_on_function_error (Boolean) — default: Kinesis and DynamoDB Streams only

    If the function returns an error, split the batch in two and retry.

  • :maximum_retry_attempts (Integer) — default: Kinesis and DynamoDB Streams only

    Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires.

  • :tumbling_window_in_seconds (Integer) — default: Kinesis and DynamoDB Streams only

    The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window.

  • :topics (Array<String>)

    The name of the Kafka topic.

  • :queues (Array<String>) — default: MQ

    The name of the Amazon MQ broker destination queue to consume.

  • :source_access_configurations (Array<Types::SourceAccessConfiguration>)

    An array of authentication protocols or VPC components required to secure your event source.

  • :self_managed_event_source (Types::SelfManagedEventSource)

    The self-managed Apache Kafka cluster to receive records from.

  • :function_response_types (Array<String>) — default: Kinesis, DynamoDB Streams, and Amazon SQS

    A list of current response type enums applied to the event source mapping.

  • :amazon_managed_kafka_event_source_config (Types::AmazonManagedKafkaEventSourceConfig)

    Specific configuration settings for an Amazon Managed Streaming for Apache Kafka (Amazon MSK) event source.

  • :self_managed_kafka_event_source_config (Types::SelfManagedKafkaEventSourceConfig)

    Specific configuration settings for a self-managed Apache Kafka event source.

  • :scaling_config (Types::ScalingConfig) — default: Amazon SQS only

    The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources.

  • :document_db_event_source_config (Types::DocumentDBEventSourceConfig)

    Specific configuration settings for a DocumentDB event source.

Returns:

See Also:



1125
1126
1127
1128
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 1125

def create_event_source_mapping(params = {}, options = {})
  req = build_request(:create_event_source_mapping, params)
  req.send_request(options)
end

#create_function(params = {}) ⇒ Types::FunctionConfiguration

Creates a Lambda function. To create a function, you need a deployment package and an execution role. The deployment package is a .zip file archive or container image that contains your function code. The execution role grants the function permission to use Amazon Web Services, such as Amazon CloudWatch Logs for log streaming and X-Ray for request tracing.

If the deployment package is a container image, then you set the package type to Image. For a container image, the code property must include the URI of a container image in the Amazon ECR registry. You do not need to specify the handler and runtime properties.

If the deployment package is a .zip file archive, then you set the package type to Zip. For a .zip file archive, the code property specifies the location of the .zip file. You must also specify the handler and runtime properties. The code in the deployment package must be compatible with the target instruction set architecture of the function (x86-64 or arm64). If you do not specify the architecture, then the default value is x86-64.

When you create a function, Lambda provisions an instance of the function and its supporting resources. If your function connects to a VPC, this process can take a minute or so. During this time, you can't invoke or modify the function. The State, StateReason, and StateReasonCode fields in the response from GetFunctionConfiguration indicate when the function is ready to invoke. For more information, see Lambda function states.

A function has an unpublished version, and can have published versions and aliases. The unpublished version changes when you update your function's code and configuration. A published version is a snapshot of your function code and configuration that can't be changed. An alias is a named resource that maps to a version, and can be changed to map to a different version. Use the Publish parameter to create version 1 of your function from its initial configuration.

The other parameters let you configure version-specific and function-level settings. You can modify version-specific settings later with UpdateFunctionConfiguration. Function-level settings apply to both the unpublished and published versions of the function, and include tags (TagResource) and per-function concurrency limits (PutFunctionConcurrency).

You can use code signing if your deployment package is a .zip file archive. To enable code signing for this function, specify the ARN of a code-signing configuration. When a user attempts to deploy a code package with UpdateFunctionCode, Lambda checks that the code package has a valid signature from a trusted publisher. The code-signing configuration includes set of signing profiles, which define the trusted publishers for this function.

If another Amazon Web Services account or an Amazon Web Service invokes your function, use AddPermission to grant permission by creating a resource-based Identity and Access Management (IAM) policy. You can grant permissions at the function level, on a version, or on an alias.

To invoke your function directly, use Invoke. To invoke your function in response to events in other Amazon Web Services, create an event source mapping (CreateEventSourceMapping), or configure a function trigger in the other service. For more information, see Invoking Lambda functions.

Examples:

Request syntax with placeholder values


resp = client.create_function({
  function_name: "FunctionName", # required
  runtime: "nodejs", # accepts nodejs, nodejs4.3, nodejs6.10, nodejs8.10, nodejs10.x, nodejs12.x, nodejs14.x, nodejs16.x, java8, java8.al2, java11, python2.7, python3.6, python3.7, python3.8, python3.9, dotnetcore1.0, dotnetcore2.0, dotnetcore2.1, dotnetcore3.1, dotnet6, dotnet8, nodejs4.3-edge, go1.x, ruby2.5, ruby2.7, provided, provided.al2, nodejs18.x, python3.10, java17, ruby3.2, python3.11, nodejs20.x, provided.al2023, python3.12, java21
  role: "RoleArn", # required
  handler: "Handler",
  code: { # required
    zip_file: "data",
    s3_bucket: "S3Bucket",
    s3_key: "S3Key",
    s3_object_version: "S3ObjectVersion",
    image_uri: "String",
  },
  description: "Description",
  timeout: 1,
  memory_size: 1,
  publish: false,
  vpc_config: {
    subnet_ids: ["SubnetId"],
    security_group_ids: ["SecurityGroupId"],
    ipv_6_allowed_for_dual_stack: false,
  },
  package_type: "Zip", # accepts Zip, Image
  dead_letter_config: {
    target_arn: "ResourceArn",
  },
  environment: {
    variables: {
      "EnvironmentVariableName" => "EnvironmentVariableValue",
    },
  },
  kms_key_arn: "KMSKeyArn",
  tracing_config: {
    mode: "Active", # accepts Active, PassThrough
  },
  tags: {
    "TagKey" => "TagValue",
  },
  layers: ["LayerVersionArn"],
  file_system_configs: [
    {
      arn: "FileSystemArn", # required
      local_mount_path: "LocalMountPath", # required
    },
  ],
  image_config: {
    entry_point: ["String"],
    command: ["String"],
    working_directory: "WorkingDirectory",
  },
  code_signing_config_arn: "CodeSigningConfigArn",
  architectures: ["x86_64"], # accepts x86_64, arm64
  ephemeral_storage: {
    size: 1, # required
  },
  snap_start: {
    apply_on: "PublishedVersions", # accepts PublishedVersions, None
  },
  logging_config: {
    log_format: "JSON", # accepts JSON, Text
    application_log_level: "TRACE", # accepts TRACE, DEBUG, INFO, WARN, ERROR, FATAL
    system_log_level: "DEBUG", # accepts DEBUG, INFO, WARN
    log_group: "LogGroup",
  },
})

Response structure


resp.function_name #=> String
resp.function_arn #=> String
resp.runtime #=> String, one of "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "nodejs10.x", "nodejs12.x", "nodejs14.x", "nodejs16.x", "java8", "java8.al2", "java11", "python2.7", "python3.6", "python3.7", "python3.8", "python3.9", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "dotnet6", "dotnet8", "nodejs4.3-edge", "go1.x", "ruby2.5", "ruby2.7", "provided", "provided.al2", "nodejs18.x", "python3.10", "java17", "ruby3.2", "python3.11", "nodejs20.x", "provided.al2023", "python3.12", "java21"
resp.role #=> String
resp.handler #=> String
resp.code_size #=> Integer
resp.description #=> String
resp.timeout #=> Integer
resp.memory_size #=> Integer
resp.last_modified #=> Time
resp.code_sha_256 #=> String
resp.version #=> String
resp.vpc_config.subnet_ids #=> Array
resp.vpc_config.subnet_ids[0] #=> String
resp.vpc_config.security_group_ids #=> Array
resp.vpc_config.security_group_ids[0] #=> String
resp.vpc_config.vpc_id #=> String
resp.vpc_config.ipv_6_allowed_for_dual_stack #=> Boolean
resp.dead_letter_config.target_arn #=> String
resp.environment.variables #=> Hash
resp.environment.variables["EnvironmentVariableName"] #=> String
resp.environment.error.error_code #=> String
resp.environment.error.message #=> String
resp.kms_key_arn #=> String
resp.tracing_config.mode #=> String, one of "Active", "PassThrough"
resp.master_arn #=> String
resp.revision_id #=> String
resp.layers #=> Array
resp.layers[0].arn #=> String
resp.layers[0].code_size #=> Integer
resp.layers[0].signing_profile_version_arn #=> String
resp.layers[0].signing_job_arn #=> String
resp.state #=> String, one of "Pending", "Active", "Inactive", "Failed"
resp.state_reason #=> String
resp.state_reason_code #=> String, one of "Idle", "Creating", "Restoring", "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.last_update_status #=> String, one of "Successful", "Failed", "InProgress"
resp.last_update_status_reason #=> String
resp.last_update_status_reason_code #=> String, one of "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.file_system_configs #=> Array
resp.file_system_configs[0].arn #=> String
resp.file_system_configs[0].local_mount_path #=> String
resp.package_type #=> String, one of "Zip", "Image"
resp.image_config_response.image_config.entry_point #=> Array
resp.image_config_response.image_config.entry_point[0] #=> String
resp.image_config_response.image_config.command #=> Array
resp.image_config_response.image_config.command[0] #=> String
resp.image_config_response.image_config.working_directory #=> String
resp.image_config_response.error.error_code #=> String
resp.image_config_response.error.message #=> String
resp.signing_profile_version_arn #=> String
resp.signing_job_arn #=> String
resp.architectures #=> Array
resp.architectures[0] #=> String, one of "x86_64", "arm64"
resp.ephemeral_storage.size #=> Integer
resp.snap_start.apply_on #=> String, one of "PublishedVersions", "None"
resp.snap_start.optimization_status #=> String, one of "On", "Off"
resp.runtime_version_config.runtime_version_arn #=> String
resp.runtime_version_config.error.error_code #=> String
resp.runtime_version_config.error.message #=> String
resp.logging_config.log_format #=> String, one of "JSON", "Text"
resp.logging_config.application_log_level #=> String, one of "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"
resp.logging_config.system_log_level #=> String, one of "DEBUG", "INFO", "WARN"
resp.logging_config.log_group #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :runtime (String)

    The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive.

    The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

  • :role (required, String)

    The Amazon Resource Name (ARN) of the function's execution role.

  • :handler (String)

    The name of the method within your code that Lambda calls to run your function. Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Lambda programming model.

  • :code (required, Types::FunctionCode)

    The code for the function.

  • :description (String)

    A description of the function.

  • :timeout (Integer)

    The amount of time (in seconds) that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see Lambda execution environment.

  • :memory_size (Integer)

    The amount of memory available to the function at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB.

  • :publish (Boolean)

    Set to true to publish the first version of the function during creation.

  • :vpc_config (Types::VpcConfig)

    For network connectivity to Amazon Web Services resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more information, see Configuring a Lambda function to access resources in a VPC.

  • :package_type (String)

    The type of deployment package. Set to Image for container image and set to Zip for .zip file archive.

  • :dead_letter_config (Types::DeadLetterConfig)

    A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see Dead-letter queues.

  • :environment (Types::Environment)

    Environment variables that are accessible from function code during execution.

  • :kms_key_arn (String)

    The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's environment variables. When Lambda SnapStart is activated, Lambda also uses this key is to encrypt your function's snapshot. If you deploy your function using a container image, Lambda also uses this key to encrypt your function when it's deployed. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). If you don't provide a customer managed key, Lambda uses a default service key.

  • :tracing_config (Types::TracingConfig)

    Set Mode to Active to sample and trace a subset of incoming requests with X-Ray.

  • :tags (Hash<String,String>)

    A list of tags to apply to the function.

  • :layers (Array<String>)

    A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.

  • :file_system_configs (Array<Types::FileSystemConfig>)

    Connection settings for an Amazon EFS file system.

  • :image_config (Types::ImageConfig)

    Container image configuration values that override the values in the container image Dockerfile.

  • :code_signing_config_arn (String)

    To enable code signing for this function, specify the ARN of a code-signing configuration. A code-signing configuration includes a set of signing profiles, which define the trusted publishers for this function.

  • :architectures (Array<String>)

    The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is x86_64.

  • :ephemeral_storage (Types::EphemeralStorage)

    The size of the function's /tmp directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).

  • :snap_start (Types::SnapStart)

    The function's SnapStart setting.

  • :logging_config (Types::LoggingConfig)

    The function's Amazon CloudWatch Logs configuration settings.

Returns:

See Also:



1556
1557
1558
1559
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 1556

def create_function(params = {}, options = {})
  req = build_request(:create_function, params)
  req.send_request(options)
end

#create_function_url_config(params = {}) ⇒ Types::CreateFunctionUrlConfigResponse

Creates a Lambda function URL with the specified configuration parameters. A function URL is a dedicated HTTP(S) endpoint that you can use to invoke your function.

Examples:

Request syntax with placeholder values


resp = client.create_function_url_config({
  function_name: "FunctionName", # required
  qualifier: "FunctionUrlQualifier",
  auth_type: "NONE", # required, accepts NONE, AWS_IAM
  cors: {
    allow_credentials: false,
    allow_headers: ["Header"],
    allow_methods: ["Method"],
    allow_origins: ["Origin"],
    expose_headers: ["Header"],
    max_age: 1,
  },
  invoke_mode: "BUFFERED", # accepts BUFFERED, RESPONSE_STREAM
})

Response structure


resp.function_url #=> String
resp.function_arn #=> String
resp.auth_type #=> String, one of "NONE", "AWS_IAM"
resp.cors.allow_credentials #=> Boolean
resp.cors.allow_headers #=> Array
resp.cors.allow_headers[0] #=> String
resp.cors.allow_methods #=> Array
resp.cors.allow_methods[0] #=> String
resp.cors.allow_origins #=> Array
resp.cors.allow_origins[0] #=> String
resp.cors.expose_headers #=> Array
resp.cors.expose_headers[0] #=> String
resp.cors.max_age #=> Integer
resp.creation_time #=> Time
resp.invoke_mode #=> String, one of "BUFFERED", "RESPONSE_STREAM"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (String)

    The alias name.

  • :auth_type (required, String)

    The type of authentication that your function URL uses. Set to AWS_IAM if you want to restrict access to authenticated users only. Set to NONE if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs.

  • :cors (Types::Cors)

    The cross-origin resource sharing (CORS) settings for your function URL.

  • :invoke_mode (String)

    Use one of the following options:

    • BUFFERED – This is the default option. Lambda invokes your function using the Invoke API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB.

    • RESPONSE_STREAM – Your function streams payload results as they become available. Lambda invokes your function using the InvokeWithResponseStream API operation. The maximum response payload size is 20 MB, however, you can request a quota increase.

Returns:

See Also:



1668
1669
1670
1671
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 1668

def create_function_url_config(params = {}, options = {})
  req = build_request(:create_function_url_config, params)
  req.send_request(options)
end

#delete_alias(params = {}) ⇒ Struct

Deletes a Lambda function alias.

Examples:

Request syntax with placeholder values


resp = client.delete_alias({
  function_name: "FunctionName", # required
  name: "Alias", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function name - MyFunction.

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Partial ARN - 123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :name (required, String)

    The name of the alias.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1710
1711
1712
1713
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 1710

def delete_alias(params = {}, options = {})
  req = build_request(:delete_alias, params)
  req.send_request(options)
end

#delete_code_signing_config(params = {}) ⇒ Struct

Deletes the code signing configuration. You can delete the code signing configuration only if no function is using it.

Examples:

Request syntax with placeholder values


resp = client.delete_code_signing_config({
  code_signing_config_arn: "CodeSigningConfigArn", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :code_signing_config_arn (required, String)

    The The Amazon Resource Name (ARN) of the code signing configuration.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1733
1734
1735
1736
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 1733

def delete_code_signing_config(params = {}, options = {})
  req = build_request(:delete_code_signing_config, params)
  req.send_request(options)
end

#delete_event_source_mapping(params = {}) ⇒ Types::EventSourceMappingConfiguration

Deletes an event source mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.

When you delete an event source mapping, it enters a Deleting state and might not be completely deleted for several seconds.

Examples:

Request syntax with placeholder values


resp = client.delete_event_source_mapping({
  uuid: "String", # required
})

Response structure


resp.uuid #=> String
resp.starting_position #=> String, one of "TRIM_HORIZON", "LATEST", "AT_TIMESTAMP"
resp.starting_position_timestamp #=> Time
resp.batch_size #=> Integer
resp.maximum_batching_window_in_seconds #=> Integer
resp.parallelization_factor #=> Integer
resp.event_source_arn #=> String
resp.filter_criteria.filters #=> Array
resp.filter_criteria.filters[0].pattern #=> String
resp.function_arn #=> String
resp.last_modified #=> Time
resp.last_processing_result #=> String
resp.state #=> String
resp.state_transition_reason #=> String
resp.destination_config.on_success.destination #=> String
resp.destination_config.on_failure.destination #=> String
resp.topics #=> Array
resp.topics[0] #=> String
resp.queues #=> Array
resp.queues[0] #=> String
resp.source_access_configurations #=> Array
resp.source_access_configurations[0].type #=> String, one of "BASIC_AUTH", "VPC_SUBNET", "VPC_SECURITY_GROUP", "SASL_SCRAM_512_AUTH", "SASL_SCRAM_256_AUTH", "VIRTUAL_HOST", "CLIENT_CERTIFICATE_TLS_AUTH", "SERVER_ROOT_CA_CERTIFICATE"
resp.source_access_configurations[0].uri #=> String
resp.self_managed_event_source.endpoints #=> Hash
resp.self_managed_event_source.endpoints["EndPointType"] #=> Array
resp.self_managed_event_source.endpoints["EndPointType"][0] #=> String
resp.maximum_record_age_in_seconds #=> Integer
resp.bisect_batch_on_function_error #=> Boolean
resp.maximum_retry_attempts #=> Integer
resp.tumbling_window_in_seconds #=> Integer
resp.function_response_types #=> Array
resp.function_response_types[0] #=> String, one of "ReportBatchItemFailures"
resp.amazon_managed_kafka_event_source_config.consumer_group_id #=> String
resp.self_managed_kafka_event_source_config.consumer_group_id #=> String
resp.scaling_config.maximum_concurrency #=> Integer
resp.document_db_event_source_config.database_name #=> String
resp.document_db_event_source_config.collection_name #=> String
resp.document_db_event_source_config.full_document #=> String, one of "UpdateLookup", "Default"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :uuid (required, String)

    The identifier of the event source mapping.

Returns:

See Also:



1832
1833
1834
1835
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 1832

def delete_event_source_mapping(params = {}, options = {})
  req = build_request(:delete_event_source_mapping, params)
  req.send_request(options)
end

#delete_function(params = {}) ⇒ Struct

Deletes a Lambda function. To delete a specific function version, use the Qualifier parameter. Otherwise, all versions and aliases are deleted. This doesn't require the user to have explicit permissions for DeleteAlias.

To delete Lambda event source mappings that invoke a function, use DeleteEventSourceMapping. For Amazon Web Services and resources that invoke your function directly, delete the trigger in the service where you originally configured it.

Examples:

Request syntax with placeholder values


resp = client.delete_function({
  function_name: "FunctionName", # required
  qualifier: "Qualifier",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function or version.

    Name formats

    • Function namemy-function (name-only), my-function:1 (with version).

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (String)

    Specify a version to delete. You can't delete a version that an alias references.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1881
1882
1883
1884
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 1881

def delete_function(params = {}, options = {})
  req = build_request(:delete_function, params)
  req.send_request(options)
end

#delete_function_code_signing_config(params = {}) ⇒ Struct

Removes the code signing configuration from the function.

Examples:

Request syntax with placeholder values


resp = client.delete_function_code_signing_config({
  function_name: "FunctionName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function name - MyFunction.

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Partial ARN - 123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1915
1916
1917
1918
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 1915

def delete_function_code_signing_config(params = {}, options = {})
  req = build_request(:delete_function_code_signing_config, params)
  req.send_request(options)
end

#delete_function_concurrency(params = {}) ⇒ Struct

Removes a concurrent execution limit from a function.

Examples:

Request syntax with placeholder values


resp = client.delete_function_concurrency({
  function_name: "FunctionName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1949
1950
1951
1952
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 1949

def delete_function_concurrency(params = {}, options = {})
  req = build_request(:delete_function_concurrency, params)
  req.send_request(options)
end

#delete_function_event_invoke_config(params = {}) ⇒ Struct

Deletes the configuration for asynchronous invocation for a function, version, or alias.

To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

Examples:

Request syntax with placeholder values


resp = client.delete_function_event_invoke_config({
  function_name: "FunctionName", # required
  qualifier: "Qualifier",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function, version, or alias.

    Name formats

    • Function name - my-function (name-only), my-function:v1 (with alias).

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN - 123456789012:function:my-function.

    You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (String)

    A version number or alias name.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1993
1994
1995
1996
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 1993

def delete_function_event_invoke_config(params = {}, options = {})
  req = build_request(:delete_function_event_invoke_config, params)
  req.send_request(options)
end

#delete_function_url_config(params = {}) ⇒ Struct

Deletes a Lambda function URL. When you delete a function URL, you can't recover it. Creating a new function URL results in a different URL address.

Examples:

Request syntax with placeholder values


resp = client.delete_function_url_config({
  function_name: "FunctionName", # required
  qualifier: "FunctionUrlQualifier",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (String)

    The alias name.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2033
2034
2035
2036
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2033

def delete_function_url_config(params = {}, options = {})
  req = build_request(:delete_function_url_config, params)
  req.send_request(options)
end

#delete_layer_version(params = {}) ⇒ Struct

Deletes a version of an Lambda layer. Deleted versions can no longer be viewed or added to functions. To avoid breaking functions, a copy of the version remains in Lambda until no functions refer to it.

Examples:

Request syntax with placeholder values


resp = client.delete_layer_version({
  layer_name: "LayerName", # required
  version_number: 1, # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :layer_name (required, String)

    The name or Amazon Resource Name (ARN) of the layer.

  • :version_number (required, Integer)

    The version number.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2065
2066
2067
2068
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2065

def delete_layer_version(params = {}, options = {})
  req = build_request(:delete_layer_version, params)
  req.send_request(options)
end

#delete_provisioned_concurrency_config(params = {}) ⇒ Struct

Deletes the provisioned concurrency configuration for a function.

Examples:

Request syntax with placeholder values


resp = client.delete_provisioned_concurrency_config({
  function_name: "FunctionName", # required
  qualifier: "Qualifier", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (required, String)

    The version number or alias name.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2103
2104
2105
2106
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2103

def delete_provisioned_concurrency_config(params = {}, options = {})
  req = build_request(:delete_provisioned_concurrency_config, params)
  req.send_request(options)
end

#get_account_settings(params = {}) ⇒ Types::GetAccountSettingsResponse

Retrieves details about your account's limits and usage in an Amazon Web Services Region.

Examples:

Response structure


resp..total_code_size #=> Integer
resp..code_size_unzipped #=> Integer
resp..code_size_zipped #=> Integer
resp..concurrent_executions #=> Integer
resp..unreserved_concurrent_executions #=> Integer
resp..total_code_size #=> Integer
resp..function_count #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Returns:

See Also:



2134
2135
2136
2137
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2134

def (params = {}, options = {})
  req = build_request(:get_account_settings, params)
  req.send_request(options)
end

#get_alias(params = {}) ⇒ Types::AliasConfiguration

Returns details about a Lambda function alias.

Examples:

Request syntax with placeholder values


resp = client.get_alias({
  function_name: "FunctionName", # required
  name: "Alias", # required
})

Response structure


resp.alias_arn #=> String
resp.name #=> String
resp.function_version #=> String
resp.description #=> String
resp.routing_config.additional_version_weights #=> Hash
resp.routing_config.additional_version_weights["AdditionalVersion"] #=> Float
resp.revision_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function name - MyFunction.

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Partial ARN - 123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :name (required, String)

    The name of the alias.

Returns:

See Also:



2193
2194
2195
2196
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2193

def get_alias(params = {}, options = {})
  req = build_request(:get_alias, params)
  req.send_request(options)
end

#get_code_signing_config(params = {}) ⇒ Types::GetCodeSigningConfigResponse

Returns information about the specified code signing configuration.

Examples:

Request syntax with placeholder values


resp = client.get_code_signing_config({
  code_signing_config_arn: "CodeSigningConfigArn", # required
})

Response structure


resp.code_signing_config.code_signing_config_id #=> String
resp.code_signing_config.code_signing_config_arn #=> String
resp.code_signing_config.description #=> String
resp.code_signing_config.allowed_publishers.signing_profile_version_arns #=> Array
resp.code_signing_config.allowed_publishers.signing_profile_version_arns[0] #=> String
resp.code_signing_config.code_signing_policies.untrusted_artifact_on_deployment #=> String, one of "Warn", "Enforce"
resp.code_signing_config.last_modified #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :code_signing_config_arn (required, String)

    The The Amazon Resource Name (ARN) of the code signing configuration.

Returns:

See Also:



2227
2228
2229
2230
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2227

def get_code_signing_config(params = {}, options = {})
  req = build_request(:get_code_signing_config, params)
  req.send_request(options)
end

#get_event_source_mapping(params = {}) ⇒ Types::EventSourceMappingConfiguration

Returns details about an event source mapping. You can get the identifier of a mapping from the output of ListEventSourceMappings.

Examples:

Request syntax with placeholder values


resp = client.get_event_source_mapping({
  uuid: "String", # required
})

Response structure


resp.uuid #=> String
resp.starting_position #=> String, one of "TRIM_HORIZON", "LATEST", "AT_TIMESTAMP"
resp.starting_position_timestamp #=> Time
resp.batch_size #=> Integer
resp.maximum_batching_window_in_seconds #=> Integer
resp.parallelization_factor #=> Integer
resp.event_source_arn #=> String
resp.filter_criteria.filters #=> Array
resp.filter_criteria.filters[0].pattern #=> String
resp.function_arn #=> String
resp.last_modified #=> Time
resp.last_processing_result #=> String
resp.state #=> String
resp.state_transition_reason #=> String
resp.destination_config.on_success.destination #=> String
resp.destination_config.on_failure.destination #=> String
resp.topics #=> Array
resp.topics[0] #=> String
resp.queues #=> Array
resp.queues[0] #=> String
resp.source_access_configurations #=> Array
resp.source_access_configurations[0].type #=> String, one of "BASIC_AUTH", "VPC_SUBNET", "VPC_SECURITY_GROUP", "SASL_SCRAM_512_AUTH", "SASL_SCRAM_256_AUTH", "VIRTUAL_HOST", "CLIENT_CERTIFICATE_TLS_AUTH", "SERVER_ROOT_CA_CERTIFICATE"
resp.source_access_configurations[0].uri #=> String
resp.self_managed_event_source.endpoints #=> Hash
resp.self_managed_event_source.endpoints["EndPointType"] #=> Array
resp.self_managed_event_source.endpoints["EndPointType"][0] #=> String
resp.maximum_record_age_in_seconds #=> Integer
resp.bisect_batch_on_function_error #=> Boolean
resp.maximum_retry_attempts #=> Integer
resp.tumbling_window_in_seconds #=> Integer
resp.function_response_types #=> Array
resp.function_response_types[0] #=> String, one of "ReportBatchItemFailures"
resp.amazon_managed_kafka_event_source_config.consumer_group_id #=> String
resp.self_managed_kafka_event_source_config.consumer_group_id #=> String
resp.scaling_config.maximum_concurrency #=> Integer
resp.document_db_event_source_config.database_name #=> String
resp.document_db_event_source_config.collection_name #=> String
resp.document_db_event_source_config.full_document #=> String, one of "UpdateLookup", "Default"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :uuid (required, String)

    The identifier of the event source mapping.

Returns:

See Also:



2319
2320
2321
2322
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2319

def get_event_source_mapping(params = {}, options = {})
  req = build_request(:get_event_source_mapping, params)
  req.send_request(options)
end

#get_function(params = {}) ⇒ Types::GetFunctionResponse

Returns information about the function or function version, with a link to download the deployment package that's valid for 10 minutes. If you specify a function version, only details that are specific to that version are returned.

The following waiters are defined for this operation (see #wait_until for detailed usage):

  • function_active_v2
  • function_exists
  • function_updated_v2

Examples:

Request syntax with placeholder values


resp = client.get_function({
  function_name: "NamespacedFunctionName", # required
  qualifier: "Qualifier",
})

Response structure


resp.configuration.function_name #=> String
resp.configuration.function_arn #=> String
resp.configuration.runtime #=> String, one of "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "nodejs10.x", "nodejs12.x", "nodejs14.x", "nodejs16.x", "java8", "java8.al2", "java11", "python2.7", "python3.6", "python3.7", "python3.8", "python3.9", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "dotnet6", "dotnet8", "nodejs4.3-edge", "go1.x", "ruby2.5", "ruby2.7", "provided", "provided.al2", "nodejs18.x", "python3.10", "java17", "ruby3.2", "python3.11", "nodejs20.x", "provided.al2023", "python3.12", "java21"
resp.configuration.role #=> String
resp.configuration.handler #=> String
resp.configuration.code_size #=> Integer
resp.configuration.description #=> String
resp.configuration.timeout #=> Integer
resp.configuration.memory_size #=> Integer
resp.configuration.last_modified #=> Time
resp.configuration.code_sha_256 #=> String
resp.configuration.version #=> String
resp.configuration.vpc_config.subnet_ids #=> Array
resp.configuration.vpc_config.subnet_ids[0] #=> String
resp.configuration.vpc_config.security_group_ids #=> Array
resp.configuration.vpc_config.security_group_ids[0] #=> String
resp.configuration.vpc_config.vpc_id #=> String
resp.configuration.vpc_config.ipv_6_allowed_for_dual_stack #=> Boolean
resp.configuration.dead_letter_config.target_arn #=> String
resp.configuration.environment.variables #=> Hash
resp.configuration.environment.variables["EnvironmentVariableName"] #=> String
resp.configuration.environment.error.error_code #=> String
resp.configuration.environment.error.message #=> String
resp.configuration.kms_key_arn #=> String
resp.configuration.tracing_config.mode #=> String, one of "Active", "PassThrough"
resp.configuration.master_arn #=> String
resp.configuration.revision_id #=> String
resp.configuration.layers #=> Array
resp.configuration.layers[0].arn #=> String
resp.configuration.layers[0].code_size #=> Integer
resp.configuration.layers[0].signing_profile_version_arn #=> String
resp.configuration.layers[0].signing_job_arn #=> String
resp.configuration.state #=> String, one of "Pending", "Active", "Inactive", "Failed"
resp.configuration.state_reason #=> String
resp.configuration.state_reason_code #=> String, one of "Idle", "Creating", "Restoring", "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.configuration.last_update_status #=> String, one of "Successful", "Failed", "InProgress"
resp.configuration.last_update_status_reason #=> String
resp.configuration.last_update_status_reason_code #=> String, one of "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.configuration.file_system_configs #=> Array
resp.configuration.file_system_configs[0].arn #=> String
resp.configuration.file_system_configs[0].local_mount_path #=> String
resp.configuration.package_type #=> String, one of "Zip", "Image"
resp.configuration.image_config_response.image_config.entry_point #=> Array
resp.configuration.image_config_response.image_config.entry_point[0] #=> String
resp.configuration.image_config_response.image_config.command #=> Array
resp.configuration.image_config_response.image_config.command[0] #=> String
resp.configuration.image_config_response.image_config.working_directory #=> String
resp.configuration.image_config_response.error.error_code #=> String
resp.configuration.image_config_response.error.message #=> String
resp.configuration.signing_profile_version_arn #=> String
resp.configuration.signing_job_arn #=> String
resp.configuration.architectures #=> Array
resp.configuration.architectures[0] #=> String, one of "x86_64", "arm64"
resp.configuration.ephemeral_storage.size #=> Integer
resp.configuration.snap_start.apply_on #=> String, one of "PublishedVersions", "None"
resp.configuration.snap_start.optimization_status #=> String, one of "On", "Off"
resp.configuration.runtime_version_config.runtime_version_arn #=> String
resp.configuration.runtime_version_config.error.error_code #=> String
resp.configuration.runtime_version_config.error.message #=> String
resp.configuration.logging_config.log_format #=> String, one of "JSON", "Text"
resp.configuration.logging_config.application_log_level #=> String, one of "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"
resp.configuration.logging_config.system_log_level #=> String, one of "DEBUG", "INFO", "WARN"
resp.configuration.logging_config.log_group #=> String
resp.code.repository_type #=> String
resp.code.location #=> String
resp.code.image_uri #=> String
resp.code.resolved_image_uri #=> String
resp.tags #=> Hash
resp.tags["TagKey"] #=> String
resp.concurrency.reserved_concurrent_executions #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function, version, or alias.

    Name formats

    • Function namemy-function (name-only), my-function:v1 (with alias).

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (String)

    Specify a version or alias to get details about a published version of the function.

Returns:

See Also:



2448
2449
2450
2451
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2448

def get_function(params = {}, options = {})
  req = build_request(:get_function, params)
  req.send_request(options)
end

#get_function_code_signing_config(params = {}) ⇒ Types::GetFunctionCodeSigningConfigResponse

Returns the code signing configuration for the specified function.

Examples:

Request syntax with placeholder values


resp = client.get_function_code_signing_config({
  function_name: "FunctionName", # required
})

Response structure


resp.code_signing_config_arn #=> String
resp.function_name #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function name - MyFunction.

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Partial ARN - 123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

Returns:

See Also:



2490
2491
2492
2493
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2490

def get_function_code_signing_config(params = {}, options = {})
  req = build_request(:get_function_code_signing_config, params)
  req.send_request(options)
end

#get_function_concurrency(params = {}) ⇒ Types::GetFunctionConcurrencyResponse

Returns details about the reserved concurrency configuration for a function. To set a concurrency limit for a function, use PutFunctionConcurrency.

Examples:

Request syntax with placeholder values


resp = client.get_function_concurrency({
  function_name: "FunctionName", # required
})

Response structure


resp.reserved_concurrent_executions #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

Returns:

See Also:



2532
2533
2534
2535
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2532

def get_function_concurrency(params = {}, options = {})
  req = build_request(:get_function_concurrency, params)
  req.send_request(options)
end

#get_function_configuration(params = {}) ⇒ Types::FunctionConfiguration

Returns the version-specific settings of a Lambda function or version. The output includes only options that can vary between versions of a function. To modify these settings, use UpdateFunctionConfiguration.

To get all of a function's details, including function-level settings, use GetFunction.

The following waiters are defined for this operation (see #wait_until for detailed usage):

  • function_active
  • function_updated
  • published_version_active

Examples:

Request syntax with placeholder values


resp = client.get_function_configuration({
  function_name: "NamespacedFunctionName", # required
  qualifier: "Qualifier",
})

Response structure


resp.function_name #=> String
resp.function_arn #=> String
resp.runtime #=> String, one of "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "nodejs10.x", "nodejs12.x", "nodejs14.x", "nodejs16.x", "java8", "java8.al2", "java11", "python2.7", "python3.6", "python3.7", "python3.8", "python3.9", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "dotnet6", "dotnet8", "nodejs4.3-edge", "go1.x", "ruby2.5", "ruby2.7", "provided", "provided.al2", "nodejs18.x", "python3.10", "java17", "ruby3.2", "python3.11", "nodejs20.x", "provided.al2023", "python3.12", "java21"
resp.role #=> String
resp.handler #=> String
resp.code_size #=> Integer
resp.description #=> String
resp.timeout #=> Integer
resp.memory_size #=> Integer
resp.last_modified #=> Time
resp.code_sha_256 #=> String
resp.version #=> String
resp.vpc_config.subnet_ids #=> Array
resp.vpc_config.subnet_ids[0] #=> String
resp.vpc_config.security_group_ids #=> Array
resp.vpc_config.security_group_ids[0] #=> String
resp.vpc_config.vpc_id #=> String
resp.vpc_config.ipv_6_allowed_for_dual_stack #=> Boolean
resp.dead_letter_config.target_arn #=> String
resp.environment.variables #=> Hash
resp.environment.variables["EnvironmentVariableName"] #=> String
resp.environment.error.error_code #=> String
resp.environment.error.message #=> String
resp.kms_key_arn #=> String
resp.tracing_config.mode #=> String, one of "Active", "PassThrough"
resp.master_arn #=> String
resp.revision_id #=> String
resp.layers #=> Array
resp.layers[0].arn #=> String
resp.layers[0].code_size #=> Integer
resp.layers[0].signing_profile_version_arn #=> String
resp.layers[0].signing_job_arn #=> String
resp.state #=> String, one of "Pending", "Active", "Inactive", "Failed"
resp.state_reason #=> String
resp.state_reason_code #=> String, one of "Idle", "Creating", "Restoring", "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.last_update_status #=> String, one of "Successful", "Failed", "InProgress"
resp.last_update_status_reason #=> String
resp.last_update_status_reason_code #=> String, one of "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.file_system_configs #=> Array
resp.file_system_configs[0].arn #=> String
resp.file_system_configs[0].local_mount_path #=> String
resp.package_type #=> String, one of "Zip", "Image"
resp.image_config_response.image_config.entry_point #=> Array
resp.image_config_response.image_config.entry_point[0] #=> String
resp.image_config_response.image_config.command #=> Array
resp.image_config_response.image_config.command[0] #=> String
resp.image_config_response.image_config.working_directory #=> String
resp.image_config_response.error.error_code #=> String
resp.image_config_response.error.message #=> String
resp.signing_profile_version_arn #=> String
resp.signing_job_arn #=> String
resp.architectures #=> Array
resp.architectures[0] #=> String, one of "x86_64", "arm64"
resp.ephemeral_storage.size #=> Integer
resp.snap_start.apply_on #=> String, one of "PublishedVersions", "None"
resp.snap_start.optimization_status #=> String, one of "On", "Off"
resp.runtime_version_config.runtime_version_arn #=> String
resp.runtime_version_config.error.error_code #=> String
resp.runtime_version_config.error.message #=> String
resp.logging_config.log_format #=> String, one of "JSON", "Text"
resp.logging_config.application_log_level #=> String, one of "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"
resp.logging_config.system_log_level #=> String, one of "DEBUG", "INFO", "WARN"
resp.logging_config.log_group #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function, version, or alias.

    Name formats

    • Function namemy-function (name-only), my-function:v1 (with alias).

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (String)

    Specify a version or alias to get details about a published version of the function.

Returns:

See Also:



2688
2689
2690
2691
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2688

def get_function_configuration(params = {}, options = {})
  req = build_request(:get_function_configuration, params)
  req.send_request(options)
end

#get_function_event_invoke_config(params = {}) ⇒ Types::FunctionEventInvokeConfig

Retrieves the configuration for asynchronous invocation for a function, version, or alias.

To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

Examples:

Request syntax with placeholder values


resp = client.get_function_event_invoke_config({
  function_name: "FunctionName", # required
  qualifier: "Qualifier",
})

Response structure


resp.last_modified #=> Time
resp.function_arn #=> String
resp.maximum_retry_attempts #=> Integer
resp.maximum_event_age_in_seconds #=> Integer
resp.destination_config.on_success.destination #=> String
resp.destination_config.on_failure.destination #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function, version, or alias.

    Name formats

    • Function name - my-function (name-only), my-function:v1 (with alias).

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN - 123456789012:function:my-function.

    You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (String)

    A version number or alias name.

Returns:

See Also:



2747
2748
2749
2750
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2747

def get_function_event_invoke_config(params = {}, options = {})
  req = build_request(:get_function_event_invoke_config, params)
  req.send_request(options)
end

#get_function_url_config(params = {}) ⇒ Types::GetFunctionUrlConfigResponse

Returns details about a Lambda function URL.

Examples:

Request syntax with placeholder values


resp = client.get_function_url_config({
  function_name: "FunctionName", # required
  qualifier: "FunctionUrlQualifier",
})

Response structure


resp.function_url #=> String
resp.function_arn #=> String
resp.auth_type #=> String, one of "NONE", "AWS_IAM"
resp.cors.allow_credentials #=> Boolean
resp.cors.allow_headers #=> Array
resp.cors.allow_headers[0] #=> String
resp.cors.allow_methods #=> Array
resp.cors.allow_methods[0] #=> String
resp.cors.allow_origins #=> Array
resp.cors.allow_origins[0] #=> String
resp.cors.expose_headers #=> Array
resp.cors.expose_headers[0] #=> String
resp.cors.max_age #=> Integer
resp.creation_time #=> Time
resp.last_modified_time #=> Time
resp.invoke_mode #=> String, one of "BUFFERED", "RESPONSE_STREAM"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (String)

    The alias name.

Returns:

See Also:



2812
2813
2814
2815
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2812

def get_function_url_config(params = {}, options = {})
  req = build_request(:get_function_url_config, params)
  req.send_request(options)
end

#get_layer_version(params = {}) ⇒ Types::GetLayerVersionResponse

Returns information about a version of an Lambda layer, with a link to download the layer archive that's valid for 10 minutes.

Examples:

Request syntax with placeholder values


resp = client.get_layer_version({
  layer_name: "LayerName", # required
  version_number: 1, # required
})

Response structure


resp.content.location #=> String
resp.content.code_sha_256 #=> String
resp.content.code_size #=> Integer
resp.content.signing_profile_version_arn #=> String
resp.content.signing_job_arn #=> String
resp.layer_arn #=> String
resp.layer_version_arn #=> String
resp.description #=> String
resp.created_date #=> Time
resp.version #=> Integer
resp.compatible_runtimes #=> Array
resp.compatible_runtimes[0] #=> String, one of "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "nodejs10.x", "nodejs12.x", "nodejs14.x", "nodejs16.x", "java8", "java8.al2", "java11", "python2.7", "python3.6", "python3.7", "python3.8", "python3.9", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "dotnet6", "dotnet8", "nodejs4.3-edge", "go1.x", "ruby2.5", "ruby2.7", "provided", "provided.al2", "nodejs18.x", "python3.10", "java17", "ruby3.2", "python3.11", "nodejs20.x", "provided.al2023", "python3.12", "java21"
resp.license_info #=> String
resp.compatible_architectures #=> Array
resp.compatible_architectures[0] #=> String, one of "x86_64", "arm64"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :layer_name (required, String)

    The name or Amazon Resource Name (ARN) of the layer.

  • :version_number (required, Integer)

    The version number.

Returns:

See Also:



2871
2872
2873
2874
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2871

def get_layer_version(params = {}, options = {})
  req = build_request(:get_layer_version, params)
  req.send_request(options)
end

#get_layer_version_by_arn(params = {}) ⇒ Types::GetLayerVersionResponse

Returns information about a version of an Lambda layer, with a link to download the layer archive that's valid for 10 minutes.

Examples:

Request syntax with placeholder values


resp = client.get_layer_version_by_arn({
  arn: "LayerVersionArn", # required
})

Response structure


resp.content.location #=> String
resp.content.code_sha_256 #=> String
resp.content.code_size #=> Integer
resp.content.signing_profile_version_arn #=> String
resp.content.signing_job_arn #=> String
resp.layer_arn #=> String
resp.layer_version_arn #=> String
resp.description #=> String
resp.created_date #=> Time
resp.version #=> Integer
resp.compatible_runtimes #=> Array
resp.compatible_runtimes[0] #=> String, one of "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "nodejs10.x", "nodejs12.x", "nodejs14.x", "nodejs16.x", "java8", "java8.al2", "java11", "python2.7", "python3.6", "python3.7", "python3.8", "python3.9", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "dotnet6", "dotnet8", "nodejs4.3-edge", "go1.x", "ruby2.5", "ruby2.7", "provided", "provided.al2", "nodejs18.x", "python3.10", "java17", "ruby3.2", "python3.11", "nodejs20.x", "provided.al2023", "python3.12", "java21"
resp.license_info #=> String
resp.compatible_architectures #=> Array
resp.compatible_architectures[0] #=> String, one of "x86_64", "arm64"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :arn (required, String)

    The ARN of the layer version.

Returns:

See Also:



2926
2927
2928
2929
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2926

def get_layer_version_by_arn(params = {}, options = {})
  req = build_request(:get_layer_version_by_arn, params)
  req.send_request(options)
end

#get_layer_version_policy(params = {}) ⇒ Types::GetLayerVersionPolicyResponse

Returns the permission policy for a version of an Lambda layer. For more information, see AddLayerVersionPermission.

Examples:

Request syntax with placeholder values


resp = client.get_layer_version_policy({
  layer_name: "LayerName", # required
  version_number: 1, # required
})

Response structure


resp.policy #=> String
resp.revision_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :layer_name (required, String)

    The name or Amazon Resource Name (ARN) of the layer.

  • :version_number (required, Integer)

    The version number.

Returns:

See Also:



2965
2966
2967
2968
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 2965

def get_layer_version_policy(params = {}, options = {})
  req = build_request(:get_layer_version_policy, params)
  req.send_request(options)
end

#get_policy(params = {}) ⇒ Types::GetPolicyResponse

Returns the resource-based IAM policy for a function, version, or alias.

Examples:

Request syntax with placeholder values


resp = client.get_policy({
  function_name: "NamespacedFunctionName", # required
  qualifier: "Qualifier",
})

Response structure


resp.policy #=> String
resp.revision_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function, version, or alias.

    Name formats

    • Function namemy-function (name-only), my-function:v1 (with alias).

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (String)

    Specify a version or alias to get the policy for that resource.

Returns:

See Also:



3018
3019
3020
3021
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 3018

def get_policy(params = {}, options = {})
  req = build_request(:get_policy, params)
  req.send_request(options)
end

#get_provisioned_concurrency_config(params = {}) ⇒ Types::GetProvisionedConcurrencyConfigResponse

Retrieves the provisioned concurrency configuration for a function's alias or version.

Examples:

Request syntax with placeholder values


resp = client.get_provisioned_concurrency_config({
  function_name: "FunctionName", # required
  qualifier: "Qualifier", # required
})

Response structure


resp.requested_provisioned_concurrent_executions #=> Integer
resp.available_provisioned_concurrent_executions #=> Integer
resp.allocated_provisioned_concurrent_executions #=> Integer
resp.status #=> String, one of "IN_PROGRESS", "READY", "FAILED"
resp.status_reason #=> String
resp.last_modified #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (required, String)

    The version number or alias name.

Returns:

See Also:



3073
3074
3075
3076
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 3073

def get_provisioned_concurrency_config(params = {}, options = {})
  req = build_request(:get_provisioned_concurrency_config, params)
  req.send_request(options)
end

#get_runtime_management_config(params = {}) ⇒ Types::GetRuntimeManagementConfigResponse

Retrieves the runtime management configuration for a function's version. If the runtime update mode is Manual, this includes the ARN of the runtime version and the runtime update mode. If the runtime update mode is Auto or Function update, this includes the runtime update mode and null is returned for the ARN. For more information, see Runtime updates.

Examples:

Request syntax with placeholder values


resp = client.get_runtime_management_config({
  function_name: "NamespacedFunctionName", # required
  qualifier: "Qualifier",
})

Response structure


resp.update_runtime_on #=> String, one of "Auto", "Manual", "FunctionUpdate"
resp.runtime_version_arn #=> String
resp.function_arn #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (String)

    Specify a version of the function. This can be $LATEST or a published version number. If no value is specified, the configuration for the $LATEST version is returned.

Returns:

See Also:



3132
3133
3134
3135
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 3132

def get_runtime_management_config(params = {}, options = {})
  req = build_request(:get_runtime_management_config, params)
  req.send_request(options)
end

#invoke(params = {}) ⇒ Types::InvocationResponse

Invokes a Lambda function. You can invoke a function synchronously (and wait for the response), or asynchronously. By default, Lambda invokes your function synchronously (i.e. theInvocationType is RequestResponse). To invoke a function asynchronously, set InvocationType to Event. Lambda passes the ClientContext object to your function for synchronous invocations only.

For synchronous invocation, details about the function response, including errors, are included in the response body and headers. For either invocation type, you can find more information in the execution log and trace.

When an error occurs, your function may be invoked multiple times. Retry behavior varies by error type, client, event source, and invocation type. For example, if you invoke a function asynchronously and it returns an error, Lambda executes the function up to two more times. For more information, see Error handling and automatic retries in Lambda.

For asynchronous invocation, Lambda adds events to a queue before sending them to your function. If your function does not have enough capacity to keep up with the queue, events may be lost. Occasionally, your function may receive the same event multiple times, even if no error occurs. To retain events that were not processed, configure your function with a dead-letter queue.

The status code in the API response doesn't reflect function errors. Error codes are reserved for errors that prevent your function from executing, such as permissions errors, quota errors, or issues with your function's code and configuration. For example, Lambda returns TooManyRequestsException if running the function would cause you to exceed a concurrency limit at either the account level (ConcurrentInvocationLimitExceeded) or function level (ReservedFunctionConcurrentInvocationLimitExceeded).

For functions with a long timeout, your client might disconnect during synchronous invocation while it waits for a response. Configure your HTTP client, SDK, firewall, proxy, or operating system to allow for long connections with timeout or keep-alive settings.

This operation requires permission for the lambda:InvokeFunction action. For details on how to set up permissions for cross-account invocations, see Granting function access to other accounts.

Examples:

Request syntax with placeholder values


resp = client.invoke({
  function_name: "NamespacedFunctionName", # required
  invocation_type: "Event", # accepts Event, RequestResponse, DryRun
  log_type: "None", # accepts None, Tail
  client_context: "String",
  payload: "data",
  qualifier: "Qualifier",
})

Response structure


resp.status_code #=> Integer
resp.function_error #=> String
resp.log_result #=> String
resp.payload #=> String
resp.executed_version #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function, version, or alias.

    Name formats

    • Function namemy-function (name-only), my-function:v1 (with alias).

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :invocation_type (String)

    Choose from the following options.

    • RequestResponse (default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data.

    • Event – Invoke the function asynchronously. Send events that fail multiple times to the function's dead-letter queue (if one is configured). The API response only includes a status code.

    • DryRun – Validate parameter values and verify that the user or role has permission to invoke the function.

  • :log_type (String)

    Set to Tail to include the execution log in the response. Applies to synchronously invoked functions only.

  • :client_context (String)

    Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object. Lambda passes the ClientContext object to your function for synchronous invocations only.

  • :payload (String, StringIO, File)

    The JSON that you want to provide to your Lambda function as input.

    You can enter the JSON directly. For example, --payload '\{ "key": "value" \}'. You can also specify a file path. For example, --payload file://payload.json.

  • :qualifier (String)

    Specify a version or alias to invoke a published version of the function.

Returns:

See Also:



3277
3278
3279
3280
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 3277

def invoke(params = {}, options = {})
  req = build_request(:invoke, params)
  req.send_request(options)
end

#invoke_async(params = {}) ⇒ Types::InvokeAsyncResponse

For asynchronous function invocation, use Invoke.

Invokes a function asynchronously.

If you do use the InvokeAsync action, note that it doesn't support the use of X-Ray active tracing. Trace ID is not propagated to the function, even if X-Ray active tracing is turned on.

Examples:

Request syntax with placeholder values


resp = client.invoke_async({
  function_name: "NamespacedFunctionName", # required
  invoke_args: "data", # required
})

Response structure


resp.status #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :invoke_args (required, String, StringIO, File)

    The JSON that you want to provide to your Lambda function as input.

Returns:

See Also:



3329
3330
3331
3332
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 3329

def invoke_async(params = {}, options = {})
  req = build_request(:invoke_async, params)
  req.send_request(options)
end

#invoke_with_response_stream(params = {}) ⇒ Types::InvokeWithResponseStreamResponse

Configure your Lambda functions to stream response payloads back to clients. For more information, see Configuring a Lambda function to stream responses.

This operation requires permission for the lambda:InvokeFunction action. For details on how to set up permissions for cross-account invocations, see Granting function access to other accounts.

Examples:

EventStream Operation Example


You can process event once it arrives immediately, or wait until
full response complete and iterate through eventstream enumerator.

To interact with event immediately, you need to register #invoke_with_response_stream
with callbacks, callbacks can be register for specifc events or for all events,
callback for errors in the event stream is also available for register.

Callbacks can be passed in by `:event_stream_handler` option or within block
statement attached to #invoke_with_response_stream call directly. Hybrid pattern of both
is also supported.

`:event_stream_handler` option takes in either Proc object or
Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent object.

Usage pattern a): callbacks with a block attached to #invoke_with_response_stream
  Example for registering callbacks for all event types and error event

  client.invoke_with_response_stream( # params input# ) do |stream|
    stream.on_error_event do |event|
      # catch unmodeled error event in the stream
      raise event
      # => Aws::Errors::EventError
      # event.event_type => :error
      # event.error_code => String
      # event.error_message => String
    end

    stream.on_event do |event|
      # process all events arrive
      puts event.event_type
      ...
    end

  end

Usage pattern b): pass in `:event_stream_handler` for #invoke_with_response_stream

  1) create a Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent object
  Example for registering callbacks with specific events

    handler = Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent.new
    handler.on_payload_chunk_event do |event|
      event # => Aws::Lambda::Types::PayloadChunk
    end
    handler.on_invoke_complete_event do |event|
      event # => Aws::Lambda::Types::InvokeComplete
    end

  client.invoke_with_response_stream( # params input #, event_stream_handler: handler)

  2) use a Ruby Proc object
  Example for registering callbacks with specific events

  handler = Proc.new do |stream|
    stream.on_payload_chunk_event do |event|
      event # => Aws::Lambda::Types::PayloadChunk
    end
    stream.on_invoke_complete_event do |event|
      event # => Aws::Lambda::Types::InvokeComplete
    end
  end

  client.invoke_with_response_stream( # params input #, event_stream_handler: handler)

Usage pattern c): hybird pattern of a) and b)

    handler = Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent.new
    handler.on_payload_chunk_event do |event|
      event # => Aws::Lambda::Types::PayloadChunk
    end
    handler.on_invoke_complete_event do |event|
      event # => Aws::Lambda::Types::InvokeComplete
    end

  client.invoke_with_response_stream( # params input #, event_stream_handler: handler) do |stream|
    stream.on_error_event do |event|
      # catch unmodeled error event in the stream
      raise event
      # => Aws::Errors::EventError
      # event.event_type => :error
      # event.error_code => String
      # event.error_message => String
    end
  end

Besides above usage patterns for process events when they arrive immediately, you can also
iterate through events after response complete.

Events are available at resp.event_stream # => Enumerator
For parameter input example, please refer to following request syntax

Request syntax with placeholder values


resp = client.invoke_with_response_stream({
  function_name: "NamespacedFunctionName", # required
  invocation_type: "RequestResponse", # accepts RequestResponse, DryRun
  log_type: "None", # accepts None, Tail
  client_context: "String",
  qualifier: "Qualifier",
  payload: "data",
})

Response structure


resp.status_code #=> Integer
resp.executed_version #=> String
All events are available at resp.event_stream:
resp.event_stream #=> Enumerator
resp.event_stream.event_types #=> [:payload_chunk, :invoke_complete]

For :payload_chunk event available at #on_payload_chunk_event callback and response eventstream enumerator:
event.payload #=> String

For :invoke_complete event available at #on_invoke_complete_event callback and response eventstream enumerator:
event.error_code #=> String
event.error_details #=> String
event.log_result #=> String

resp.response_stream_content_type #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :invocation_type (String)

    Use one of the following options:

    • RequestResponse (default) – Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API operation response includes the function response and additional data.

    • DryRun – Validate parameter values and verify that the IAM user or role has permission to invoke the function.

  • :log_type (String)

    Set to Tail to include the execution log in the response. Applies to synchronously invoked functions only.

  • :client_context (String)

    Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object.

  • :qualifier (String)

    The alias name.

  • :payload (String, StringIO, File)

    The JSON that you want to provide to your Lambda function as input.

    You can enter the JSON directly. For example, --payload '\{ "key": "value" \}'. You can also specify a file path. For example, --payload file://payload.json.

Yields:

  • (event_stream_handler)

Returns:

See Also:



3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 3525

def invoke_with_response_stream(params = {}, options = {}, &block)
  params = params.dup
  event_stream_handler = case handler = params.delete(:event_stream_handler)
    when EventStreams::InvokeWithResponseStreamResponseEvent then handler
    when Proc then EventStreams::InvokeWithResponseStreamResponseEvent.new.tap(&handler)
    when nil then EventStreams::InvokeWithResponseStreamResponseEvent.new
    else
      msg = "expected :event_stream_handler to be a block or "\
            "instance of Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent"\
            ", got `#{handler.inspect}` instead"
      raise ArgumentError, msg
    end

  yield(event_stream_handler) if block_given?

  req = build_request(:invoke_with_response_stream, params)

  req.context[:event_stream_handler] = event_stream_handler
  req.handlers.add(Aws::Binary::DecodeHandler, priority: 95)

  req.send_request(options, &block)
end

#list_aliases(params = {}) ⇒ Types::ListAliasesResponse

Returns a list of aliases for a Lambda function.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_aliases({
  function_name: "FunctionName", # required
  function_version: "Version",
  marker: "String",
  max_items: 1,
})

Response structure


resp.next_marker #=> String
resp.aliases #=> Array
resp.aliases[0].alias_arn #=> String
resp.aliases[0].name #=> String
resp.aliases[0].function_version #=> String
resp.aliases[0].description #=> String
resp.aliases[0].routing_config.additional_version_weights #=> Hash
resp.aliases[0].routing_config.additional_version_weights["AdditionalVersion"] #=> Float
resp.aliases[0].revision_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function name - MyFunction.

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Partial ARN - 123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :function_version (String)

    Specify a function version to only list aliases that invoke that version.

  • :marker (String)

    Specify the pagination token that's returned by a previous request to retrieve the next page of results.

  • :max_items (Integer)

    Limit the number of aliases returned.

Returns:

See Also:



3612
3613
3614
3615
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 3612

def list_aliases(params = {}, options = {})
  req = build_request(:list_aliases, params)
  req.send_request(options)
end

#list_code_signing_configs(params = {}) ⇒ Types::ListCodeSigningConfigsResponse

Returns a list of code signing configurations. A request returns up to 10,000 configurations per call. You can use the MaxItems parameter to return fewer configurations per call.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_code_signing_configs({
  marker: "String",
  max_items: 1,
})

Response structure


resp.next_marker #=> String
resp.code_signing_configs #=> Array
resp.code_signing_configs[0].code_signing_config_id #=> String
resp.code_signing_configs[0].code_signing_config_arn #=> String
resp.code_signing_configs[0].description #=> String
resp.code_signing_configs[0].allowed_publishers.signing_profile_version_arns #=> Array
resp.code_signing_configs[0].allowed_publishers.signing_profile_version_arns[0] #=> String
resp.code_signing_configs[0].code_signing_policies.untrusted_artifact_on_deployment #=> String, one of "Warn", "Enforce"
resp.code_signing_configs[0].last_modified #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :marker (String)

    Specify the pagination token that's returned by a previous request to retrieve the next page of results.

  • :max_items (Integer)

    Maximum number of items to return.

Returns:

See Also:



3662
3663
3664
3665
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 3662

def list_code_signing_configs(params = {}, options = {})
  req = build_request(:list_code_signing_configs, params)
  req.send_request(options)
end

#list_event_source_mappings(params = {}) ⇒ Types::ListEventSourceMappingsResponse

Lists event source mappings. Specify an EventSourceArn to show only event source mappings for a single event source.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_event_source_mappings({
  event_source_arn: "Arn",
  function_name: "FunctionName",
  marker: "String",
  max_items: 1,
})

Response structure


resp.next_marker #=> String
resp.event_source_mappings #=> Array
resp.event_source_mappings[0].uuid #=> String
resp.event_source_mappings[0].starting_position #=> String, one of "TRIM_HORIZON", "LATEST", "AT_TIMESTAMP"
resp.event_source_mappings[0].starting_position_timestamp #=> Time
resp.event_source_mappings[0].batch_size #=> Integer
resp.event_source_mappings[0].maximum_batching_window_in_seconds #=> Integer
resp.event_source_mappings[0].parallelization_factor #=> Integer
resp.event_source_mappings[0].event_source_arn #=> String
resp.event_source_mappings[0].filter_criteria.filters #=> Array
resp.event_source_mappings[0].filter_criteria.filters[0].pattern #=> String
resp.event_source_mappings[0].function_arn #=> String
resp.event_source_mappings[0].last_modified #=> Time
resp.event_source_mappings[0].last_processing_result #=> String
resp.event_source_mappings[0].state #=> String
resp.event_source_mappings[0].state_transition_reason #=> String
resp.event_source_mappings[0].destination_config.on_success.destination #=> String
resp.event_source_mappings[0].destination_config.on_failure.destination #=> String
resp.event_source_mappings[0].topics #=> Array
resp.event_source_mappings[0].topics[0] #=> String
resp.event_source_mappings[0].queues #=> Array
resp.event_source_mappings[0].queues[0] #=> String
resp.event_source_mappings[0].source_access_configurations #=> Array
resp.event_source_mappings[0].source_access_configurations[0].type #=> String, one of "BASIC_AUTH", "VPC_SUBNET", "VPC_SECURITY_GROUP", "SASL_SCRAM_512_AUTH", "SASL_SCRAM_256_AUTH", "VIRTUAL_HOST", "CLIENT_CERTIFICATE_TLS_AUTH", "SERVER_ROOT_CA_CERTIFICATE"
resp.event_source_mappings[0].source_access_configurations[0].uri #=> String
resp.event_source_mappings[0].self_managed_event_source.endpoints #=> Hash
resp.event_source_mappings[0].self_managed_event_source.endpoints["EndPointType"] #=> Array
resp.event_source_mappings[0].self_managed_event_source.endpoints["EndPointType"][0] #=> String
resp.event_source_mappings[0].maximum_record_age_in_seconds #=> Integer
resp.event_source_mappings[0].bisect_batch_on_function_error #=> Boolean
resp.event_source_mappings[0].maximum_retry_attempts #=> Integer
resp.event_source_mappings[0].tumbling_window_in_seconds #=> Integer
resp.event_source_mappings[0].function_response_types #=> Array
resp.event_source_mappings[0].function_response_types[0] #=> String, one of "ReportBatchItemFailures"
resp.event_source_mappings[0].amazon_managed_kafka_event_source_config.consumer_group_id #=> String
resp.event_source_mappings[0].self_managed_kafka_event_source_config.consumer_group_id #=> String
resp.event_source_mappings[0].scaling_config.maximum_concurrency #=> Integer
resp.event_source_mappings[0].document_db_event_source_config.database_name #=> String
resp.event_source_mappings[0].document_db_event_source_config.collection_name #=> String
resp.event_source_mappings[0].document_db_event_source_config.full_document #=> String, one of "UpdateLookup", "Default"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :event_source_arn (String)

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

    • Amazon Kinesis – The ARN of the data stream or a stream consumer.

    • Amazon DynamoDB Streams – The ARN of the stream.

    • Amazon Simple Queue Service – The ARN of the queue.

    • Amazon Managed Streaming for Apache Kafka – The ARN of the cluster or the ARN of the VPC connection (for cross-account event source mappings).

    • Amazon MQ – The ARN of the broker.

    • Amazon DocumentDB – The ARN of the DocumentDB change stream.

  • :function_name (String)

    The name or ARN of the Lambda function.

    Name formats

    • Function nameMyFunction.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Version or Alias ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD.

    • Partial ARN123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.

  • :marker (String)

    A pagination token returned by a previous call.

  • :max_items (Integer)

    The maximum number of event source mappings to return. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher.

Returns:

See Also:



3781
3782
3783
3784
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 3781

def list_event_source_mappings(params = {}, options = {})
  req = build_request(:list_event_source_mappings, params)
  req.send_request(options)
end

#list_function_event_invoke_configs(params = {}) ⇒ Types::ListFunctionEventInvokeConfigsResponse

Retrieves a list of configurations for asynchronous invocation for a function.

To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_function_event_invoke_configs({
  function_name: "FunctionName", # required
  marker: "String",
  max_items: 1,
})

Response structure


resp.function_event_invoke_configs #=> Array
resp.function_event_invoke_configs[0].last_modified #=> Time
resp.function_event_invoke_configs[0].function_arn #=> String
resp.function_event_invoke_configs[0].maximum_retry_attempts #=> Integer
resp.function_event_invoke_configs[0].maximum_event_age_in_seconds #=> Integer
resp.function_event_invoke_configs[0].destination_config.on_success.destination #=> String
resp.function_event_invoke_configs[0].destination_config.on_failure.destination #=> String
resp.next_marker #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function name - my-function.

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN - 123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :marker (String)

    Specify the pagination token that's returned by a previous request to retrieve the next page of results.

  • :max_items (Integer)

    The maximum number of configurations to return.

Returns:

See Also:



3844
3845
3846
3847
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 3844

def list_function_event_invoke_configs(params = {}, options = {})
  req = build_request(:list_function_event_invoke_configs, params)
  req.send_request(options)
end

#list_function_url_configs(params = {}) ⇒ Types::ListFunctionUrlConfigsResponse

Returns a list of Lambda function URLs for the specified function.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_function_url_configs({
  function_name: "FunctionName", # required
  marker: "String",
  max_items: 1,
})

Response structure


resp.function_url_configs #=> Array
resp.function_url_configs[0].function_url #=> String
resp.function_url_configs[0].function_arn #=> String
resp.function_url_configs[0].creation_time #=> Time
resp.function_url_configs[0].last_modified_time #=> Time
resp.function_url_configs[0].cors.allow_credentials #=> Boolean
resp.function_url_configs[0].cors.allow_headers #=> Array
resp.function_url_configs[0].cors.allow_headers[0] #=> String
resp.function_url_configs[0].cors.allow_methods #=> Array
resp.function_url_configs[0].cors.allow_methods[0] #=> String
resp.function_url_configs[0].cors.allow_origins #=> Array
resp.function_url_configs[0].cors.allow_origins[0] #=> String
resp.function_url_configs[0].cors.expose_headers #=> Array
resp.function_url_configs[0].cors.expose_headers[0] #=> String
resp.function_url_configs[0].cors.max_age #=> Integer
resp.function_url_configs[0].auth_type #=> String, one of "NONE", "AWS_IAM"
resp.function_url_configs[0].invoke_mode #=> String, one of "BUFFERED", "RESPONSE_STREAM"
resp.next_marker #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :marker (String)

    Specify the pagination token that's returned by a previous request to retrieve the next page of results.

  • :max_items (Integer)

    The maximum number of function URLs to return in the response. Note that ListFunctionUrlConfigs returns a maximum of 50 items in each response, even if you set the number higher.

Returns:

See Also:



3915
3916
3917
3918
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 3915

def list_function_url_configs(params = {}, options = {})
  req = build_request(:list_function_url_configs, params)
  req.send_request(options)
end

#list_functions(params = {}) ⇒ Types::ListFunctionsResponse

Returns a list of Lambda functions, with the version-specific configuration of each. Lambda returns up to 50 functions per call.

Set FunctionVersion to ALL to include all published versions of each function in addition to the unpublished version.

The ListFunctions operation returns a subset of the FunctionConfiguration fields. To get the additional fields (State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason, LastUpdateStatusReasonCode, RuntimeVersionConfig) for a function or version, use GetFunction.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_functions({
  master_region: "MasterRegion",
  function_version: "ALL", # accepts ALL
  marker: "String",
  max_items: 1,
})

Response structure


resp.next_marker #=> String
resp.functions #=> Array
resp.functions[0].function_name #=> String
resp.functions[0].function_arn #=> String
resp.functions[0].runtime #=> String, one of "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "nodejs10.x", "nodejs12.x", "nodejs14.x", "nodejs16.x", "java8", "java8.al2", "java11", "python2.7", "python3.6", "python3.7", "python3.8", "python3.9", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "dotnet6", "dotnet8", "nodejs4.3-edge", "go1.x", "ruby2.5", "ruby2.7", "provided", "provided.al2", "nodejs18.x", "python3.10", "java17", "ruby3.2", "python3.11", "nodejs20.x", "provided.al2023", "python3.12", "java21"
resp.functions[0].role #=> String
resp.functions[0].handler #=> String
resp.functions[0].code_size #=> Integer
resp.functions[0].description #=> String
resp.functions[0].timeout #=> Integer
resp.functions[0].memory_size #=> Integer
resp.functions[0].last_modified #=> Time
resp.functions[0].code_sha_256 #=> String
resp.functions[0].version #=> String
resp.functions[0].vpc_config.subnet_ids #=> Array
resp.functions[0].vpc_config.subnet_ids[0] #=> String
resp.functions[0].vpc_config.security_group_ids #=> Array
resp.functions[0].vpc_config.security_group_ids[0] #=> String
resp.functions[0].vpc_config.vpc_id #=> String
resp.functions[0].vpc_config.ipv_6_allowed_for_dual_stack #=> Boolean
resp.functions[0].dead_letter_config.target_arn #=> String
resp.functions[0].environment.variables #=> Hash
resp.functions[0].environment.variables["EnvironmentVariableName"] #=> String
resp.functions[0].environment.error.error_code #=> String
resp.functions[0].environment.error.message #=> String
resp.functions[0].kms_key_arn #=> String
resp.functions[0].tracing_config.mode #=> String, one of "Active", "PassThrough"
resp.functions[0].master_arn #=> String
resp.functions[0].revision_id #=> String
resp.functions[0].layers #=> Array
resp.functions[0].layers[0].arn #=> String
resp.functions[0].layers[0].code_size #=> Integer
resp.functions[0].layers[0].signing_profile_version_arn #=> String
resp.functions[0].layers[0].signing_job_arn #=> String
resp.functions[0].state #=> String, one of "Pending", "Active", "Inactive", "Failed"
resp.functions[0].state_reason #=> String
resp.functions[0].state_reason_code #=> String, one of "Idle", "Creating", "Restoring", "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.functions[0].last_update_status #=> String, one of "Successful", "Failed", "InProgress"
resp.functions[0].last_update_status_reason #=> String
resp.functions[0].last_update_status_reason_code #=> String, one of "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.functions[0].file_system_configs #=> Array
resp.functions[0].file_system_configs[0].arn #=> String
resp.functions[0].file_system_configs[0].local_mount_path #=> String
resp.functions[0].package_type #=> String, one of "Zip", "Image"
resp.functions[0].image_config_response.image_config.entry_point #=> Array
resp.functions[0].image_config_response.image_config.entry_point[0] #=> String
resp.functions[0].image_config_response.image_config.command #=> Array
resp.functions[0].image_config_response.image_config.command[0] #=> String
resp.functions[0].image_config_response.image_config.working_directory #=> String
resp.functions[0].image_config_response.error.error_code #=> String
resp.functions[0].image_config_response.error.message #=> String
resp.functions[0].signing_profile_version_arn #=> String
resp.functions[0].signing_job_arn #=> String
resp.functions[0].architectures #=> Array
resp.functions[0].architectures[0] #=> String, one of "x86_64", "arm64"
resp.functions[0].ephemeral_storage.size #=> Integer
resp.functions[0].snap_start.apply_on #=> String, one of "PublishedVersions", "None"
resp.functions[0].snap_start.optimization_status #=> String, one of "On", "Off"
resp.functions[0].runtime_version_config.runtime_version_arn #=> String
resp.functions[0].runtime_version_config.error.error_code #=> String
resp.functions[0].runtime_version_config.error.message #=> String
resp.functions[0].logging_config.log_format #=> String, one of "JSON", "Text"
resp.functions[0].logging_config.application_log_level #=> String, one of "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"
resp.functions[0].logging_config.system_log_level #=> String, one of "DEBUG", "INFO", "WARN"
resp.functions[0].logging_config.log_group #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :master_region (String)

    For Lambda@Edge functions, the Amazon Web Services Region of the master function. For example, us-east-1 filters the list of functions to include only Lambda@Edge functions replicated from a master function in US East (N. Virginia). If specified, you must set FunctionVersion to ALL.

  • :function_version (String)

    Set to ALL to include entries for all published versions of each function.

  • :marker (String)

    Specify the pagination token that's returned by a previous request to retrieve the next page of results.

  • :max_items (Integer)

    The maximum number of functions to return in the response. Note that ListFunctions returns a maximum of 50 items in each response, even if you set the number higher.

Returns:

See Also:



4042
4043
4044
4045
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 4042

def list_functions(params = {}, options = {})
  req = build_request(:list_functions, params)
  req.send_request(options)
end

#list_functions_by_code_signing_config(params = {}) ⇒ Types::ListFunctionsByCodeSigningConfigResponse

List the functions that use the specified code signing configuration. You can use this method prior to deleting a code signing configuration, to verify that no functions are using it.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_functions_by_code_signing_config({
  code_signing_config_arn: "CodeSigningConfigArn", # required
  marker: "String",
  max_items: 1,
})

Response structure


resp.next_marker #=> String
resp.function_arns #=> Array
resp.function_arns[0] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :code_signing_config_arn (required, String)

    The The Amazon Resource Name (ARN) of the code signing configuration.

  • :marker (String)

    Specify the pagination token that's returned by a previous request to retrieve the next page of results.

  • :max_items (Integer)

    Maximum number of items to return.

Returns:

See Also:



4086
4087
4088
4089
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 4086

def list_functions_by_code_signing_config(params = {}, options = {})
  req = build_request(:list_functions_by_code_signing_config, params)
  req.send_request(options)
end

#list_layer_versions(params = {}) ⇒ Types::ListLayerVersionsResponse

Lists the versions of an Lambda layer. Versions that have been deleted aren't listed. Specify a runtime identifier to list only versions that indicate that they're compatible with that runtime. Specify a compatible architecture to include only layer versions that are compatible with that architecture.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_layer_versions({
  compatible_runtime: "nodejs", # accepts nodejs, nodejs4.3, nodejs6.10, nodejs8.10, nodejs10.x, nodejs12.x, nodejs14.x, nodejs16.x, java8, java8.al2, java11, python2.7, python3.6, python3.7, python3.8, python3.9, dotnetcore1.0, dotnetcore2.0, dotnetcore2.1, dotnetcore3.1, dotnet6, dotnet8, nodejs4.3-edge, go1.x, ruby2.5, ruby2.7, provided, provided.al2, nodejs18.x, python3.10, java17, ruby3.2, python3.11, nodejs20.x, provided.al2023, python3.12, java21
  layer_name: "LayerName", # required
  marker: "String",
  max_items: 1,
  compatible_architecture: "x86_64", # accepts x86_64, arm64
})

Response structure


resp.next_marker #=> String
resp.layer_versions #=> Array
resp.layer_versions[0].layer_version_arn #=> String
resp.layer_versions[0].version #=> Integer
resp.layer_versions[0].description #=> String
resp.layer_versions[0].created_date #=> Time
resp.layer_versions[0].compatible_runtimes #=> Array
resp.layer_versions[0].compatible_runtimes[0] #=> String, one of "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "nodejs10.x", "nodejs12.x", "nodejs14.x", "nodejs16.x", "java8", "java8.al2", "java11", "python2.7", "python3.6", "python3.7", "python3.8", "python3.9", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "dotnet6", "dotnet8", "nodejs4.3-edge", "go1.x", "ruby2.5", "ruby2.7", "provided", "provided.al2", "nodejs18.x", "python3.10", "java17", "ruby3.2", "python3.11", "nodejs20.x", "provided.al2023", "python3.12", "java21"
resp.layer_versions[0].license_info #=> String
resp.layer_versions[0].compatible_architectures #=> Array
resp.layer_versions[0].compatible_architectures[0] #=> String, one of "x86_64", "arm64"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :compatible_runtime (String)

    A runtime identifier. For example, java21.

    The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

  • :layer_name (required, String)

    The name or Amazon Resource Name (ARN) of the layer.

  • :marker (String)

    A pagination token returned by a previous call.

  • :max_items (Integer)

    The maximum number of versions to return.

  • :compatible_architecture (String)

Returns:

See Also:



4163
4164
4165
4166
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 4163

def list_layer_versions(params = {}, options = {})
  req = build_request(:list_layer_versions, params)
  req.send_request(options)
end

#list_layers(params = {}) ⇒ Types::ListLayersResponse

Lists Lambda layers and shows information about the latest version of each. Specify a runtime identifier to list only layers that indicate that they're compatible with that runtime. Specify a compatible architecture to include only layers that are compatible with that instruction set architecture.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_layers({
  compatible_runtime: "nodejs", # accepts nodejs, nodejs4.3, nodejs6.10, nodejs8.10, nodejs10.x, nodejs12.x, nodejs14.x, nodejs16.x, java8, java8.al2, java11, python2.7, python3.6, python3.7, python3.8, python3.9, dotnetcore1.0, dotnetcore2.0, dotnetcore2.1, dotnetcore3.1, dotnet6, dotnet8, nodejs4.3-edge, go1.x, ruby2.5, ruby2.7, provided, provided.al2, nodejs18.x, python3.10, java17, ruby3.2, python3.11, nodejs20.x, provided.al2023, python3.12, java21
  marker: "String",
  max_items: 1,
  compatible_architecture: "x86_64", # accepts x86_64, arm64
})

Response structure


resp.next_marker #=> String
resp.layers #=> Array
resp.layers[0].layer_name #=> String
resp.layers[0].layer_arn #=> String
resp.layers[0].latest_matching_version.layer_version_arn #=> String
resp.layers[0].latest_matching_version.version #=> Integer
resp.layers[0].latest_matching_version.description #=> String
resp.layers[0].latest_matching_version.created_date #=> Time
resp.layers[0].latest_matching_version.compatible_runtimes #=> Array
resp.layers[0].latest_matching_version.compatible_runtimes[0] #=> String, one of "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "nodejs10.x", "nodejs12.x", "nodejs14.x", "nodejs16.x", "java8", "java8.al2", "java11", "python2.7", "python3.6", "python3.7", "python3.8", "python3.9", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "dotnet6", "dotnet8", "nodejs4.3-edge", "go1.x", "ruby2.5", "ruby2.7", "provided", "provided.al2", "nodejs18.x", "python3.10", "java17", "ruby3.2", "python3.11", "nodejs20.x", "provided.al2023", "python3.12", "java21"
resp.layers[0].latest_matching_version.license_info #=> String
resp.layers[0].latest_matching_version.compatible_architectures #=> Array
resp.layers[0].latest_matching_version.compatible_architectures[0] #=> String, one of "x86_64", "arm64"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :compatible_runtime (String)

    A runtime identifier. For example, java21.

    The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

  • :marker (String)

    A pagination token returned by a previous call.

  • :max_items (Integer)

    The maximum number of layers to return.

  • :compatible_architecture (String)

Returns:

See Also:



4239
4240
4241
4242
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 4239

def list_layers(params = {}, options = {})
  req = build_request(:list_layers, params)
  req.send_request(options)
end

#list_provisioned_concurrency_configs(params = {}) ⇒ Types::ListProvisionedConcurrencyConfigsResponse

Retrieves a list of provisioned concurrency configurations for a function.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_provisioned_concurrency_configs({
  function_name: "FunctionName", # required
  marker: "String",
  max_items: 1,
})

Response structure


resp.provisioned_concurrency_configs #=> Array
resp.provisioned_concurrency_configs[0].function_arn #=> String
resp.provisioned_concurrency_configs[0].requested_provisioned_concurrent_executions #=> Integer
resp.provisioned_concurrency_configs[0].available_provisioned_concurrent_executions #=> Integer
resp.provisioned_concurrency_configs[0].allocated_provisioned_concurrent_executions #=> Integer
resp.provisioned_concurrency_configs[0].status #=> String, one of "IN_PROGRESS", "READY", "FAILED"
resp.provisioned_concurrency_configs[0].status_reason #=> String
resp.provisioned_concurrency_configs[0].last_modified #=> Time
resp.next_marker #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :marker (String)

    Specify the pagination token that's returned by a previous request to retrieve the next page of results.

  • :max_items (Integer)

    Specify a number to limit the number of configurations returned.

Returns:

See Also:



4300
4301
4302
4303
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 4300

def list_provisioned_concurrency_configs(params = {}, options = {})
  req = build_request(:list_provisioned_concurrency_configs, params)
  req.send_request(options)
end

#list_tags(params = {}) ⇒ Types::ListTagsResponse

Returns a function's tags. You can also view tags with GetFunction.

Examples:

Request syntax with placeholder values


resp = client.list_tags({
  resource: "FunctionArn", # required
})

Response structure


resp.tags #=> Hash
resp.tags["TagKey"] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :resource (required, String)

    The function's Amazon Resource Name (ARN). Note: Lambda does not support adding tags to aliases or versions.

Returns:

See Also:



4335
4336
4337
4338
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 4335

def list_tags(params = {}, options = {})
  req = build_request(:list_tags, params)
  req.send_request(options)
end

#list_versions_by_function(params = {}) ⇒ Types::ListVersionsByFunctionResponse

Returns a list of versions, with the version-specific configuration of each. Lambda returns up to 50 versions per call.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_versions_by_function({
  function_name: "NamespacedFunctionName", # required
  marker: "String",
  max_items: 1,
})

Response structure


resp.next_marker #=> String
resp.versions #=> Array
resp.versions[0].function_name #=> String
resp.versions[0].function_arn #=> String
resp.versions[0].runtime #=> String, one of "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "nodejs10.x", "nodejs12.x", "nodejs14.x", "nodejs16.x", "java8", "java8.al2", "java11", "python2.7", "python3.6", "python3.7", "python3.8", "python3.9", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "dotnet6", "dotnet8", "nodejs4.3-edge", "go1.x", "ruby2.5", "ruby2.7", "provided", "provided.al2", "nodejs18.x", "python3.10", "java17", "ruby3.2", "python3.11", "nodejs20.x", "provided.al2023", "python3.12", "java21"
resp.versions[0].role #=> String
resp.versions[0].handler #=> String
resp.versions[0].code_size #=> Integer
resp.versions[0].description #=> String
resp.versions[0].timeout #=> Integer
resp.versions[0].memory_size #=> Integer
resp.versions[0].last_modified #=> Time
resp.versions[0].code_sha_256 #=> String
resp.versions[0].version #=> String
resp.versions[0].vpc_config.subnet_ids #=> Array
resp.versions[0].vpc_config.subnet_ids[0] #=> String
resp.versions[0].vpc_config.security_group_ids #=> Array
resp.versions[0].vpc_config.security_group_ids[0] #=> String
resp.versions[0].vpc_config.vpc_id #=> String
resp.versions[0].vpc_config.ipv_6_allowed_for_dual_stack #=> Boolean
resp.versions[0].dead_letter_config.target_arn #=> String
resp.versions[0].environment.variables #=> Hash
resp.versions[0].environment.variables["EnvironmentVariableName"] #=> String
resp.versions[0].environment.error.error_code #=> String
resp.versions[0].environment.error.message #=> String
resp.versions[0].kms_key_arn #=> String
resp.versions[0].tracing_config.mode #=> String, one of "Active", "PassThrough"
resp.versions[0].master_arn #=> String
resp.versions[0].revision_id #=> String
resp.versions[0].layers #=> Array
resp.versions[0].layers[0].arn #=> String
resp.versions[0].layers[0].code_size #=> Integer
resp.versions[0].layers[0].signing_profile_version_arn #=> String
resp.versions[0].layers[0].signing_job_arn #=> String
resp.versions[0].state #=> String, one of "Pending", "Active", "Inactive", "Failed"
resp.versions[0].state_reason #=> String
resp.versions[0].state_reason_code #=> String, one of "Idle", "Creating", "Restoring", "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.versions[0].last_update_status #=> String, one of "Successful", "Failed", "InProgress"
resp.versions[0].last_update_status_reason #=> String
resp.versions[0].last_update_status_reason_code #=> String, one of "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.versions[0].file_system_configs #=> Array
resp.versions[0].file_system_configs[0].arn #=> String
resp.versions[0].file_system_configs[0].local_mount_path #=> String
resp.versions[0].package_type #=> String, one of "Zip", "Image"
resp.versions[0].image_config_response.image_config.entry_point #=> Array
resp.versions[0].image_config_response.image_config.entry_point[0] #=> String
resp.versions[0].image_config_response.image_config.command #=> Array
resp.versions[0].image_config_response.image_config.command[0] #=> String
resp.versions[0].image_config_response.image_config.working_directory #=> String
resp.versions[0].image_config_response.error.error_code #=> String
resp.versions[0].image_config_response.error.message #=> String
resp.versions[0].signing_profile_version_arn #=> String
resp.versions[0].signing_job_arn #=> String
resp.versions[0].architectures #=> Array
resp.versions[0].architectures[0] #=> String, one of "x86_64", "arm64"
resp.versions[0].ephemeral_storage.size #=> Integer
resp.versions[0].snap_start.apply_on #=> String, one of "PublishedVersions", "None"
resp.versions[0].snap_start.optimization_status #=> String, one of "On", "Off"
resp.versions[0].runtime_version_config.runtime_version_arn #=> String
resp.versions[0].runtime_version_config.error.error_code #=> String
resp.versions[0].runtime_version_config.error.message #=> String
resp.versions[0].logging_config.log_format #=> String, one of "JSON", "Text"
resp.versions[0].logging_config.application_log_level #=> String, one of "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"
resp.versions[0].logging_config.system_log_level #=> String, one of "DEBUG", "INFO", "WARN"
resp.versions[0].logging_config.log_group #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function name - MyFunction.

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Partial ARN - 123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :marker (String)

    Specify the pagination token that's returned by a previous request to retrieve the next page of results.

  • :max_items (Integer)

    The maximum number of versions to return. Note that ListVersionsByFunction returns a maximum of 50 items in each response, even if you set the number higher.

Returns:

See Also:



4458
4459
4460
4461
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 4458

def list_versions_by_function(params = {}, options = {})
  req = build_request(:list_versions_by_function, params)
  req.send_request(options)
end

#publish_layer_version(params = {}) ⇒ Types::PublishLayerVersionResponse

Creates an Lambda layer from a ZIP archive. Each time you call PublishLayerVersion with the same layer name, a new version is created.

Add layers to your function with CreateFunction or UpdateFunctionConfiguration.

Examples:

Request syntax with placeholder values


resp = client.publish_layer_version({
  layer_name: "LayerName", # required
  description: "Description",
  content: { # required
    s3_bucket: "S3Bucket",
    s3_key: "S3Key",
    s3_object_version: "S3ObjectVersion",
    zip_file: "data",
  },
  compatible_runtimes: ["nodejs"], # accepts nodejs, nodejs4.3, nodejs6.10, nodejs8.10, nodejs10.x, nodejs12.x, nodejs14.x, nodejs16.x, java8, java8.al2, java11, python2.7, python3.6, python3.7, python3.8, python3.9, dotnetcore1.0, dotnetcore2.0, dotnetcore2.1, dotnetcore3.1, dotnet6, dotnet8, nodejs4.3-edge, go1.x, ruby2.5, ruby2.7, provided, provided.al2, nodejs18.x, python3.10, java17, ruby3.2, python3.11, nodejs20.x, provided.al2023, python3.12, java21
  license_info: "LicenseInfo",
  compatible_architectures: ["x86_64"], # accepts x86_64, arm64
})

Response structure


resp.content.location #=> String
resp.content.code_sha_256 #=> String
resp.content.code_size #=> Integer
resp.content.signing_profile_version_arn #=> String
resp.content.signing_job_arn #=> String
resp.layer_arn #=> String
resp.layer_version_arn #=> String
resp.description #=> String
resp.created_date #=> Time
resp.version #=> Integer
resp.compatible_runtimes #=> Array
resp.compatible_runtimes[0] #=> String, one of "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "nodejs10.x", "nodejs12.x", "nodejs14.x", "nodejs16.x", "java8", "java8.al2", "java11", "python2.7", "python3.6", "python3.7", "python3.8", "python3.9", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "dotnet6", "dotnet8", "nodejs4.3-edge", "go1.x", "ruby2.5", "ruby2.7", "provided", "provided.al2", "nodejs18.x", "python3.10", "java17", "ruby3.2", "python3.11", "nodejs20.x", "provided.al2023", "python3.12", "java21"
resp.license_info #=> String
resp.compatible_architectures #=> Array
resp.compatible_architectures[0] #=> String, one of "x86_64", "arm64"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :layer_name (required, String)

    The name or Amazon Resource Name (ARN) of the layer.

  • :description (String)

    The description of the version.

  • :content (required, Types::LayerVersionContentInput)

    The function layer archive.

  • :compatible_runtimes (Array<String>)

    A list of compatible function runtimes. Used for filtering with ListLayers and ListLayerVersions.

    The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

  • :license_info (String)

    The layer's software license. It can be any of the following:

    • An SPDX license identifier. For example, MIT.

    • The URL of a license hosted on the internet. For example, https://opensource.org/licenses/MIT.

    • The full text of the license.

  • :compatible_architectures (Array<String>)

    A list of compatible instruction set architectures.

Returns:

See Also:



4566
4567
4568
4569
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 4566

def publish_layer_version(params = {}, options = {})
  req = build_request(:publish_layer_version, params)
  req.send_request(options)
end

#publish_version(params = {}) ⇒ Types::FunctionConfiguration

Creates a version from the current code and configuration of a function. Use versions to create a snapshot of your function code and configuration that doesn't change.

Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version. Use UpdateFunctionCode or UpdateFunctionConfiguration to update the function before publishing a version.

Clients can invoke versions directly or with an alias. To create an alias, use CreateAlias.

Examples:

Request syntax with placeholder values


resp = client.publish_version({
  function_name: "FunctionName", # required
  code_sha_256: "String",
  description: "Description",
  revision_id: "String",
})

Response structure


resp.function_name #=> String
resp.function_arn #=> String
resp.runtime #=> String, one of "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "nodejs10.x", "nodejs12.x", "nodejs14.x", "nodejs16.x", "java8", "java8.al2", "java11", "python2.7", "python3.6", "python3.7", "python3.8", "python3.9", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "dotnet6", "dotnet8", "nodejs4.3-edge", "go1.x", "ruby2.5", "ruby2.7", "provided", "provided.al2", "nodejs18.x", "python3.10", "java17", "ruby3.2", "python3.11", "nodejs20.x", "provided.al2023", "python3.12", "java21"
resp.role #=> String
resp.handler #=> String
resp.code_size #=> Integer
resp.description #=> String
resp.timeout #=> Integer
resp.memory_size #=> Integer
resp.last_modified #=> Time
resp.code_sha_256 #=> String
resp.version #=> String
resp.vpc_config.subnet_ids #=> Array
resp.vpc_config.subnet_ids[0] #=> String
resp.vpc_config.security_group_ids #=> Array
resp.vpc_config.security_group_ids[0] #=> String
resp.vpc_config.vpc_id #=> String
resp.vpc_config.ipv_6_allowed_for_dual_stack #=> Boolean
resp.dead_letter_config.target_arn #=> String
resp.environment.variables #=> Hash
resp.environment.variables["EnvironmentVariableName"] #=> String
resp.environment.error.error_code #=> String
resp.environment.error.message #=> String
resp.kms_key_arn #=> String
resp.tracing_config.mode #=> String, one of "Active", "PassThrough"
resp.master_arn #=> String
resp.revision_id #=> String
resp.layers #=> Array
resp.layers[0].arn #=> String
resp.layers[0].code_size #=> Integer
resp.layers[0].signing_profile_version_arn #=> String
resp.layers[0].signing_job_arn #=> String
resp.state #=> String, one of "Pending", "Active", "Inactive", "Failed"
resp.state_reason #=> String
resp.state_reason_code #=> String, one of "Idle", "Creating", "Restoring", "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.last_update_status #=> String, one of "Successful", "Failed", "InProgress"
resp.last_update_status_reason #=> String
resp.last_update_status_reason_code #=> String, one of "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.file_system_configs #=> Array
resp.file_system_configs[0].arn #=> String
resp.file_system_configs[0].local_mount_path #=> String
resp.package_type #=> String, one of "Zip", "Image"
resp.image_config_response.image_config.entry_point #=> Array
resp.image_config_response.image_config.entry_point[0] #=> String
resp.image_config_response.image_config.command #=> Array
resp.image_config_response.image_config.command[0] #=> String
resp.image_config_response.image_config.working_directory #=> String
resp.image_config_response.error.error_code #=> String
resp.image_config_response.error.message #=> String
resp.signing_profile_version_arn #=> String
resp.signing_job_arn #=> String
resp.architectures #=> Array
resp.architectures[0] #=> String, one of "x86_64", "arm64"
resp.ephemeral_storage.size #=> Integer
resp.snap_start.apply_on #=> String, one of "PublishedVersions", "None"
resp.snap_start.optimization_status #=> String, one of "On", "Off"
resp.runtime_version_config.runtime_version_arn #=> String
resp.runtime_version_config.error.error_code #=> String
resp.runtime_version_config.error.message #=> String
resp.logging_config.log_format #=> String, one of "JSON", "Text"
resp.logging_config.application_log_level #=> String, one of "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"
resp.logging_config.system_log_level #=> String, one of "DEBUG", "INFO", "WARN"
resp.logging_config.log_group #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function name - MyFunction.

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Partial ARN - 123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :code_sha_256 (String)

    Only publish a version if the hash value matches the value that's specified. Use this option to avoid publishing a version if the function code has changed since you last updated it. You can get the hash for the version that you uploaded from the output of UpdateFunctionCode.

  • :description (String)

    A description for the version to override the description in the function configuration.

  • :revision_id (String)

    Only update the function if the revision ID matches the ID that's specified. Use this option to avoid publishing a version if the function configuration has changed since you last updated it.

Returns:

See Also:



4736
4737
4738
4739
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 4736

def publish_version(params = {}, options = {})
  req = build_request(:publish_version, params)
  req.send_request(options)
end

#put_function_code_signing_config(params = {}) ⇒ Types::PutFunctionCodeSigningConfigResponse

Update the code signing configuration for the function. Changes to the code signing configuration take effect the next time a user tries to deploy a code package to the function.

Examples:

Request syntax with placeholder values


resp = client.put_function_code_signing_config({
  code_signing_config_arn: "CodeSigningConfigArn", # required
  function_name: "FunctionName", # required
})

Response structure


resp.code_signing_config_arn #=> String
resp.function_name #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :code_signing_config_arn (required, String)

    The The Amazon Resource Name (ARN) of the code signing configuration.

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function name - MyFunction.

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Partial ARN - 123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

Returns:

See Also:



4784
4785
4786
4787
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 4784

def put_function_code_signing_config(params = {}, options = {})
  req = build_request(:put_function_code_signing_config, params)
  req.send_request(options)
end

#put_function_concurrency(params = {}) ⇒ Types::Concurrency

Sets the maximum number of simultaneous executions for a function, and reserves capacity for that concurrency level.

Concurrency settings apply to the function as a whole, including all published versions and the unpublished version. Reserving concurrency both ensures that your function has capacity to process the specified number of events simultaneously, and prevents it from scaling beyond that level. Use GetFunction to see the current setting for a function.

Use GetAccountSettings to see your Regional concurrency limit. You can reserve concurrency for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that aren't configured with a per-function limit. For more information, see Lambda function scaling.

Examples:

Request syntax with placeholder values


resp = client.put_function_concurrency({
  function_name: "FunctionName", # required
  reserved_concurrent_executions: 1, # required
})

Response structure


resp.reserved_concurrent_executions #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :reserved_concurrent_executions (required, Integer)

    The number of simultaneous executions to reserve for the function.

Returns:

See Also:



4845
4846
4847
4848
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 4845

def put_function_concurrency(params = {}, options = {})
  req = build_request(:put_function_concurrency, params)
  req.send_request(options)
end

#put_function_event_invoke_config(params = {}) ⇒ Types::FunctionEventInvokeConfig

Configures options for asynchronous invocation on a function, version, or alias. If a configuration already exists for a function, version, or alias, this operation overwrites it. If you exclude any settings, they are removed. To set one option without affecting existing settings for other options, use UpdateFunctionEventInvokeConfig.

By default, Lambda retries an asynchronous invocation twice if the function returns an error. It retains events in a queue for up to six hours. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it. To retain discarded events, configure a dead-letter queue with UpdateFunctionConfiguration.

To send an invocation record to a queue, topic, function, or event bus, specify a destination. You can configure separate destinations for successful invocations (on-success) and events that fail all processing attempts (on-failure). You can configure destinations in addition to or instead of a dead-letter queue.

Examples:

Request syntax with placeholder values


resp = client.put_function_event_invoke_config({
  function_name: "FunctionName", # required
  qualifier: "Qualifier",
  maximum_retry_attempts: 1,
  maximum_event_age_in_seconds: 1,
  destination_config: {
    on_success: {
      destination: "DestinationArn",
    },
    on_failure: {
      destination: "DestinationArn",
    },
  },
})

Response structure


resp.last_modified #=> Time
resp.function_arn #=> String
resp.maximum_retry_attempts #=> Integer
resp.maximum_event_age_in_seconds #=> Integer
resp.destination_config.on_success.destination #=> String
resp.destination_config.on_failure.destination #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function, version, or alias.

    Name formats

    • Function name - my-function (name-only), my-function:v1 (with alias).

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN - 123456789012:function:my-function.

    You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (String)

    A version number or alias name.

  • :maximum_retry_attempts (Integer)

    The maximum number of times to retry when the function returns an error.

  • :maximum_event_age_in_seconds (Integer)

    The maximum age of a request that Lambda sends to a function for processing.

  • :destination_config (Types::DestinationConfig)

    A destination for events after they have been sent to a function for processing.

    Destinations

    • Function - The Amazon Resource Name (ARN) of a Lambda function.

    • Queue - The ARN of a standard SQS queue.

    • Topic - The ARN of a standard SNS topic.

    • Event Bus - The ARN of an Amazon EventBridge event bus.

Returns:

See Also:



4955
4956
4957
4958
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 4955

def put_function_event_invoke_config(params = {}, options = {})
  req = build_request(:put_function_event_invoke_config, params)
  req.send_request(options)
end

#put_provisioned_concurrency_config(params = {}) ⇒ Types::PutProvisionedConcurrencyConfigResponse

Adds a provisioned concurrency configuration to a function's alias or version.

Examples:

Request syntax with placeholder values


resp = client.put_provisioned_concurrency_config({
  function_name: "FunctionName", # required
  qualifier: "Qualifier", # required
  provisioned_concurrent_executions: 1, # required
})

Response structure


resp.requested_provisioned_concurrent_executions #=> Integer
resp.available_provisioned_concurrent_executions #=> Integer
resp.allocated_provisioned_concurrent_executions #=> Integer
resp.status #=> String, one of "IN_PROGRESS", "READY", "FAILED"
resp.status_reason #=> String
resp.last_modified #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (required, String)

    The version number or alias name.

  • :provisioned_concurrent_executions (required, Integer)

    The amount of provisioned concurrency to allocate for the version or alias.

Returns:

See Also:



5015
5016
5017
5018
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 5015

def put_provisioned_concurrency_config(params = {}, options = {})
  req = build_request(:put_provisioned_concurrency_config, params)
  req.send_request(options)
end

#put_runtime_management_config(params = {}) ⇒ Types::PutRuntimeManagementConfigResponse

Sets the runtime management configuration for a function's version. For more information, see Runtime updates.

Examples:

Request syntax with placeholder values


resp = client.put_runtime_management_config({
  function_name: "FunctionName", # required
  qualifier: "Qualifier",
  update_runtime_on: "Auto", # required, accepts Auto, Manual, FunctionUpdate
  runtime_version_arn: "RuntimeVersionArn",
})

Response structure


resp.update_runtime_on #=> String, one of "Auto", "Manual", "FunctionUpdate"
resp.function_arn #=> String
resp.runtime_version_arn #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (String)

    Specify a version of the function. This can be $LATEST or a published version number. If no value is specified, the configuration for the $LATEST version is returned.

  • :update_runtime_on (required, String)

    Specify the runtime update mode.

    • Auto (default) - Automatically update to the most recent and secure runtime version using a Two-phase runtime version rollout. This is the best choice for most customers to ensure they always benefit from runtime updates.

    • Function update - Lambda updates the runtime of your function to the most recent and secure runtime version when you update your function. This approach synchronizes runtime updates with function deployments, giving you control over when runtime updates are applied and allowing you to detect and mitigate rare runtime update incompatibilities early. When using this setting, you need to regularly update your functions to keep their runtime up-to-date.

    • Manual - You specify a runtime version in your function configuration. The function will use this runtime version indefinitely. In the rare case where a new runtime version is incompatible with an existing function, this allows you to roll back your function to an earlier runtime version. For more information, see Roll back a runtime version.

  • :runtime_version_arn (String)

    The ARN of the runtime version you want the function to use.

    This is only required if you're using the Manual runtime update mode.

Returns:

See Also:



5108
5109
5110
5111
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 5108

def put_runtime_management_config(params = {}, options = {})
  req = build_request(:put_runtime_management_config, params)
  req.send_request(options)
end

#remove_layer_version_permission(params = {}) ⇒ Struct

Removes a statement from the permissions policy for a version of an Lambda layer. For more information, see AddLayerVersionPermission.

Examples:

Request syntax with placeholder values


resp = client.remove_layer_version_permission({
  layer_name: "LayerName", # required
  version_number: 1, # required
  statement_id: "StatementId", # required
  revision_id: "String",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :layer_name (required, String)

    The name or Amazon Resource Name (ARN) of the layer.

  • :version_number (required, Integer)

    The version number.

  • :statement_id (required, String)

    The identifier that was specified when the statement was added.

  • :revision_id (String)

    Only update the policy if the revision ID matches the ID specified. Use this option to avoid modifying a policy that has changed since you last read it.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



5150
5151
5152
5153
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 5150

def remove_layer_version_permission(params = {}, options = {})
  req = build_request(:remove_layer_version_permission, params)
  req.send_request(options)
end

#remove_permission(params = {}) ⇒ Struct

Revokes function-use permission from an Amazon Web Service or another Amazon Web Services account. You can get the ID of the statement from the output of GetPolicy.

Examples:

Request syntax with placeholder values


resp = client.remove_permission({
  function_name: "FunctionName", # required
  statement_id: "NamespacedStatementId", # required
  qualifier: "Qualifier",
  revision_id: "String",
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function, version, or alias.

    Name formats

    • Function namemy-function (name-only), my-function:v1 (with alias).

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :statement_id (required, String)

    Statement ID of the permission to remove.

  • :qualifier (String)

    Specify a version or alias to remove permissions from a published version of the function.

  • :revision_id (String)

    Update the policy only if the revision ID matches the ID that's specified. Use this option to avoid modifying a policy that has changed since you last read it.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



5203
5204
5205
5206
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 5203

def remove_permission(params = {}, options = {})
  req = build_request(:remove_permission, params)
  req.send_request(options)
end

#tag_resource(params = {}) ⇒ Struct

Adds tags to a function.

Examples:

Request syntax with placeholder values


resp = client.tag_resource({
  resource: "FunctionArn", # required
  tags: { # required
    "TagKey" => "TagValue",
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :resource (required, String)

    The function's Amazon Resource Name (ARN).

  • :tags (required, Hash<String,String>)

    A list of tags to apply to the function.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



5235
5236
5237
5238
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 5235

def tag_resource(params = {}, options = {})
  req = build_request(:tag_resource, params)
  req.send_request(options)
end

#untag_resource(params = {}) ⇒ Struct

Removes tags from a function.

Examples:

Request syntax with placeholder values


resp = client.untag_resource({
  resource: "FunctionArn", # required
  tag_keys: ["TagKey"], # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :resource (required, String)

    The function's Amazon Resource Name (ARN).

  • :tag_keys (required, Array<String>)

    A list of tag keys to remove from the function.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



5265
5266
5267
5268
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 5265

def untag_resource(params = {}, options = {})
  req = build_request(:untag_resource, params)
  req.send_request(options)
end

#update_alias(params = {}) ⇒ Types::AliasConfiguration

Updates the configuration of a Lambda function alias.

Examples:

Request syntax with placeholder values


resp = client.update_alias({
  function_name: "FunctionName", # required
  name: "Alias", # required
  function_version: "Version",
  description: "Description",
  routing_config: {
    additional_version_weights: {
      "AdditionalVersion" => 1.0,
    },
  },
  revision_id: "String",
})

Response structure


resp.alias_arn #=> String
resp.name #=> String
resp.function_version #=> String
resp.description #=> String
resp.routing_config.additional_version_weights #=> Hash
resp.routing_config.additional_version_weights["AdditionalVersion"] #=> Float
resp.revision_id #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function name - MyFunction.

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Partial ARN - 123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :name (required, String)

    The name of the alias.

  • :function_version (String)

    The function version that the alias invokes.

  • :description (String)

    A description of the alias.

  • :routing_config (Types::AliasRoutingConfiguration)

    The routing configuration of the alias.

  • :revision_id (String)

    Only update the alias if the revision ID matches the ID that's specified. Use this option to avoid modifying an alias that has changed since you last read it.

Returns:

See Also:



5350
5351
5352
5353
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 5350

def update_alias(params = {}, options = {})
  req = build_request(:update_alias, params)
  req.send_request(options)
end

#update_code_signing_config(params = {}) ⇒ Types::UpdateCodeSigningConfigResponse

Update the code signing configuration. Changes to the code signing configuration take effect the next time a user tries to deploy a code package to the function.

Examples:

Request syntax with placeholder values


resp = client.update_code_signing_config({
  code_signing_config_arn: "CodeSigningConfigArn", # required
  description: "Description",
  allowed_publishers: {
    signing_profile_version_arns: ["Arn"], # required
  },
  code_signing_policies: {
    untrusted_artifact_on_deployment: "Warn", # accepts Warn, Enforce
  },
})

Response structure


resp.code_signing_config.code_signing_config_id #=> String
resp.code_signing_config.code_signing_config_arn #=> String
resp.code_signing_config.description #=> String
resp.code_signing_config.allowed_publishers.signing_profile_version_arns #=> Array
resp.code_signing_config.allowed_publishers.signing_profile_version_arns[0] #=> String
resp.code_signing_config.code_signing_policies.untrusted_artifact_on_deployment #=> String, one of "Warn", "Enforce"
resp.code_signing_config.last_modified #=> Time

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :code_signing_config_arn (required, String)

    The The Amazon Resource Name (ARN) of the code signing configuration.

  • :description (String)

    Descriptive name for this code signing configuration.

  • :allowed_publishers (Types::AllowedPublishers)

    Signing profiles for this code signing configuration.

  • :code_signing_policies (Types::CodeSigningPolicies)

    The code signing policy.

Returns:

See Also:



5402
5403
5404
5405
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 5402

def update_code_signing_config(params = {}, options = {})
  req = build_request(:update_code_signing_config, params)
  req.send_request(options)
end

#update_event_source_mapping(params = {}) ⇒ Types::EventSourceMappingConfiguration

Updates an event source mapping. You can change the function that Lambda invokes, or pause invocation and resume later from the same location.

For details about how to configure different event sources, see the following topics.

The following error handling options are available only for stream sources (DynamoDB and Kinesis):

  • BisectBatchOnFunctionError – If the function returns an error, split the batch in two and retry.

  • DestinationConfig – Send discarded records to an Amazon SQS queue or Amazon SNS topic.

  • MaximumRecordAgeInSeconds – Discard records older than the specified age. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires

  • MaximumRetryAttempts – Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires.

  • ParallelizationFactor – Process multiple batches from each shard concurrently.

For information about which configuration parameters apply to each event source, see the following topics.

Examples:

Request syntax with placeholder values


resp = client.update_event_source_mapping({
  uuid: "String", # required
  function_name: "FunctionName",
  enabled: false,
  batch_size: 1,
  filter_criteria: {
    filters: [
      {
        pattern: "Pattern",
      },
    ],
  },
  maximum_batching_window_in_seconds: 1,
  destination_config: {
    on_success: {
      destination: "DestinationArn",
    },
    on_failure: {
      destination: "DestinationArn",
    },
  },
  maximum_record_age_in_seconds: 1,
  bisect_batch_on_function_error: false,
  maximum_retry_attempts: 1,
  parallelization_factor: 1,
  source_access_configurations: [
    {
      type: "BASIC_AUTH", # accepts BASIC_AUTH, VPC_SUBNET, VPC_SECURITY_GROUP, SASL_SCRAM_512_AUTH, SASL_SCRAM_256_AUTH, VIRTUAL_HOST, CLIENT_CERTIFICATE_TLS_AUTH, SERVER_ROOT_CA_CERTIFICATE
      uri: "URI",
    },
  ],
  tumbling_window_in_seconds: 1,
  function_response_types: ["ReportBatchItemFailures"], # accepts ReportBatchItemFailures
  scaling_config: {
    maximum_concurrency: 1,
  },
  document_db_event_source_config: {
    database_name: "DatabaseName",
    collection_name: "CollectionName",
    full_document: "UpdateLookup", # accepts UpdateLookup, Default
  },
})

Response structure


resp.uuid #=> String
resp.starting_position #=> String, one of "TRIM_HORIZON", "LATEST", "AT_TIMESTAMP"
resp.starting_position_timestamp #=> Time
resp.batch_size #=> Integer
resp.maximum_batching_window_in_seconds #=> Integer
resp.parallelization_factor #=> Integer
resp.event_source_arn #=> String
resp.filter_criteria.filters #=> Array
resp.filter_criteria.filters[0].pattern #=> String
resp.function_arn #=> String
resp.last_modified #=> Time
resp.last_processing_result #=> String
resp.state #=> String
resp.state_transition_reason #=> String
resp.destination_config.on_success.destination #=> String
resp.destination_config.on_failure.destination #=> String
resp.topics #=> Array
resp.topics[0] #=> String
resp.queues #=> Array
resp.queues[0] #=> String
resp.source_access_configurations #=> Array
resp.source_access_configurations[0].type #=> String, one of "BASIC_AUTH", "VPC_SUBNET", "VPC_SECURITY_GROUP", "SASL_SCRAM_512_AUTH", "SASL_SCRAM_256_AUTH", "VIRTUAL_HOST", "CLIENT_CERTIFICATE_TLS_AUTH", "SERVER_ROOT_CA_CERTIFICATE"
resp.source_access_configurations[0].uri #=> String
resp.self_managed_event_source.endpoints #=> Hash
resp.self_managed_event_source.endpoints["EndPointType"] #=> Array
resp.self_managed_event_source.endpoints["EndPointType"][0] #=> String
resp.maximum_record_age_in_seconds #=> Integer
resp.bisect_batch_on_function_error #=> Boolean
resp.maximum_retry_attempts #=> Integer
resp.tumbling_window_in_seconds #=> Integer
resp.function_response_types #=> Array
resp.function_response_types[0] #=> String, one of "ReportBatchItemFailures"
resp.amazon_managed_kafka_event_source_config.consumer_group_id #=> String
resp.self_managed_kafka_event_source_config.consumer_group_id #=> String
resp.scaling_config.maximum_concurrency #=> Integer
resp.document_db_event_source_config.database_name #=> String
resp.document_db_event_source_config.collection_name #=> String
resp.document_db_event_source_config.full_document #=> String, one of "UpdateLookup", "Default"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :uuid (required, String)

    The identifier of the event source mapping.

  • :function_name (String)

    The name or ARN of the Lambda function.

    Name formats

    • Function nameMyFunction.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Version or Alias ARNarn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD.

    • Partial ARN123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.

  • :enabled (Boolean)

    When true, the event source mapping is active. When false, Lambda pauses polling and invocation.

    Default: True

  • :batch_size (Integer)

    The maximum number of records in each batch that Lambda pulls from your stream or queue and sends to your function. Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).

    • Amazon Kinesis – Default 100. Max 10,000.

    • Amazon DynamoDB Streams – Default 100. Max 10,000.

    • Amazon Simple Queue Service – Default 10. For standard queues the max is 10,000. For FIFO queues the max is 10.

    • Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000.

    • Self-managed Apache Kafka – Default 100. Max 10,000.

    • Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000.

    • DocumentDB – Default 100. Max 10,000.

  • :filter_criteria (Types::FilterCriteria)

    An object that defines the filter criteria that determine whether Lambda should process an event. For more information, see Lambda event filtering.

  • :maximum_batching_window_in_seconds (Integer)

    The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. You can configure MaximumBatchingWindowInSeconds to any value from 0 seconds to 300 seconds in increments of seconds.

    For streams and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default batching window is 500 ms. Note that because you can only change MaximumBatchingWindowInSeconds in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. To restore the default batching window, you must create a new event source mapping.

    Related setting: For streams and Amazon SQS event sources, when you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

  • :destination_config (Types::DestinationConfig) — default: Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Kafka only

    A configuration object that specifies the destination of an event after Lambda processes it.

  • :maximum_record_age_in_seconds (Integer) — default: Kinesis and DynamoDB Streams only

    Discard records older than the specified age. The default value is infinite (-1).

  • :bisect_batch_on_function_error (Boolean) — default: Kinesis and DynamoDB Streams only

    If the function returns an error, split the batch in two and retry.

  • :maximum_retry_attempts (Integer) — default: Kinesis and DynamoDB Streams only

    Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires.

  • :parallelization_factor (Integer) — default: Kinesis and DynamoDB Streams only

    The number of batches to process from each shard concurrently.

  • :source_access_configurations (Array<Types::SourceAccessConfiguration>)

    An array of authentication protocols or VPC components required to secure your event source.

  • :tumbling_window_in_seconds (Integer) — default: Kinesis and DynamoDB Streams only

    The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window.

  • :function_response_types (Array<String>) — default: Kinesis, DynamoDB Streams, and Amazon SQS

    A list of current response type enums applied to the event source mapping.

  • :scaling_config (Types::ScalingConfig) — default: Amazon SQS only

    The scaling configuration for the event source. For more information, see Configuring maximum concurrency for Amazon SQS event sources.

  • :document_db_event_source_config (Types::DocumentDBEventSourceConfig)

    Specific configuration settings for a DocumentDB event source.

Returns:

See Also:



5726
5727
5728
5729
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 5726

def update_event_source_mapping(params = {}, options = {})
  req = build_request(:update_event_source_mapping, params)
  req.send_request(options)
end

#update_function_code(params = {}) ⇒ Types::FunctionConfiguration

Updates a Lambda function's code. If code signing is enabled for the function, the code package must be signed by a trusted publisher. For more information, see Configuring code signing for Lambda.

If the function's package type is Image, then you must specify the code package in ImageUri as the URI of a container image in the Amazon ECR registry.

If the function's package type is Zip, then you must specify the deployment package as a .zip file archive. Enter the Amazon S3 bucket and key of the code .zip file location. You can also provide the function code inline using the ZipFile field.

The code in the deployment package must be compatible with the target instruction set architecture of the function (x86-64 or arm64).

The function's code is locked when you publish a version. You can't modify the code of a published version, only the unpublished version.

For a function defined as a container image, Lambda resolves the image tag to an image digest. In Amazon ECR, if you update the image tag to a new image, Lambda does not automatically update the function.

Examples:

Request syntax with placeholder values


resp = client.update_function_code({
  function_name: "FunctionName", # required
  zip_file: "data",
  s3_bucket: "S3Bucket",
  s3_key: "S3Key",
  s3_object_version: "S3ObjectVersion",
  image_uri: "String",
  publish: false,
  dry_run: false,
  revision_id: "String",
  architectures: ["x86_64"], # accepts x86_64, arm64
})

Response structure


resp.function_name #=> String
resp.function_arn #=> String
resp.runtime #=> String, one of "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "nodejs10.x", "nodejs12.x", "nodejs14.x", "nodejs16.x", "java8", "java8.al2", "java11", "python2.7", "python3.6", "python3.7", "python3.8", "python3.9", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "dotnet6", "dotnet8", "nodejs4.3-edge", "go1.x", "ruby2.5", "ruby2.7", "provided", "provided.al2", "nodejs18.x", "python3.10", "java17", "ruby3.2", "python3.11", "nodejs20.x", "provided.al2023", "python3.12", "java21"
resp.role #=> String
resp.handler #=> String
resp.code_size #=> Integer
resp.description #=> String
resp.timeout #=> Integer
resp.memory_size #=> Integer
resp.last_modified #=> Time
resp.code_sha_256 #=> String
resp.version #=> String
resp.vpc_config.subnet_ids #=> Array
resp.vpc_config.subnet_ids[0] #=> String
resp.vpc_config.security_group_ids #=> Array
resp.vpc_config.security_group_ids[0] #=> String
resp.vpc_config.vpc_id #=> String
resp.vpc_config.ipv_6_allowed_for_dual_stack #=> Boolean
resp.dead_letter_config.target_arn #=> String
resp.environment.variables #=> Hash
resp.environment.variables["EnvironmentVariableName"] #=> String
resp.environment.error.error_code #=> String
resp.environment.error.message #=> String
resp.kms_key_arn #=> String
resp.tracing_config.mode #=> String, one of "Active", "PassThrough"
resp.master_arn #=> String
resp.revision_id #=> String
resp.layers #=> Array
resp.layers[0].arn #=> String
resp.layers[0].code_size #=> Integer
resp.layers[0].signing_profile_version_arn #=> String
resp.layers[0].signing_job_arn #=> String
resp.state #=> String, one of "Pending", "Active", "Inactive", "Failed"
resp.state_reason #=> String
resp.state_reason_code #=> String, one of "Idle", "Creating", "Restoring", "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.last_update_status #=> String, one of "Successful", "Failed", "InProgress"
resp.last_update_status_reason #=> String
resp.last_update_status_reason_code #=> String, one of "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.file_system_configs #=> Array
resp.file_system_configs[0].arn #=> String
resp.file_system_configs[0].local_mount_path #=> String
resp.package_type #=> String, one of "Zip", "Image"
resp.image_config_response.image_config.entry_point #=> Array
resp.image_config_response.image_config.entry_point[0] #=> String
resp.image_config_response.image_config.command #=> Array
resp.image_config_response.image_config.command[0] #=> String
resp.image_config_response.image_config.working_directory #=> String
resp.image_config_response.error.error_code #=> String
resp.image_config_response.error.message #=> String
resp.signing_profile_version_arn #=> String
resp.signing_job_arn #=> String
resp.architectures #=> Array
resp.architectures[0] #=> String, one of "x86_64", "arm64"
resp.ephemeral_storage.size #=> Integer
resp.snap_start.apply_on #=> String, one of "PublishedVersions", "None"
resp.snap_start.optimization_status #=> String, one of "On", "Off"
resp.runtime_version_config.runtime_version_arn #=> String
resp.runtime_version_config.error.error_code #=> String
resp.runtime_version_config.error.message #=> String
resp.logging_config.log_format #=> String, one of "JSON", "Text"
resp.logging_config.application_log_level #=> String, one of "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"
resp.logging_config.system_log_level #=> String, one of "DEBUG", "INFO", "WARN"
resp.logging_config.log_group #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :zip_file (String, StringIO, File)

    The base64-encoded contents of the deployment package. Amazon Web Services SDK and CLI clients handle the encoding for you. Use only with a function defined with a .zip file archive deployment package.

  • :s3_bucket (String)

    An Amazon S3 bucket in the same Amazon Web Services Region as your function. The bucket can be in a different Amazon Web Services account. Use only with a function defined with a .zip file archive deployment package.

  • :s3_key (String)

    The Amazon S3 key of the deployment package. Use only with a function defined with a .zip file archive deployment package.

  • :s3_object_version (String)

    For versioned objects, the version of the deployment package object to use.

  • :image_uri (String)

    URI of a container image in the Amazon ECR registry. Do not use for a function defined with a .zip file archive.

  • :publish (Boolean)

    Set to true to publish a new version of the function after updating the code. This has the same effect as calling PublishVersion separately.

  • :dry_run (Boolean)

    Set to true to validate the request parameters and access permissions without modifying the function code.

  • :revision_id (String)

    Update the function only if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it.

  • :architectures (Array<String>)

    The instruction set architecture that the function supports. Enter a string array with one of the valid values (arm64 or x86_64). The default value is x86_64.

Returns:

See Also:



5943
5944
5945
5946
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 5943

def update_function_code(params = {}, options = {})
  req = build_request(:update_function_code, params)
  req.send_request(options)
end

#update_function_configuration(params = {}) ⇒ Types::FunctionConfiguration

Modify the version-specific settings of a Lambda function.

When you update a function, Lambda provisions an instance of the function and its supporting resources. If your function connects to a VPC, this process can take a minute. During this time, you can't modify the function, but you can still invoke it. The LastUpdateStatus, LastUpdateStatusReason, and LastUpdateStatusReasonCode fields in the response from GetFunctionConfiguration indicate when the update is complete and the function is processing events with the new configuration. For more information, see Lambda function states.

These settings can vary between versions of a function and are locked when you publish a version. You can't modify the configuration of a published version, only the unpublished version.

To configure function concurrency, use PutFunctionConcurrency. To grant invoke permissions to an Amazon Web Services account or Amazon Web Service, use AddPermission.

Examples:

Request syntax with placeholder values


resp = client.update_function_configuration({
  function_name: "FunctionName", # required
  role: "RoleArn",
  handler: "Handler",
  description: "Description",
  timeout: 1,
  memory_size: 1,
  vpc_config: {
    subnet_ids: ["SubnetId"],
    security_group_ids: ["SecurityGroupId"],
    ipv_6_allowed_for_dual_stack: false,
  },
  environment: {
    variables: {
      "EnvironmentVariableName" => "EnvironmentVariableValue",
    },
  },
  runtime: "nodejs", # accepts nodejs, nodejs4.3, nodejs6.10, nodejs8.10, nodejs10.x, nodejs12.x, nodejs14.x, nodejs16.x, java8, java8.al2, java11, python2.7, python3.6, python3.7, python3.8, python3.9, dotnetcore1.0, dotnetcore2.0, dotnetcore2.1, dotnetcore3.1, dotnet6, dotnet8, nodejs4.3-edge, go1.x, ruby2.5, ruby2.7, provided, provided.al2, nodejs18.x, python3.10, java17, ruby3.2, python3.11, nodejs20.x, provided.al2023, python3.12, java21
  dead_letter_config: {
    target_arn: "ResourceArn",
  },
  kms_key_arn: "KMSKeyArn",
  tracing_config: {
    mode: "Active", # accepts Active, PassThrough
  },
  revision_id: "String",
  layers: ["LayerVersionArn"],
  file_system_configs: [
    {
      arn: "FileSystemArn", # required
      local_mount_path: "LocalMountPath", # required
    },
  ],
  image_config: {
    entry_point: ["String"],
    command: ["String"],
    working_directory: "WorkingDirectory",
  },
  ephemeral_storage: {
    size: 1, # required
  },
  snap_start: {
    apply_on: "PublishedVersions", # accepts PublishedVersions, None
  },
  logging_config: {
    log_format: "JSON", # accepts JSON, Text
    application_log_level: "TRACE", # accepts TRACE, DEBUG, INFO, WARN, ERROR, FATAL
    system_log_level: "DEBUG", # accepts DEBUG, INFO, WARN
    log_group: "LogGroup",
  },
})

Response structure


resp.function_name #=> String
resp.function_arn #=> String
resp.runtime #=> String, one of "nodejs", "nodejs4.3", "nodejs6.10", "nodejs8.10", "nodejs10.x", "nodejs12.x", "nodejs14.x", "nodejs16.x", "java8", "java8.al2", "java11", "python2.7", "python3.6", "python3.7", "python3.8", "python3.9", "dotnetcore1.0", "dotnetcore2.0", "dotnetcore2.1", "dotnetcore3.1", "dotnet6", "dotnet8", "nodejs4.3-edge", "go1.x", "ruby2.5", "ruby2.7", "provided", "provided.al2", "nodejs18.x", "python3.10", "java17", "ruby3.2", "python3.11", "nodejs20.x", "provided.al2023", "python3.12", "java21"
resp.role #=> String
resp.handler #=> String
resp.code_size #=> Integer
resp.description #=> String
resp.timeout #=> Integer
resp.memory_size #=> Integer
resp.last_modified #=> Time
resp.code_sha_256 #=> String
resp.version #=> String
resp.vpc_config.subnet_ids #=> Array
resp.vpc_config.subnet_ids[0] #=> String
resp.vpc_config.security_group_ids #=> Array
resp.vpc_config.security_group_ids[0] #=> String
resp.vpc_config.vpc_id #=> String
resp.vpc_config.ipv_6_allowed_for_dual_stack #=> Boolean
resp.dead_letter_config.target_arn #=> String
resp.environment.variables #=> Hash
resp.environment.variables["EnvironmentVariableName"] #=> String
resp.environment.error.error_code #=> String
resp.environment.error.message #=> String
resp.kms_key_arn #=> String
resp.tracing_config.mode #=> String, one of "Active", "PassThrough"
resp.master_arn #=> String
resp.revision_id #=> String
resp.layers #=> Array
resp.layers[0].arn #=> String
resp.layers[0].code_size #=> Integer
resp.layers[0].signing_profile_version_arn #=> String
resp.layers[0].signing_job_arn #=> String
resp.state #=> String, one of "Pending", "Active", "Inactive", "Failed"
resp.state_reason #=> String
resp.state_reason_code #=> String, one of "Idle", "Creating", "Restoring", "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.last_update_status #=> String, one of "Successful", "Failed", "InProgress"
resp.last_update_status_reason #=> String
resp.last_update_status_reason_code #=> String, one of "EniLimitExceeded", "InsufficientRolePermissions", "InvalidConfiguration", "InternalError", "SubnetOutOfIPAddresses", "InvalidSubnet", "InvalidSecurityGroup", "ImageDeleted", "ImageAccessDenied", "InvalidImage", "KMSKeyAccessDenied", "KMSKeyNotFound", "InvalidStateKMSKey", "DisabledKMSKey", "EFSIOError", "EFSMountConnectivityError", "EFSMountFailure", "EFSMountTimeout", "InvalidRuntime", "InvalidZipFileException", "FunctionError"
resp.file_system_configs #=> Array
resp.file_system_configs[0].arn #=> String
resp.file_system_configs[0].local_mount_path #=> String
resp.package_type #=> String, one of "Zip", "Image"
resp.image_config_response.image_config.entry_point #=> Array
resp.image_config_response.image_config.entry_point[0] #=> String
resp.image_config_response.image_config.command #=> Array
resp.image_config_response.image_config.command[0] #=> String
resp.image_config_response.image_config.working_directory #=> String
resp.image_config_response.error.error_code #=> String
resp.image_config_response.error.message #=> String
resp.signing_profile_version_arn #=> String
resp.signing_job_arn #=> String
resp.architectures #=> Array
resp.architectures[0] #=> String, one of "x86_64", "arm64"
resp.ephemeral_storage.size #=> Integer
resp.snap_start.apply_on #=> String, one of "PublishedVersions", "None"
resp.snap_start.optimization_status #=> String, one of "On", "Off"
resp.runtime_version_config.runtime_version_arn #=> String
resp.runtime_version_config.error.error_code #=> String
resp.runtime_version_config.error.message #=> String
resp.logging_config.log_format #=> String, one of "JSON", "Text"
resp.logging_config.application_log_level #=> String, one of "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"
resp.logging_config.system_log_level #=> String, one of "DEBUG", "INFO", "WARN"
resp.logging_config.log_group #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :role (String)

    The Amazon Resource Name (ARN) of the function's execution role.

  • :handler (String)

    The name of the method within your code that Lambda calls to run your function. Handler is required if the deployment package is a .zip file archive. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Lambda programming model.

  • :description (String)

    A description of the function.

  • :timeout (Integer)

    The amount of time (in seconds) that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds. For more information, see Lambda execution environment.

  • :memory_size (Integer)

    The amount of memory available to the function at runtime. Increasing the function memory also increases its CPU allocation. The default value is 128 MB. The value can be any multiple of 1 MB.

  • :vpc_config (Types::VpcConfig)

    For network connectivity to Amazon Web Services resources in a VPC, specify a list of security groups and subnets in the VPC. When you connect a function to a VPC, it can access resources and the internet only through that VPC. For more information, see Configuring a Lambda function to access resources in a VPC.

  • :environment (Types::Environment)

    Environment variables that are accessible from function code during execution.

  • :runtime (String)

    The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive.

    The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

  • :dead_letter_config (Types::DeadLetterConfig)

    A dead-letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see Dead-letter queues.

  • :kms_key_arn (String)

    The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's environment variables. When Lambda SnapStart is activated, Lambda also uses this key is to encrypt your function's snapshot. If you deploy your function using a container image, Lambda also uses this key to encrypt your function when it's deployed. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). If you don't provide a customer managed key, Lambda uses a default service key.

  • :tracing_config (Types::TracingConfig)

    Set Mode to Active to sample and trace a subset of incoming requests with X-Ray.

  • :revision_id (String)

    Update the function only if the revision ID matches the ID that's specified. Use this option to avoid modifying a function that has changed since you last read it.

  • :layers (Array<String>)

    A list of function layers to add to the function's execution environment. Specify each layer by its ARN, including the version.

  • :file_system_configs (Array<Types::FileSystemConfig>)

    Connection settings for an Amazon EFS file system.

  • :image_config (Types::ImageConfig)

    Container image configuration values that override the values in the container image Docker file.

  • :ephemeral_storage (Types::EphemeralStorage)

    The size of the function's /tmp directory in MB. The default value is 512, but can be any whole number between 512 and 10,240 MB. For more information, see Configuring ephemeral storage (console).

  • :snap_start (Types::SnapStart)

    The function's SnapStart setting.

  • :logging_config (Types::LoggingConfig)

    The function's Amazon CloudWatch Logs configuration settings.

Returns:

See Also:



6289
6290
6291
6292
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 6289

def update_function_configuration(params = {}, options = {})
  req = build_request(:update_function_configuration, params)
  req.send_request(options)
end

#update_function_event_invoke_config(params = {}) ⇒ Types::FunctionEventInvokeConfig

Updates the configuration for asynchronous invocation for a function, version, or alias.

To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

Examples:

Request syntax with placeholder values


resp = client.update_function_event_invoke_config({
  function_name: "FunctionName", # required
  qualifier: "Qualifier",
  maximum_retry_attempts: 1,
  maximum_event_age_in_seconds: 1,
  destination_config: {
    on_success: {
      destination: "DestinationArn",
    },
    on_failure: {
      destination: "DestinationArn",
    },
  },
})

Response structure


resp.last_modified #=> Time
resp.function_arn #=> String
resp.maximum_retry_attempts #=> Integer
resp.maximum_event_age_in_seconds #=> Integer
resp.destination_config.on_success.destination #=> String
resp.destination_config.on_failure.destination #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function, version, or alias.

    Name formats

    • Function name - my-function (name-only), my-function:v1 (with alias).

    • Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN - 123456789012:function:my-function.

    You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (String)

    A version number or alias name.

  • :maximum_retry_attempts (Integer)

    The maximum number of times to retry when the function returns an error.

  • :maximum_event_age_in_seconds (Integer)

    The maximum age of a request that Lambda sends to a function for processing.

  • :destination_config (Types::DestinationConfig)

    A destination for events after they have been sent to a function for processing.

    Destinations

    • Function - The Amazon Resource Name (ARN) of a Lambda function.

    • Queue - The ARN of a standard SQS queue.

    • Topic - The ARN of a standard SNS topic.

    • Event Bus - The ARN of an Amazon EventBridge event bus.

Returns:

See Also:



6380
6381
6382
6383
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 6380

def update_function_event_invoke_config(params = {}, options = {})
  req = build_request(:update_function_event_invoke_config, params)
  req.send_request(options)
end

#update_function_url_config(params = {}) ⇒ Types::UpdateFunctionUrlConfigResponse

Updates the configuration for a Lambda function URL.

Examples:

Request syntax with placeholder values


resp = client.update_function_url_config({
  function_name: "FunctionName", # required
  qualifier: "FunctionUrlQualifier",
  auth_type: "NONE", # accepts NONE, AWS_IAM
  cors: {
    allow_credentials: false,
    allow_headers: ["Header"],
    allow_methods: ["Method"],
    allow_origins: ["Origin"],
    expose_headers: ["Header"],
    max_age: 1,
  },
  invoke_mode: "BUFFERED", # accepts BUFFERED, RESPONSE_STREAM
})

Response structure


resp.function_url #=> String
resp.function_arn #=> String
resp.auth_type #=> String, one of "NONE", "AWS_IAM"
resp.cors.allow_credentials #=> Boolean
resp.cors.allow_headers #=> Array
resp.cors.allow_headers[0] #=> String
resp.cors.allow_methods #=> Array
resp.cors.allow_methods[0] #=> String
resp.cors.allow_origins #=> Array
resp.cors.allow_origins[0] #=> String
resp.cors.expose_headers #=> Array
resp.cors.expose_headers[0] #=> String
resp.cors.max_age #=> Integer
resp.creation_time #=> Time
resp.last_modified_time #=> Time
resp.invoke_mode #=> String, one of "BUFFERED", "RESPONSE_STREAM"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :function_name (required, String)

    The name or ARN of the Lambda function.

    Name formats

    • Function namemy-function.

    • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    • Partial ARN123456789012:function:my-function.

    The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

  • :qualifier (String)

    The alias name.

  • :auth_type (String)

    The type of authentication that your function URL uses. Set to AWS_IAM if you want to restrict access to authenticated users only. Set to NONE if you want to bypass IAM authentication to create a public endpoint. For more information, see Security and auth model for Lambda function URLs.

  • :cors (Types::Cors)

    The cross-origin resource sharing (CORS) settings for your function URL.

  • :invoke_mode (String)

    Use one of the following options:

    • BUFFERED – This is the default option. Lambda invokes your function using the Invoke API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB.

    • RESPONSE_STREAM – Your function streams payload results as they become available. Lambda invokes your function using the InvokeWithResponseStream API operation. The maximum response payload size is 20 MB, however, you can request a quota increase.

Returns:

See Also:



6492
6493
6494
6495
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 6492

def update_function_url_config(params = {}, options = {})
  req = build_request(:update_function_url_config, params)
  req.send_request(options)
end

#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean

Polls an API operation until a resource enters a desired state.

Basic Usage

A waiter will call an API operation until:

  • It is successful
  • It enters a terminal state
  • It makes the maximum number of attempts

In between attempts, the waiter will sleep.

# polls in a loop, sleeping between attempts
client.wait_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You can pass configuration as the final arguments hash.

# poll for ~25 seconds
client.wait_until(waiter_name, params, {
  max_attempts: 5,
  delay: 5,
})

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(waiter_name, params, {

  # disable max attempts
  max_attempts: nil,

  # poll for 1 hour, instead of a number of attempts
  before_wait: -> (attempts, response) do
    throw :failure if Time.now - started_at > 3600
  end
})

Handling Errors

When a waiter is unsuccessful, it will raise an error. All of the failure errors extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Valid Waiters

The following table lists the valid waiter names, the operations they call, and the default :delay and :max_attempts values.

waiter_name params :delay :max_attempts
function_active #get_function_configuration 5 60
function_active_v2 #get_function 1 300
function_exists #get_function 1 20
function_updated #get_function_configuration 5 60
function_updated_v2 #get_function 1 300
published_version_active #get_function_configuration 5 312

Parameters:

  • waiter_name (Symbol)
  • params (Hash) (defaults to: {})

    ({})

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :max_attempts (Integer)
  • :delay (Integer)
  • :before_attempt (Proc)
  • :before_wait (Proc)

Yields:

  • (w.waiter)

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.



6607
6608
6609
6610
6611
# File 'gems/aws-sdk-lambda/lib/aws-sdk-lambda/client.rb', line 6607

def wait_until(waiter_name, params = {}, options = {})
  w = waiter(waiter_name, options)
  yield(w.waiter) if block_given? # deprecated
  w.wait(params)
end