AWS AppSync Resolver
This page shows how to write Terraform and CloudFormation for AWS AppSync Resolver and write them securely.
aws_appsync_resolver (Terraform)
The Resolver in AWS AppSync can be configured in Terraform with the resource name aws_appsync_resolver. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_appsync_resolver" "poc_mutation_create_person" {
type = "Mutation"
api_id = aws_appsync_graphql_api.poc_appsync_api.id
data_source = aws_appsync_datasource.poc_ds_person.name
field = "createPocPersonTable"
response_template = file("resource/resolvers/person/person_create_response.vtl")
Parameters
-
api_idrequired - string -
arnoptional computed - string -
data_sourceoptional - string -
fieldrequired - string -
idoptional computed - string -
kindoptional - string -
request_templaterequired - string -
response_templaterequired - string -
typerequired - string -
caching_configlist block-
caching_keysoptional - set of string -
ttloptional - number
-
-
pipeline_configlist block-
functionsoptional - list of string
-
Explanation in Terraform Registry
Provides an AppSync Resolver.
AWS::AppSync::Resolver (CloudFormation)
The Resolver in AppSync can be configured in CloudFormation with the resource name AWS::AppSync::Resolver. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
ResponseMappingTemplateS3Locationoptional - String -
TypeNamerequired - String -
PipelineConfigoptional - PipelineConfig -
DataSourceNameoptional - String -
RequestMappingTemplateoptional - String -
ResponseMappingTemplateoptional - String -
Kindoptional - String -
CachingConfigoptional - CachingConfig -
SyncConfigoptional - SyncConfig -
RequestMappingTemplateS3Locationoptional - String -
ApiIdrequired - String -
FieldNamerequired - String
Explanation in CloudFormation Registry
The
AWS::AppSync::Resolverresource defines the logical GraphQL resolver that you attach to fields in a schema. Request and response templates for resolvers are written in Apache Velocity Template Language (VTL) format. For more information about resolvers, see Resolver Mapping Template Reference.Note When you submit an update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template. To cause this resource to be updated you must change a property value for this resource in the CloudFormation template. Changing the Amazon S3 file content without changing a property value will not result in an update operation. See Update Behaviors of Stack Resources in the AWS CloudFormation User Guide.
Frequently asked questions
What is AWS AppSync Resolver?
AWS AppSync Resolver is a resource for AppSync of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS AppSync Resolver?
For Terraform, the jjoc007/poc-appsync-golang-mongo source code example is useful. See the Terraform Example section for further details.