A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.aws.amazon.com/sdkforruby/api/Aws/Lambda/Client.html below:

Client — AWS SDK for Ruby V2

Examples:

Example: To create a function



resp = client.create_function({
  code: {
    s3_bucket: "my-bucket-1xpuxmplzrlbh", 
    s3_key: "function.zip", 
  }, 
  description: "Process image objects from Amazon S3.", 
  environment: {
    variables: {
      "BUCKET" => "my-bucket-1xpuxmplzrlbh", 
      "PREFIX" => "inbound", 
    }, 
  }, 
  function_name: "my-function", 
  handler: "index.handler", 
  kms_key_arn: "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", 
  memory_size: 256, 
  publish: true, 
  role: "arn:aws:iam::123456789012:role/lambda-role", 
  runtime: "nodejs12.x", 
  tags: {
    "DEPARTMENT" => "Assets", 
  }, 
  timeout: 15, 
  tracing_config: {
    mode: "Active", 
  }, 
})

{
  code_sha_256: "YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=", 
  code_size: 5797206, 
  description: "Process image objects from Amazon S3.", 
  environment: {
    variables: {
      "BUCKET" => "my-bucket-1xpuxmplzrlbh", 
      "PREFIX" => "inbound", 
    }, 
  }, 
  function_arn: "arn:aws:lambda:us-west-2:123456789012:function:my-function", 
  function_name: "my-function", 
  handler: "index.handler", 
  kms_key_arn: "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", 
  last_modified: Time.parse("2020-04-10T19:06:32.563+0000"), 
  last_update_status: "Successful", 
  memory_size: 256, 
  revision_id: "b75dcd81-xmpl-48a8-a75a-93ba8b5b9727", 
  role: "arn:aws:iam::123456789012:role/lambda-role", 
  runtime: "nodejs12.x", 
  state: "Active", 
  timeout: 15, 
  tracing_config: {
    mode: "Active", 
  }, 
  version: "1", 
}

Request syntax with placeholder values


resp = client.create_function({
  function_name: "FunctionName",   runtime: "nodejs",   role: "RoleArn",   handler: "Handler",   code: {     zip_file: "data",
    s3_bucket: "S3Bucket",
    s3_key: "S3Key",
    s3_object_version: "S3ObjectVersion",
  },
  description: "Description",
  timeout: 1,
  memory_size: 1,
  publish: false,
  vpc_config: {
    subnet_ids: ["SubnetId"],
    security_group_ids: ["SecurityGroupId"],
  },
  dead_letter_config: {
    target_arn: "ResourceArn",
  },
  environment: {
    variables: {
      "EnvironmentVariableName" => "EnvironmentVariableValue",
    },
  },
  kms_key_arn: "KMSKeyArn",
  tracing_config: {
    mode: "Active",   },
  tags: {
    "TagKey" => "TagValue",
  },
  layers: ["LayerVersionArn"],
  file_system_configs: [
    {
      arn: "FileSystemArn",       local_mount_path: "LocalMountPath",     },
  ],
})

Response structure


resp.function_name resp.function_arn resp.runtime resp.role resp.handler resp.code_size resp.description resp.timeout resp.memory_size resp.last_modified resp.code_sha_256 resp.version resp.vpc_config.subnet_ids resp.vpc_config.subnet_ids[0] resp.vpc_config.security_group_ids resp.vpc_config.security_group_ids[0] resp.vpc_config.vpc_id resp.dead_letter_config.target_arn resp.environment.variables resp.environment.variables["EnvironmentVariableName"] resp.environment.error.error_code resp.environment.error.message resp.kms_key_arn resp.tracing_config.mode resp.master_arn resp.revision_id resp.layers resp.layers[0].arn resp.layers[0].code_size resp.state resp.state_reason resp.state_reason_code resp.last_update_status resp.last_update_status_reason resp.last_update_status_reason_code resp.file_system_configs resp.file_system_configs[0].arn resp.file_system_configs[0].local_mount_path 
  • :function_name (required, String)

    The name of the Lambda function.

    Name formats .title

    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 (required, String)

    The identifier of the function\'s runtime.

  • :role (required, String)

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

  • :handler (required, String)

    The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Programming Model.

  • :code (required, Types::FunctionCode)

    The code for the function.

  • :description (String)

    A description of the function.

  • :timeout (Integer)

    The amount of time that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds.

  • :memory_size (Integer)

    The amount of memory that your function has access to. Increasing the function\'s memory also increases its CPU allocation. The default value is 128 MB. The value must be a multiple of 64 MB.

  • :publish (Boolean)

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

  • :vpc_config (Types::VpcConfig)

    For network connectivity to AWS 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 only access resources and the internet through that VPC. For more information, see VPC Settings.

  • :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 AWS Key Management Service (AWS KMS) key that\'s used to encrypt your function\'s environment variables. If it\'s not provided, AWS Lambda uses a default service key.

  • :tracing_config (Types::TracingConfig)

    Set Mode to Active to sample and trace a subset of incoming requests with AWS 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.


  • RetroSearch is an open source project built by @garambo | Open a GitHub Issue

    Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

    HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4