Bases: EventInvokeConfigOptions
Non runtime options.
max_event_age (Optional
[Duration
]) â The maximum age of a request that Lambda sends to a function for processing. Minimum: 60 seconds Maximum: 6 hours Default: Duration.hours(6)
on_failure (Optional
[IDestination
]) â The destination for failed invocations. Default: - no destination
on_success (Optional
[IDestination
]) â The destination for successful invocations. Default: - no destination
retry_attempts (Union
[int
, float
, None
]) â The maximum number of times to retry when the function returns an error. Minimum: 0 Maximum: 2 Default: 2
allow_all_outbound (Optional
[bool
]) â Whether to allow the Lambda to send all network traffic. If set to false, you must individually add traffic rules to allow the Lambda to connect to network targets. Default: true
allow_public_subnet (Optional
[bool
]) â Lambda Functions in a public subnet can NOT access the internet. Use this property to acknowledge this limitation and still place the function in a public subnet. Default: false
architecture (Optional
[Architecture
]) â The system architectures compatible with this lambda function. Default: Architecture.X86_64
architectures (Optional
[Sequence
[Architecture
]]) â (deprecated) DEPRECATED. Default: [Architecture.X86_64]
code_signing_config (Optional
[ICodeSigningConfig
]) â Code signing config associated with this function. Default: - Not Sign the Code
current_version_options (Union
[VersionOptions
, Dict
[str
, Any
], None
]) â Options for the lambda.Version
resource automatically created by the fn.currentVersion
method. Default: - default options as described in VersionOptions
dead_letter_queue (Optional
[IQueue
]) â The SQS queue to use if DLQ is enabled. If SNS topic is desired, specify deadLetterTopic
property instead. Default: - SQS queue with 14 day retention period if deadLetterQueueEnabled
is true
dead_letter_queue_enabled (Optional
[bool
]) â Enabled DLQ. If deadLetterQueue
is undefined, an SQS queue with default options will be defined for your Function. Default: - false unless deadLetterQueue
is set, which implies DLQ is enabled.
dead_letter_topic (Optional
[ITopic
]) â The SNS topic to use as a DLQ. Note that if deadLetterQueueEnabled
is set to true
, an SQS queue will be created rather than an SNS topic. Using an SNS topic as a DLQ requires this property to be set explicitly. Default: - no SNS topic
description (Optional
[str
]) â A description of the function. Default: - No description.
environment (Optional
[Mapping
[str
, str
]]) â Key-value pairs that Lambda caches and makes available for your Lambda functions. Use environment variables to apply configuration changes, such as test and production environment configurations, without changing your Lambda function source code. Default: - No environment variables.
environment_encryption (Optional
[IKey
]) â The AWS KMS key thatâs used to encrypt your functionâs environment variables. Default: - AWS Lambda creates and uses an AWS managed customer master key (CMK).
ephemeral_storage_size (Optional
[Size
]) â The size of the functionâs /tmp directory in MiB. Default: 512 MiB
events (Optional
[Sequence
[IEventSource
]]) â Event sources for this function. You can also add event sources using addEventSource
. Default: - No event sources.
filesystem (Optional
[FileSystem
]) â The filesystem configuration for the lambda function. Default: - will not mount any filesystem
function_name (Optional
[str
]) â A name for the function. Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the functionâs name. For more information, see Name Type.
initial_policy (Optional
[Sequence
[PolicyStatement
]]) â Initial policy statements to add to the created Lambda Role. You can call addToRolePolicy
to the created lambda to add statements post creation. Default: - No policy statements are added to the created Lambda role.
insights_version (Optional
[LambdaInsightsVersion
]) â Specify the version of CloudWatch Lambda insights to use for monitoring. Default: - No Lambda Insights
layers (Optional
[Sequence
[ILayerVersion
]]) â A list of layers to add to the functionâs execution environment. You can configure your Lambda function to pull in additional code during initialization in the form of layers. Layers are packages of libraries or other dependencies that can be used by multiple functions. Default: - No layers.
log_retention (Optional
[RetentionDays
]) â The number of days log events are kept in CloudWatch Logs. When updating this property, unsetting it doesnât remove the log retention policy. To remove the retention policy, set the value to INFINITE
. Default: logs.RetentionDays.INFINITE
log_retention_retry_options (Union
[LogRetentionRetryOptions
, Dict
[str
, Any
], None
]) â When log retention is specified, a custom resource attempts to create the CloudWatch log group. These options control the retry policy when interacting with CloudWatch APIs. Default: - Default AWS SDK retry options.
log_retention_role (Optional
[IRole
]) â The IAM role for the Lambda function associated with the custom resource that sets the retention policy. Default: - A new role is created.
memory_size (Union
[int
, float
, None
]) â The amount of memory, in MB, that is allocated to your Lambda function. Lambda uses this value to proportionally allocate the amount of CPU power. For more information, see Resource Model in the AWS Lambda Developer Guide. Default: 128
profiling (Optional
[bool
]) â Enable profiling. Default: - No profiling.
profiling_group (Optional
[IProfilingGroup
]) â Profiling Group. Default: - A new profiling group will be created if profiling
is set.
reserved_concurrent_executions (Union
[int
, float
, None
]) â The maximum of concurrent executions you want to reserve for the function. Default: - No specific limit - account limit.
role (Optional
[IRole
]) â Lambda execution role. This is the role that will be assumed by the function upon execution. It controls the permissions that the function will have. The Role must be assumable by the âlambda.amazonaws.comâ service principal. The default Role automatically has permissions granted for Lambda execution. If you provide a Role, you must add the relevant AWS managed policies yourself. The relevant managed policies are âservice-role/AWSLambdaBasicExecutionRoleâ and âservice-role/AWSLambdaVPCAccessExecutionRoleâ. Default: - A unique role will be generated for this lambda function. Both supplied and generated roles can always be changed by calling addToRolePolicy
.
security_group (Optional
[ISecurityGroup
]) â (deprecated) What security group to associate with the Lambdaâs network interfaces. This property is being deprecated, consider using securityGroups instead. Only used if âvpcâ is supplied. Use securityGroups property instead. Function constructor will throw an error if both are specified. Default: - If the function is placed within a VPC and a security group is not specified, either by this or securityGroups prop, a dedicated security group will be created for this function.
security_groups (Optional
[Sequence
[ISecurityGroup
]]) â The list of security groups to associate with the Lambdaâs network interfaces. Only used if âvpcâ is supplied. Default: - If the function is placed within a VPC and a security group is not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.
timeout (Optional
[Duration
]) â The function execution time (in seconds) after which Lambda terminates the function. Because the execution time affects cost, set this value based on the functionâs expected execution time. Default: Duration.seconds(3)
tracing (Optional
[Tracing
]) â Enable AWS X-Ray Tracing for Lambda Function. Default: Tracing.Disabled
vpc (Optional
[IVpc
]) â VPC network to place Lambda network interfaces. Specify this if the Lambda function needs to access resources in a VPC. Default: - Function is not placed within a VPC.
vpc_subnets (Union
[SubnetSelection
, Dict
[str
, Any
], None
]) â Where to place the network interfaces within the VPC. Only used if âvpcâ is supplied. Note: internet access for Lambdas requires a NAT gateway, so picking Public subnets is not allowed. Default: - the Vpc default strategy if not specified
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_codeguruprofiler as codeguruprofiler import aws_cdk.aws_ec2 as ec2 import aws_cdk.aws_iam as iam import aws_cdk.aws_kms as kms import aws_cdk.aws_lambda as lambda_ import aws_cdk.aws_logs as logs import aws_cdk.aws_sns as sns import aws_cdk.aws_sqs as sqs import aws_cdk.core as cdk # architecture: lambda.Architecture # code_signing_config: lambda.CodeSigningConfig # destination: lambda.IDestination # event_source: lambda.IEventSource # file_system: lambda.FileSystem # key: kms.Key # lambda_insights_version: lambda.LambdaInsightsVersion # layer_version: lambda.LayerVersion # policy_statement: iam.PolicyStatement # profiling_group: codeguruprofiler.ProfilingGroup # queue: sqs.Queue # role: iam.Role # security_group: ec2.SecurityGroup # size: cdk.Size # subnet: ec2.Subnet # subnet_filter: ec2.SubnetFilter # topic: sns.Topic # vpc: ec2.Vpc function_options = lambda.FunctionOptions( allow_all_outbound=False, allow_public_subnet=False, architecture=architecture, architectures=[architecture], code_signing_config=code_signing_config, current_version_options=lambda.VersionOptions( code_sha256="codeSha256", description="description", max_event_age=cdk.Duration.minutes(30), on_failure=destination, on_success=destination, provisioned_concurrent_executions=123, removal_policy=cdk.RemovalPolicy.DESTROY, retry_attempts=123 ), dead_letter_queue=queue, dead_letter_queue_enabled=False, dead_letter_topic=topic, description="description", environment={ "environment_key": "environment" }, environment_encryption=key, ephemeral_storage_size=size, events=[event_source], filesystem=file_system, function_name="functionName", initial_policy=[policy_statement], insights_version=lambda_insights_version, layers=[layer_version], log_retention=logs.RetentionDays.ONE_DAY, log_retention_retry_options=lambda.LogRetentionRetryOptions( base=cdk.Duration.minutes(30), max_retries=123 ), log_retention_role=role, max_event_age=cdk.Duration.minutes(30), memory_size=123, on_failure=destination, on_success=destination, profiling=False, profiling_group=profiling_group, reserved_concurrent_executions=123, retry_attempts=123, role=role, security_group=security_group, security_groups=[security_group], timeout=cdk.Duration.minutes(30), tracing=lambda_.Tracing.ACTIVE, vpc=vpc, vpc_subnets=ec2.SubnetSelection( availability_zones=["availabilityZones"], one_per_az=False, subnet_filters=[subnet_filter], subnet_group_name="subnetGroupName", subnet_name="subnetName", subnets=[subnet], subnet_type=ec2.SubnetType.ISOLATED ) )
Attributes
Whether to allow the Lambda to send all network traffic.
If set to false, you must individually add traffic rules to allow the Lambda to connect to network targets.
true
Lambda Functions in a public subnet can NOT access the internet.
Use this property to acknowledge this limitation and still place the function in a public subnet.
The system architectures compatible with this lambda function.
Architecture.X86_64
(deprecated) DEPRECATED.
[Architecture.X86_64]
use architecture
deprecated
Code signing config associated with this function.
Not Sign the Code
Options for the lambda.Version
resource automatically created by the fn.currentVersion
method.
default options as described in VersionOptions
The SQS queue to use if DLQ is enabled.
If SNS topic is desired, specify deadLetterTopic
property instead.
SQS queue with 14 day retention period if deadLetterQueueEnabled
is true
Enabled DLQ.
If deadLetterQueue
is undefined, an SQS queue with default options will be defined for your Function.
false unless deadLetterQueue
is set, which implies DLQ is enabled.
The SNS topic to use as a DLQ.
Note that if deadLetterQueueEnabled
is set to true
, an SQS queue will be created rather than an SNS topic. Using an SNS topic as a DLQ requires this property to be set explicitly.
no SNS topic
A description of the function.
No description.
Key-value pairs that Lambda caches and makes available for your Lambda functions.
Use environment variables to apply configuration changes, such as test and production environment configurations, without changing your Lambda function source code.
No environment variables.
The AWS KMS key thatâs used to encrypt your functionâs environment variables.
AWS Lambda creates and uses an AWS managed customer master key (CMK).
The size of the functionâs /tmp directory in MiB.
512 MiB
Event sources for this function.
You can also add event sources using addEventSource
.
No event sources.
The filesystem configuration for the lambda function.
will not mount any filesystem
A name for the function.
AWS CloudFormation generates a unique physical ID and uses that
ID for the functionâs name. For more information, see Name Type.
Initial policy statements to add to the created Lambda Role.
You can call addToRolePolicy
to the created lambda to add statements post creation.
No policy statements are added to the created Lambda role.
Specify the version of CloudWatch Lambda insights to use for monitoring.
No Lambda Insights
A list of layers to add to the functionâs execution environment.
You can configure your Lambda function to pull in additional code during initialization in the form of layers. Layers are packages of libraries or other dependencies that can be used by multiple functions.
No layers.
The number of days log events are kept in CloudWatch Logs.
When updating this property, unsetting it doesnât remove the log retention policy. To remove the retention policy, set the value to INFINITE
.
logs.RetentionDays.INFINITE
When log retention is specified, a custom resource attempts to create the CloudWatch log group.
These options control the retry policy when interacting with CloudWatch APIs.
Default AWS SDK retry options.
The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
A new role is created.
The maximum age of a request that Lambda sends to a function for processing.
Minimum: 60 seconds Maximum: 6 hours
Duration.hours(6)
The amount of memory, in MB, that is allocated to your Lambda function.
Lambda uses this value to proportionally allocate the amount of CPU power. For more information, see Resource Model in the AWS Lambda Developer Guide.
128
The destination for failed invocations.
no destination
The destination for successful invocations.
no destination
Enable profiling.
No profiling.
https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html
Profiling Group.
A new profiling group will be created if profiling
is set.
https://docs.aws.amazon.com/codeguru/latest/profiler-ug/setting-up-lambda.html
The maximum of concurrent executions you want to reserve for the function.
No specific limit - account limit.
https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html
The maximum number of times to retry when the function returns an error.
Minimum: 0 Maximum: 2
2
Lambda execution role.
This is the role that will be assumed by the function upon execution. It controls the permissions that the function will have. The Role must be assumable by the âlambda.amazonaws.comâ service principal.
The default Role automatically has permissions granted for Lambda execution. If you provide a Role, you must add the relevant AWS managed policies yourself.
The relevant managed policies are âservice-role/AWSLambdaBasicExecutionRoleâ and âservice-role/AWSLambdaVPCAccessExecutionRoleâ.
A unique role will be generated for this lambda function.
Both supplied and generated roles can always be changed by calling addToRolePolicy
.
(deprecated) What security group to associate with the Lambdaâs network interfaces. This property is being deprecated, consider using securityGroups instead.
Only used if âvpcâ is supplied.
Use securityGroups property instead. Function constructor will throw an error if both are specified.
If the function is placed within a VPC and a security group is
not specified, either by this or securityGroups prop, a dedicated security group will be created for this function.
This property is deprecated, use securityGroups instead
deprecated
The list of security groups to associate with the Lambdaâs network interfaces.
Only used if âvpcâ is supplied.
If the function is placed within a VPC and a security group is
not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.
The function execution time (in seconds) after which Lambda terminates the function.
Because the execution time affects cost, set this value based on the functionâs expected execution time.
Duration.seconds(3)
Enable AWS X-Ray Tracing for Lambda Function.
Tracing.Disabled
VPC network to place Lambda network interfaces.
Specify this if the Lambda function needs to access resources in a VPC.
Function is not placed within a VPC.
Where to place the network interfaces within the VPC.
Only used if âvpcâ is supplied. Note: internet access for Lambdas requires a NAT gateway, so picking Public subnets is not allowed.
the Vpc default strategy if not specified
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