boto3_lambda¶
Connection module for Amazon Lambda using boto3.¶
Renamed from
boto_lambdatoboto3_lambdaand rewritten to use the boto3lambdaclient APIs directly viasaltext.boto3.utils.boto3mod. The legacy boto2 code path (object-style access, retry loops) has been removed.
- depends:
boto3 >= 1.28.0
botocore >= 1.31.0
- configuration:
This module accepts explicit lambda credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html
If IAM roles are not used you need to specify them either in the minion’s config file or as a profile. For example, to specify them in the minion’s config file:
lambda.keyid: GKTADJGHEIQSXMKKRBJ08H
lambda.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
A region may also be specified in the configuration:
lambda.region: us-east-1
It’s also possible to specify key, keyid and region via a profile, either as a passed in dict, or as a string to pull from pillars or minion config:
myprofile:
keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
region: us-east-1
Added in version 1.0.0.
- saltext.boto3.modules.boto3_lambda.function_exists(FunctionName, region=None, key=None, keyid=None, profile=None)[source]¶
Check whether a Lambda function exists.
CLI Example:
salt myminion boto3_lambda.function_exists myfunction
- saltext.boto3.modules.boto3_lambda.create_function(FunctionName, Runtime, Role, Handler, ZipFile=None, S3Bucket=None, S3Key=None, S3ObjectVersion=None, Description='', Timeout=3, MemorySize=128, Publish=False, WaitForRole=False, RoleRetries=5, region=None, key=None, keyid=None, profile=None, VpcConfig=None, Environment=None)[source]¶
Create a Lambda function.
CLI Example:
salt myminion boto3_lambda.create_function my_function python3.9 my_role my_file.handler my_function.zip
- saltext.boto3.modules.boto3_lambda.delete_function(FunctionName, Qualifier=None, region=None, key=None, keyid=None, profile=None)[source]¶
Delete a Lambda function.
CLI Example:
salt myminion boto3_lambda.delete_function myfunction
- saltext.boto3.modules.boto3_lambda.describe_function(FunctionName, region=None, key=None, keyid=None, profile=None)[source]¶
Describe the given Lambda function.
CLI Example:
salt myminion boto3_lambda.describe_function myfunction
- saltext.boto3.modules.boto3_lambda.update_function_config(FunctionName, Role=None, Handler=None, Description=None, Timeout=None, MemorySize=None, region=None, key=None, keyid=None, profile=None, VpcConfig=None, WaitForRole=False, RoleRetries=5, Environment=None)[source]¶
Update the named Lambda function configuration.
CLI Example:
salt myminion boto3_lambda.update_function_config my_function Description="..."
- saltext.boto3.modules.boto3_lambda.update_function_code(FunctionName, ZipFile=None, S3Bucket=None, S3Key=None, S3ObjectVersion=None, Publish=False, region=None, key=None, keyid=None, profile=None)[source]¶
Update the named Lambda function’s code.
CLI Example:
salt myminion boto3_lambda.update_function_code my_function ZipFile=function.zip
- saltext.boto3.modules.boto3_lambda.add_permission(FunctionName, StatementId, Action, Principal, SourceArn=None, SourceAccount=None, Qualifier=None, region=None, key=None, keyid=None, profile=None)[source]¶
Add a permission to a Lambda function.
CLI Example:
salt myminion boto3_lambda.add_permission my_function my_id "lambda:*" s3.amazonaws.com
- saltext.boto3.modules.boto3_lambda.remove_permission(FunctionName, StatementId, Qualifier=None, region=None, key=None, keyid=None, profile=None)[source]¶
Remove a permission from a Lambda function.
CLI Example:
salt myminion boto3_lambda.remove_permission my_function my_id
- saltext.boto3.modules.boto3_lambda.get_permissions(FunctionName, Qualifier=None, region=None, key=None, keyid=None, profile=None)[source]¶
Get resource permissions for the given Lambda function.
CLI Example:
salt myminion boto3_lambda.get_permissions my_function
- saltext.boto3.modules.boto3_lambda.list_functions(region=None, key=None, keyid=None, profile=None)[source]¶
List all Lambda functions visible in the current scope.
CLI Example:
salt myminion boto3_lambda.list_functions
- saltext.boto3.modules.boto3_lambda.list_function_versions(FunctionName, region=None, key=None, keyid=None, profile=None)[source]¶
List the versions available for the given function.
CLI Example:
salt myminion boto3_lambda.list_function_versions myfunction
- saltext.boto3.modules.boto3_lambda.create_alias(FunctionName, Name, FunctionVersion, Description='', region=None, key=None, keyid=None, profile=None)[source]¶
Create an alias for a Lambda function.
CLI Example:
salt myminion boto3_lambda.create_alias my_function my_alias '$LATEST'
- saltext.boto3.modules.boto3_lambda.delete_alias(FunctionName, Name, region=None, key=None, keyid=None, profile=None)[source]¶
Delete an alias.
CLI Example:
salt myminion boto3_lambda.delete_alias myfunction myalias
- saltext.boto3.modules.boto3_lambda.alias_exists(FunctionName, Name, region=None, key=None, keyid=None, profile=None)[source]¶
Check whether a Lambda alias exists.
CLI Example:
salt myminion boto3_lambda.alias_exists myfunction myalias
- saltext.boto3.modules.boto3_lambda.describe_alias(FunctionName, Name, region=None, key=None, keyid=None, profile=None)[source]¶
Describe a Lambda alias.
CLI Example:
salt myminion boto3_lambda.describe_alias myfunction myalias
- saltext.boto3.modules.boto3_lambda.update_alias(FunctionName, Name, FunctionVersion=None, Description=None, region=None, key=None, keyid=None, profile=None)[source]¶
Update a Lambda alias.
CLI Example:
salt myminion boto3_lambda.update_alias my_lambda my_alias '$LATEST'
- saltext.boto3.modules.boto3_lambda.create_event_source_mapping(EventSourceArn, FunctionName, StartingPosition, Enabled=True, BatchSize=100, region=None, key=None, keyid=None, profile=None)[source]¶
Create an event source mapping.
CLI Example:
salt myminion boto3_lambda.create_event_source_mapping arn::::eventsource myfunction LATEST
- saltext.boto3.modules.boto3_lambda.get_event_source_mapping_ids(EventSourceArn, FunctionName, region=None, key=None, keyid=None, profile=None)[source]¶
Given an event source and function name, return a list of mapping IDs.
CLI Example:
salt myminion boto3_lambda.get_event_source_mapping_ids arn:::: myfunction
- saltext.boto3.modules.boto3_lambda.delete_event_source_mapping(UUID=None, EventSourceArn=None, FunctionName=None, region=None, key=None, keyid=None, profile=None)[source]¶
Delete an event source mapping.
CLI Example:
salt myminion boto3_lambda.delete_event_source_mapping 260c423d-...
- saltext.boto3.modules.boto3_lambda.event_source_mapping_exists(UUID=None, EventSourceArn=None, FunctionName=None, region=None, key=None, keyid=None, profile=None)[source]¶
Check whether an event source mapping exists.
CLI Example:
salt myminion boto3_lambda.event_source_mapping_exists uuid
- saltext.boto3.modules.boto3_lambda.describe_event_source_mapping(UUID=None, EventSourceArn=None, FunctionName=None, region=None, key=None, keyid=None, profile=None)[source]¶
Describe an event source mapping.
CLI Example:
salt myminion boto3_lambda.describe_event_source_mapping uuid
- saltext.boto3.modules.boto3_lambda.update_event_source_mapping(UUID, FunctionName=None, Enabled=None, BatchSize=None, region=None, key=None, keyid=None, profile=None)[source]¶
Update an event source mapping.
CLI Example:
salt myminion boto3_lambda.update_event_source_mapping uuid FunctionName=new_function