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 | aws.appsync.function_configurations |
Fields
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. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | ApiId, DataSourceName, Name, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all function_configurations
in a region.
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 aws.appsync.function_configurations
WHERE region = 'us-east-1';
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 aws.appsync.function_configurations
WHERE region = 'us-east-1' AND data__Identifier = '<FunctionArn>';
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 aws.appsync.function_configurations (
ApiId,
DataSourceName,
Name,
region
)
SELECT
'{{ ApiId }}',
'{{ DataSourceName }}',
'{{ Name }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.appsync.function_configurations (
ApiId,
Code,
CodeS3Location,
DataSourceName,
Description,
FunctionVersion,
MaxBatchSize,
Name,
RequestMappingTemplate,
RequestMappingTemplateS3Location,
ResponseMappingTemplate,
ResponseMappingTemplateS3Location,
Runtime,
SyncConfig,
region
)
SELECT
'{{ ApiId }}',
'{{ Code }}',
'{{ CodeS3Location }}',
'{{ DataSourceName }}',
'{{ Description }}',
'{{ FunctionVersion }}',
'{{ MaxBatchSize }}',
'{{ Name }}',
'{{ RequestMappingTemplate }}',
'{{ RequestMappingTemplateS3Location }}',
'{{ ResponseMappingTemplate }}',
'{{ ResponseMappingTemplateS3Location }}',
'{{ Runtime }}',
'{{ SyncConfig }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: function_configuration
props:
- name: ApiId
value: '{{ ApiId }}'
- name: Code
value: '{{ Code }}'
- name: CodeS3Location
value: '{{ CodeS3Location }}'
- name: DataSourceName
value: '{{ DataSourceName }}'
- name: Description
value: '{{ Description }}'
- name: FunctionVersion
value: '{{ FunctionVersion }}'
- name: MaxBatchSize
value: '{{ MaxBatchSize }}'
- name: Name
value: '{{ Name }}'
- name: RequestMappingTemplate
value: '{{ RequestMappingTemplate }}'
- name: RequestMappingTemplateS3Location
value: '{{ RequestMappingTemplateS3Location }}'
- name: ResponseMappingTemplate
value: '{{ ResponseMappingTemplate }}'
- name: ResponseMappingTemplateS3Location
value: '{{ ResponseMappingTemplateS3Location }}'
- name: Runtime
value:
RuntimeVersion: '{{ RuntimeVersion }}'
Name: '{{ Name }}'
- name: SyncConfig
value:
ConflictHandler: '{{ ConflictHandler }}'
ConflictDetection: '{{ ConflictDetection }}'
LambdaConflictHandlerConfig:
LambdaConflictHandlerArn: '{{ LambdaConflictHandlerArn }}'
DELETE
example
/*+ delete */
DELETE FROM aws.appsync.function_configurations
WHERE data__Identifier = '<FunctionArn>'
AND region = 'us-east-1';
Permissions
To operate on the function_configurations
resource, the following permissions are required:
Create
s3:GetObject,
appsync:CreateFunction
Read
appsync:GetFunction
Update
s3:GetObject,
appsync:UpdateFunction
Delete
appsync:DeleteFunction
List
appsync:ListFunctions