versions
Creates, updates, deletes or gets a version resource or lists versions in a region
Overview
| Name | versions |
| Type | Resource |
| Description | Resource Type definition for AWS::Lambda::Version |
| Id | awscc.lambda.versions |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
function_arn | string | The ARN of the version. |
version | string | The version number. |
code_sha256 | 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. Updates are not supported for this property. |
description | string | A description for the version to override the description in the function configuration. Updates are not supported for this property. |
function_name | string | The name of the Lambda function. |
provisioned_concurrency_config | object | Specifies a provisioned concurrency configuration for a function's version. Updates are not supported for this property. |
runtime_policy | object | Specifies the runtime management configuration of a function. Displays runtimeVersionArn only for Manual. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
function_arn | string | The ARN of the version. |
region | string | AWS region. |
For more information, see AWS::Lambda::Version.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | versions | INSERT | FunctionName, region |
delete_resource | versions | DELETE | Identifier, region |
list_resources | versions_list_only | SELECT | region |
get_resource | versions | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual version.
SELECT
region,
function_arn,
version,
code_sha256,
description,
function_name,
provisioned_concurrency_config,
runtime_policy
FROM awscc.lambda.versions
WHERE
region = 'us-east-1' AND
Identifier = '{{ function_arn }}';
Lists all versions in a region.
SELECT
region,
function_arn
FROM awscc.lambda.versions_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new version resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.lambda.versions (
FunctionName,
region
)
SELECT
'{{ function_name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.lambda.versions (
CodeSha256,
Description,
FunctionName,
ProvisionedConcurrencyConfig,
RuntimePolicy,
region
)
SELECT
'{{ code_sha256 }}',
'{{ description }}',
'{{ function_name }}',
'{{ provisioned_concurrency_config }}',
'{{ runtime_policy }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: version
props:
- name: code_sha256
value: '{{ code_sha256 }}'
- name: description
value: '{{ description }}'
- name: function_name
value: '{{ function_name }}'
- name: provisioned_concurrency_config
value:
provisioned_concurrent_executions: '{{ provisioned_concurrent_executions }}'
- name: runtime_policy
value:
runtime_version_arn: '{{ runtime_version_arn }}'
update_runtime_on: '{{ update_runtime_on }}'
DELETE example
/*+ delete */
DELETE FROM awscc.lambda.versions
WHERE
Identifier = '{{ function_arn }}' AND
region = 'us-east-1';
Permissions
To operate on the versions resource, the following permissions are required:
- Create
- Read
- Delete
- List
lambda:PublishVersion,
lambda:GetFunctionConfiguration,
lambda:PutProvisionedConcurrencyConfig,
lambda:GetProvisionedConcurrencyConfig,
lambda:PutRuntimeManagementConfig,
lambda:GetRuntimeManagementConfig
lambda:GetFunctionConfiguration,
lambda:GetProvisionedConcurrencyConfig,
lambda:GetRuntimeManagementConfig
lambda:GetFunctionConfiguration,
lambda:DeleteFunction
lambda:ListVersionsByFunction