urls
Creates, updates, deletes or gets an url resource or lists urls in a region
Overview
| Name | urls |
| Type | Resource |
| Description | Resource Type definition for AWS::Lambda::Url |
| Id | awscc.lambda.urls |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
target_function_arn | string | The Amazon Resource Name (ARN) of the function associated with the Function URL. |
qualifier | string | The alias qualifier for the target function. If TargetFunctionArn is unqualified then Qualifier must be passed. |
auth_type | string | Can be either AWS_IAM if the requests are authorized via IAM, or NONE if no authorization is configured on the Function URL. |
invoke_mode | string | The invocation mode for the function's URL. Set to BUFFERED if you want to buffer responses before returning them to the client. Set to RESPONSE_STREAM if you want to stream responses, allowing faster time to first byte and larger response payload sizes. If not set, defaults to BUFFERED. |
function_arn | string | The full Amazon Resource Name (ARN) of the function associated with the Function URL. |
function_url | string | The generated url for this resource. |
cors | object | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
function_arn | string | The full Amazon Resource Name (ARN) of the function associated with the Function URL. |
region | string | AWS region. |
For more information, see AWS::Lambda::Url.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | urls | INSERT | TargetFunctionArn, AuthType, region |
delete_resource | urls | DELETE | Identifier, region |
update_resource | urls | UPDATE | Identifier, PatchDocument, region |
list_resources | urls_list_only | SELECT | region |
get_resource | urls | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual url.
SELECT
region,
target_function_arn,
qualifier,
auth_type,
invoke_mode,
function_arn,
function_url,
cors
FROM awscc.lambda.urls
WHERE
region = 'us-east-1' AND
Identifier = '{{ function_arn }}';
Lists all urls in a region.
SELECT
region,
function_arn
FROM awscc.lambda.urls_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new url resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.lambda.urls (
TargetFunctionArn,
AuthType,
region
)
SELECT
'{{ target_function_arn }}',
'{{ auth_type }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.lambda.urls (
TargetFunctionArn,
Qualifier,
AuthType,
InvokeMode,
Cors,
region
)
SELECT
'{{ target_function_arn }}',
'{{ qualifier }}',
'{{ auth_type }}',
'{{ invoke_mode }}',
'{{ cors }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: url
props:
- name: target_function_arn
value: '{{ target_function_arn }}'
- name: qualifier
value: '{{ qualifier }}'
- name: auth_type
value: '{{ auth_type }}'
- name: invoke_mode
value: '{{ invoke_mode }}'
- name: cors
value:
allow_credentials: '{{ allow_credentials }}'
allow_headers:
- '{{ allow_headers[0] }}'
allow_methods:
- '{{ allow_methods[0] }}'
allow_origins:
- '{{ allow_origins[0] }}'
expose_headers:
- '{{ expose_headers[0] }}'
max_age: '{{ max_age }}'
UPDATE example
Use the following StackQL query and manifest file to update a url resource, using stack-deploy.
/*+ update */
UPDATE awscc.lambda.urls
SET PatchDocument = string('{{ {
"AuthType": auth_type,
"InvokeMode": invoke_mode,
"Cors": cors
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ function_arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.lambda.urls
WHERE
Identifier = '{{ function_arn }}' AND
region = 'us-east-1';
Permissions
To operate on the urls resource, the following permissions are required:
- Create
- Read
- Update
- List
- Delete
lambda:CreateFunctionUrlConfig
lambda:GetFunctionUrlConfig
lambda:UpdateFunctionUrlConfig
lambda:ListFunctionUrlConfigs
lambda:DeleteFunctionUrlConfig