function_configurations
Creates, updates, deletes or gets a function_configuration resource or lists function_configurations in a region
Overview
| Name | function_configurations |
| Type | Resource |
| Description | An example resource schema demonstrating some basic constructs and validation rules. |
| Id | awscc.appsync.function_configurations |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
function_id | string | The unique identifier for the function generated by the service |
function_arn | string | The ARN for the function generated by the service |
api_id | string | The AWS AppSync GraphQL API that you want to attach using this function. |
code | string | The resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS. |
code_s3_location | string | The Amazon S3 endpoint (where the code is located??). |
data_source_name | string | The name of data source this function will attach. |
description | string | The function description. |
function_version | string | The version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported. |
max_batch_size | integer | The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a BatchInvoke operation. |
name | string | The name of the function. |
request_mapping_template | string | The Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template. |
request_mapping_template_s3_location | string | Describes a Sync configuration for a resolver. Contains information on which Conflict Detection, as well as Resolution strategy, should be performed when the resolver is invoked. |
response_mapping_template | string | The Function response mapping template. |
response_mapping_template_s3_location | string | The location of a response mapping template in an Amazon S3 bucket. Use this if you want to provision with a template file in Amazon S3 rather than embedding it in your CloudFormation template. |
runtime | object | Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. |
sync_config | object | Describes a Sync configuration for a resolver. Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
function_arn | string | The ARN for the function generated by the service |
region | string | AWS region. |
For more information, see AWS::AppSync::FunctionConfiguration.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | function_configurations | INSERT | ApiId, DataSourceName, Name, region |
delete_resource | function_configurations | DELETE | Identifier, region |
update_resource | function_configurations | UPDATE | Identifier, PatchDocument, region |
list_resources | function_configurations_list_only | SELECT | region |
get_resource | function_configurations | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual function_configuration.
SELECT
region,
function_id,
function_arn,
api_id,
code,
code_s3_location,
data_source_name,
description,
function_version,
max_batch_size,
name,
request_mapping_template,
request_mapping_template_s3_location,
response_mapping_template,
response_mapping_template_s3_location,
runtime,
sync_config
FROM awscc.appsync.function_configurations
WHERE
region = '{{ region }}' AND
Identifier = '{{ function_arn }}';
Lists all function_configurations in a region.
SELECT
region,
function_arn
FROM awscc.appsync.function_configurations_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new function_configuration resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.appsync.function_configurations (
ApiId,
DataSourceName,
Name,
region
)
SELECT
'{{ api_id }}',
'{{ data_source_name }}',
'{{ name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.appsync.function_configurations (
ApiId,
Code,
CodeS3Location,
DataSourceName,
Description,
FunctionVersion,
MaxBatchSize,
Name,
RequestMappingTemplate,
RequestMappingTemplateS3Location,
ResponseMappingTemplate,
ResponseMappingTemplateS3Location,
Runtime,
SyncConfig,
region
)
SELECT
'{{ api_id }}',
'{{ code }}',
'{{ code_s3_location }}',
'{{ data_source_name }}',
'{{ description }}',
'{{ function_version }}',
'{{ max_batch_size }}',
'{{ name }}',
'{{ request_mapping_template }}',
'{{ request_mapping_template_s3_location }}',
'{{ response_mapping_template }}',
'{{ response_mapping_template_s3_location }}',
'{{ runtime }}',
'{{ sync_config }}',
'{{ 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: function_configuration
props:
- name: api_id
value: '{{ api_id }}'
- name: code
value: '{{ code }}'
- name: code_s3_location
value: '{{ code_s3_location }}'
- name: data_source_name
value: '{{ data_source_name }}'
- name: description
value: '{{ description }}'
- name: function_version
value: '{{ function_version }}'
- name: max_batch_size
value: '{{ max_batch_size }}'
- name: name
value: '{{ name }}'
- name: request_mapping_template
value: '{{ request_mapping_template }}'
- name: request_mapping_template_s3_location
value: '{{ request_mapping_template_s3_location }}'
- name: response_mapping_template
value: '{{ response_mapping_template }}'
- name: response_mapping_template_s3_location
value: '{{ response_mapping_template_s3_location }}'
- name: runtime
value:
runtime_version: '{{ runtime_version }}'
name: '{{ name }}'
- name: sync_config
value:
conflict_handler: '{{ conflict_handler }}'
conflict_detection: '{{ conflict_detection }}'
lambda_conflict_handler_config:
lambda_conflict_handler_arn: '{{ lambda_conflict_handler_arn }}'
UPDATE example
Use the following StackQL query and manifest file to update a function_configuration resource, using stack-deploy.
/*+ update */
UPDATE awscc.appsync.function_configurations
SET PatchDocument = string('{{ {
"Code": code,
"CodeS3Location": code_s3_location,
"DataSourceName": data_source_name,
"Description": description,
"FunctionVersion": function_version,
"MaxBatchSize": max_batch_size,
"Name": name,
"RequestMappingTemplate": request_mapping_template,
"RequestMappingTemplateS3Location": request_mapping_template_s3_location,
"ResponseMappingTemplate": response_mapping_template,
"ResponseMappingTemplateS3Location": response_mapping_template_s3_location,
"Runtime": runtime,
"SyncConfig": sync_config
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ function_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.appsync.function_configurations
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 function_configurations resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
s3:GetObject,
appsync:CreateFunction
appsync:GetFunction
s3:GetObject,
appsync:UpdateFunction
appsync:DeleteFunction
appsync:ListFunctions