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 = '{{ region }}' AND
Identifier = '{{ function_arn }}';
Lists all versions in a region.
SELECT
region,
function_arn
FROM awscc.lambda.versions_list_only
WHERE
region = '{{ region }}';
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.lambda.versions (
CodeSha256,
Description,
FunctionName,
ProvisionedConcurrencyConfig,
RuntimePolicy,
region
)
SELECT
'{{ code_sha256 }}',
'{{ description }}',
'{{ function_name }}',
'{{ provisioned_concurrency_config }}',
'{{ runtime_policy }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
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 = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
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