AWS Classic

v5.16.2 published on Tuesday, Oct 4, 2022 by Pulumi

Resolver

Provides an AppSync Resolver.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var testGraphQLApi = new Aws.AppSync.GraphQLApi("testGraphQLApi", new()
    {
        AuthenticationType = "API_KEY",
        Schema = @"type Mutation {
	putPost(id: ID!, title: String!): Post
}

type Post {
	id: ID!
	title: String!
}

type Query {
	singlePost(id: ID!): Post
}

schema {
	query: Query
	mutation: Mutation
}
",
    });

    var testDataSource = new Aws.AppSync.DataSource("testDataSource", new()
    {
        ApiId = testGraphQLApi.Id,
        Name = "tf_example",
        Type = "HTTP",
        HttpConfig = new Aws.AppSync.Inputs.DataSourceHttpConfigArgs
        {
            Endpoint = "http://example.com",
        },
    });

    // UNIT type resolver (default)
    var testResolver = new Aws.AppSync.Resolver("testResolver", new()
    {
        ApiId = testGraphQLApi.Id,
        Field = "singlePost",
        Type = "Query",
        DataSource = testDataSource.Name,
        RequestTemplate = @"{
    ""version"": ""2018-05-29"",
    ""method"": ""GET"",
    ""resourcePath"": ""/"",
    ""params"":{
        ""headers"": $utils.http.copyheaders($ctx.request.headers)
    }
}
",
        ResponseTemplate = @"#if($ctx.result.statusCode == 200)
    $ctx.result.body
#else
    $utils.appendError($ctx.result.body, $ctx.result.statusCode)
#end
",
        CachingConfig = new Aws.AppSync.Inputs.ResolverCachingConfigArgs
        {
            CachingKeys = new[]
            {
                "$context.identity.sub",
                "$context.arguments.id",
            },
            Ttl = 60,
        },
    });

    // PIPELINE type resolver
    var mutationPipelineTest = new Aws.AppSync.Resolver("mutationPipelineTest", new()
    {
        Type = "Mutation",
        ApiId = testGraphQLApi.Id,
        Field = "pipelineTest",
        RequestTemplate = "{}",
        ResponseTemplate = "$util.toJson($ctx.result)",
        Kind = "PIPELINE",
        PipelineConfig = new Aws.AppSync.Inputs.ResolverPipelineConfigArgs
        {
            Functions = new[]
            {
                aws_appsync_function.Test1.Function_id,
                aws_appsync_function.Test2.Function_id,
                aws_appsync_function.Test3.Function_id,
            },
        },
    });

});
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/appsync"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		testGraphQLApi, err := appsync.NewGraphQLApi(ctx, "testGraphQLApi", &appsync.GraphQLApiArgs{
			AuthenticationType: pulumi.String("API_KEY"),
			Schema: pulumi.String(fmt.Sprintf(`type Mutation {
	putPost(id: ID!, title: String!): Post
}

type Post {
	id: ID!
	title: String!
}

type Query {
	singlePost(id: ID!): Post
}

schema {
	query: Query
	mutation: Mutation
}
`)),
		})
		if err != nil {
			return err
		}
		testDataSource, err := appsync.NewDataSource(ctx, "testDataSource", &appsync.DataSourceArgs{
			ApiId: testGraphQLApi.ID(),
			Name:  pulumi.String("tf_example"),
			Type:  pulumi.String("HTTP"),
			HttpConfig: &appsync.DataSourceHttpConfigArgs{
				Endpoint: pulumi.String("http://example.com"),
			},
		})
		if err != nil {
			return err
		}
		_, err = appsync.NewResolver(ctx, "testResolver", &appsync.ResolverArgs{
			ApiId:      testGraphQLApi.ID(),
			Field:      pulumi.String("singlePost"),
			Type:       pulumi.String("Query"),
			DataSource: testDataSource.Name,
			RequestTemplate: pulumi.String(fmt.Sprintf(`{
    "version": "2018-05-29",
    "method": "GET",
    "resourcePath": "/",
    "params":{
        "headers": $utils.http.copyheaders($ctx.request.headers)
    }
}
`)),
			ResponseTemplate: pulumi.String(fmt.Sprintf("#if($ctx.result.statusCode == 200)\n    $ctx.result.body\n#else\n    $utils.appendError($ctx.result.body, $ctx.result.statusCode)\n#end\n")),
			CachingConfig: &appsync.ResolverCachingConfigArgs{
				CachingKeys: pulumi.StringArray{
					pulumi.String(fmt.Sprintf("$context.identity.sub")),
					pulumi.String(fmt.Sprintf("$context.arguments.id")),
				},
				Ttl: pulumi.Int(60),
			},
		})
		if err != nil {
			return err
		}
		_, err = appsync.NewResolver(ctx, "mutationPipelineTest", &appsync.ResolverArgs{
			Type:             pulumi.String("Mutation"),
			ApiId:            testGraphQLApi.ID(),
			Field:            pulumi.String("pipelineTest"),
			RequestTemplate:  pulumi.String("{}"),
			ResponseTemplate: pulumi.String(fmt.Sprintf("$util.toJson($ctx.result)")),
			Kind:             pulumi.String("PIPELINE"),
			PipelineConfig: &appsync.ResolverPipelineConfigArgs{
				Functions: pulumi.StringArray{
					pulumi.Any(aws_appsync_function.Test1.Function_id),
					pulumi.Any(aws_appsync_function.Test2.Function_id),
					pulumi.Any(aws_appsync_function.Test3.Function_id),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.appsync.GraphQLApi;
import com.pulumi.aws.appsync.GraphQLApiArgs;
import com.pulumi.aws.appsync.DataSource;
import com.pulumi.aws.appsync.DataSourceArgs;
import com.pulumi.aws.appsync.inputs.DataSourceHttpConfigArgs;
import com.pulumi.aws.appsync.Resolver;
import com.pulumi.aws.appsync.ResolverArgs;
import com.pulumi.aws.appsync.inputs.ResolverCachingConfigArgs;
import com.pulumi.aws.appsync.inputs.ResolverPipelineConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var testGraphQLApi = new GraphQLApi("testGraphQLApi", GraphQLApiArgs.builder()        
            .authenticationType("API_KEY")
            .schema("""
type Mutation {
	putPost(id: ID!, title: String!): Post
}

type Post {
	id: ID!
	title: String!
}

type Query {
	singlePost(id: ID!): Post
}

schema {
	query: Query
	mutation: Mutation
}
            """)
            .build());

        var testDataSource = new DataSource("testDataSource", DataSourceArgs.builder()        
            .apiId(testGraphQLApi.id())
            .name("tf_example")
            .type("HTTP")
            .httpConfig(DataSourceHttpConfigArgs.builder()
                .endpoint("http://example.com")
                .build())
            .build());

        var testResolver = new Resolver("testResolver", ResolverArgs.builder()        
            .apiId(testGraphQLApi.id())
            .field("singlePost")
            .type("Query")
            .dataSource(testDataSource.name())
            .requestTemplate("""
{
    "version": "2018-05-29",
    "method": "GET",
    "resourcePath": "/",
    "params":{
        "headers": $utils.http.copyheaders($ctx.request.headers)
    }
}
            """)
            .responseTemplate("""
#if($ctx.result.statusCode == 200)
    $ctx.result.body
#else
    $utils.appendError($ctx.result.body, $ctx.result.statusCode)
#end
            """)
            .cachingConfig(ResolverCachingConfigArgs.builder()
                .cachingKeys(                
                    "$context.identity.sub",
                    "$context.arguments.id")
                .ttl(60)
                .build())
            .build());

        var mutationPipelineTest = new Resolver("mutationPipelineTest", ResolverArgs.builder()        
            .type("Mutation")
            .apiId(testGraphQLApi.id())
            .field("pipelineTest")
            .requestTemplate("{}")
            .responseTemplate("$util.toJson($ctx.result)")
            .kind("PIPELINE")
            .pipelineConfig(ResolverPipelineConfigArgs.builder()
                .functions(                
                    aws_appsync_function.test1().function_id(),
                    aws_appsync_function.test2().function_id(),
                    aws_appsync_function.test3().function_id())
                .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

test_graph_ql_api = aws.appsync.GraphQLApi("testGraphQLApi",
    authentication_type="API_KEY",
    schema="""type Mutation {
	putPost(id: ID!, title: String!): Post
}

type Post {
	id: ID!
	title: String!
}

type Query {
	singlePost(id: ID!): Post
}

schema {
	query: Query
	mutation: Mutation
}
""")
test_data_source = aws.appsync.DataSource("testDataSource",
    api_id=test_graph_ql_api.id,
    name="tf_example",
    type="HTTP",
    http_config=aws.appsync.DataSourceHttpConfigArgs(
        endpoint="http://example.com",
    ))
# UNIT type resolver (default)
test_resolver = aws.appsync.Resolver("testResolver",
    api_id=test_graph_ql_api.id,
    field="singlePost",
    type="Query",
    data_source=test_data_source.name,
    request_template="""{
    "version": "2018-05-29",
    "method": "GET",
    "resourcePath": "/",
    "params":{
        "headers": $utils.http.copyheaders($ctx.request.headers)
    }
}
""",
    response_template="""#if($ctx.result.statusCode == 200)
    $ctx.result.body
#else
    $utils.appendError($ctx.result.body, $ctx.result.statusCode)
#end
""",
    caching_config=aws.appsync.ResolverCachingConfigArgs(
        caching_keys=[
            "$context.identity.sub",
            "$context.arguments.id",
        ],
        ttl=60,
    ))
# PIPELINE type resolver
mutation_pipeline_test = aws.appsync.Resolver("mutationPipelineTest",
    type="Mutation",
    api_id=test_graph_ql_api.id,
    field="pipelineTest",
    request_template="{}",
    response_template="$util.toJson($ctx.result)",
    kind="PIPELINE",
    pipeline_config=aws.appsync.ResolverPipelineConfigArgs(
        functions=[
            aws_appsync_function["test1"]["function_id"],
            aws_appsync_function["test2"]["function_id"],
            aws_appsync_function["test3"]["function_id"],
        ],
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const testGraphQLApi = new aws.appsync.GraphQLApi("testGraphQLApi", {
    authenticationType: "API_KEY",
    schema: `type Mutation {
	putPost(id: ID!, title: String!): Post
}

type Post {
	id: ID!
	title: String!
}

type Query {
	singlePost(id: ID!): Post
}

schema {
	query: Query
	mutation: Mutation
}
`,
});
const testDataSource = new aws.appsync.DataSource("testDataSource", {
    apiId: testGraphQLApi.id,
    name: "tf_example",
    type: "HTTP",
    httpConfig: {
        endpoint: "http://example.com",
    },
});
// UNIT type resolver (default)
const testResolver = new aws.appsync.Resolver("testResolver", {
    apiId: testGraphQLApi.id,
    field: "singlePost",
    type: "Query",
    dataSource: testDataSource.name,
    requestTemplate: `{
    "version": "2018-05-29",
    "method": "GET",
    "resourcePath": "/",
    "params":{
        "headers": $utils.http.copyheaders($ctx.request.headers)
    }
}
`,
    responseTemplate: `#if($ctx.result.statusCode == 200)
    $ctx.result.body
#else
    $utils.appendError($ctx.result.body, $ctx.result.statusCode)
#end
`,
    cachingConfig: {
        cachingKeys: [
            `$context.identity.sub`,
            `$context.arguments.id`,
        ],
        ttl: 60,
    },
});
// PIPELINE type resolver
const mutationPipelineTest = new aws.appsync.Resolver("mutationPipelineTest", {
    type: "Mutation",
    apiId: testGraphQLApi.id,
    field: "pipelineTest",
    requestTemplate: "{}",
    responseTemplate: `$util.toJson($ctx.result)`,
    kind: "PIPELINE",
    pipelineConfig: {
        functions: [
            aws_appsync_function.test1.function_id,
            aws_appsync_function.test2.function_id,
            aws_appsync_function.test3.function_id,
        ],
    },
});
resources:
  testGraphQLApi:
    type: aws:appsync:GraphQLApi
    properties:
      authenticationType: API_KEY
      schema: |
        type Mutation {
        	putPost(id: ID!, title: String!): Post
        }

        type Post {
        	id: ID!
        	title: String!
        }

        type Query {
        	singlePost(id: ID!): Post
        }

        schema {
        	query: Query
        	mutation: Mutation
        }        
  testDataSource:
    type: aws:appsync:DataSource
    properties:
      apiId: ${testGraphQLApi.id}
      name: tf_example
      type: HTTP
      httpConfig:
        endpoint: http://example.com
  # UNIT type resolver (default)
  testResolver:
    type: aws:appsync:Resolver
    properties:
      apiId: ${testGraphQLApi.id}
      field: singlePost
      type: Query
      dataSource: ${testDataSource.name}
      requestTemplate: |
        {
            "version": "2018-05-29",
            "method": "GET",
            "resourcePath": "/",
            "params":{
                "headers": $utils.http.copyheaders($ctx.request.headers)
            }
        }        
      responseTemplate: |
        #if($ctx.result.statusCode == 200)
            $ctx.result.body
        #else
            $utils.appendError($ctx.result.body, $ctx.result.statusCode)
        #end        
      cachingConfig:
        cachingKeys:
          - $context.identity.sub
          - $context.arguments.id
        ttl: 60
  # PIPELINE type resolver
  mutationPipelineTest:
    type: aws:appsync:Resolver
    properties:
      type: Mutation
      apiId: ${testGraphQLApi.id}
      field: pipelineTest
      requestTemplate: '{}'
      responseTemplate: $util.toJson($ctx.result)
      kind: PIPELINE
      pipelineConfig:
        functions:
          - ${aws_appsync_function.test1.function_id}
          - ${aws_appsync_function.test2.function_id}
          - ${aws_appsync_function.test3.function_id}

Create a Resolver Resource

new Resolver(name: string, args: ResolverArgs, opts?: CustomResourceOptions);
@overload
def Resolver(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             api_id: Optional[str] = None,
             caching_config: Optional[ResolverCachingConfigArgs] = None,
             data_source: Optional[str] = None,
             field: Optional[str] = None,
             kind: Optional[str] = None,
             max_batch_size: Optional[int] = None,
             pipeline_config: Optional[ResolverPipelineConfigArgs] = None,
             request_template: Optional[str] = None,
             response_template: Optional[str] = None,
             sync_config: Optional[ResolverSyncConfigArgs] = None,
             type: Optional[str] = None)
@overload
def Resolver(resource_name: str,
             args: ResolverArgs,
             opts: Optional[ResourceOptions] = None)
func NewResolver(ctx *Context, name string, args ResolverArgs, opts ...ResourceOption) (*Resolver, error)
public Resolver(string name, ResolverArgs args, CustomResourceOptions? opts = null)
public Resolver(String name, ResolverArgs args)
public Resolver(String name, ResolverArgs args, CustomResourceOptions options)
type: aws:appsync:Resolver
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ResolverArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ResolverArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ResolverArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ResolverArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ResolverArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Resolver Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Resolver resource accepts the following input properties:

ApiId string

API ID for the GraphQL API.

Field string

Field name from the schema defined in the GraphQL API.

Type string

Type name from the schema defined in the GraphQL API.

CachingConfig ResolverCachingConfigArgs

CachingConfig.

DataSource string

Data source name.

Kind string

Resolver type. Valid values are UNIT and PIPELINE.

MaxBatchSize int

Maximum batching size for a resolver. Valid values are between 0 and 2000.

PipelineConfig ResolverPipelineConfigArgs

PipelineConfig.

RequestTemplate string

Request mapping template for UNIT resolver or 'before mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

ResponseTemplate string

Response mapping template for UNIT resolver or 'after mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

SyncConfig ResolverSyncConfigArgs

Describes a Sync configuration for a resolver. See Sync Config.

ApiId string

API ID for the GraphQL API.

Field string

Field name from the schema defined in the GraphQL API.

Type string

Type name from the schema defined in the GraphQL API.

CachingConfig ResolverCachingConfigArgs

CachingConfig.

DataSource string

Data source name.

Kind string

Resolver type. Valid values are UNIT and PIPELINE.

MaxBatchSize int

Maximum batching size for a resolver. Valid values are between 0 and 2000.

PipelineConfig ResolverPipelineConfigArgs

PipelineConfig.

RequestTemplate string

Request mapping template for UNIT resolver or 'before mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

ResponseTemplate string

Response mapping template for UNIT resolver or 'after mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

SyncConfig ResolverSyncConfigArgs

Describes a Sync configuration for a resolver. See Sync Config.

apiId String

API ID for the GraphQL API.

field String

Field name from the schema defined in the GraphQL API.

type String

Type name from the schema defined in the GraphQL API.

cachingConfig ResolverCachingConfigArgs

CachingConfig.

dataSource String

Data source name.

kind String

Resolver type. Valid values are UNIT and PIPELINE.

maxBatchSize Integer

Maximum batching size for a resolver. Valid values are between 0 and 2000.

pipelineConfig ResolverPipelineConfigArgs

PipelineConfig.

requestTemplate String

Request mapping template for UNIT resolver or 'before mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

responseTemplate String

Response mapping template for UNIT resolver or 'after mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

syncConfig ResolverSyncConfigArgs

Describes a Sync configuration for a resolver. See Sync Config.

apiId string

API ID for the GraphQL API.

field string

Field name from the schema defined in the GraphQL API.

type string

Type name from the schema defined in the GraphQL API.

cachingConfig ResolverCachingConfigArgs

CachingConfig.

dataSource string

Data source name.

kind string

Resolver type. Valid values are UNIT and PIPELINE.

maxBatchSize number

Maximum batching size for a resolver. Valid values are between 0 and 2000.

pipelineConfig ResolverPipelineConfigArgs

PipelineConfig.

requestTemplate string

Request mapping template for UNIT resolver or 'before mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

responseTemplate string

Response mapping template for UNIT resolver or 'after mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

syncConfig ResolverSyncConfigArgs

Describes a Sync configuration for a resolver. See Sync Config.

api_id str

API ID for the GraphQL API.

field str

Field name from the schema defined in the GraphQL API.

type str

Type name from the schema defined in the GraphQL API.

caching_config ResolverCachingConfigArgs

CachingConfig.

data_source str

Data source name.

kind str

Resolver type. Valid values are UNIT and PIPELINE.

max_batch_size int

Maximum batching size for a resolver. Valid values are between 0 and 2000.

pipeline_config ResolverPipelineConfigArgs

PipelineConfig.

request_template str

Request mapping template for UNIT resolver or 'before mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

response_template str

Response mapping template for UNIT resolver or 'after mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

sync_config ResolverSyncConfigArgs

Describes a Sync configuration for a resolver. See Sync Config.

apiId String

API ID for the GraphQL API.

field String

Field name from the schema defined in the GraphQL API.

type String

Type name from the schema defined in the GraphQL API.

cachingConfig Property Map

CachingConfig.

dataSource String

Data source name.

kind String

Resolver type. Valid values are UNIT and PIPELINE.

maxBatchSize Number

Maximum batching size for a resolver. Valid values are between 0 and 2000.

pipelineConfig Property Map

PipelineConfig.

requestTemplate String

Request mapping template for UNIT resolver or 'before mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

responseTemplate String

Response mapping template for UNIT resolver or 'after mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

syncConfig Property Map

Describes a Sync configuration for a resolver. See Sync Config.

Outputs

All input properties are implicitly available as output properties. Additionally, the Resolver resource produces the following output properties:

Arn string

ARN

Id string

The provider-assigned unique ID for this managed resource.

Arn string

ARN

Id string

The provider-assigned unique ID for this managed resource.

arn String

ARN

id String

The provider-assigned unique ID for this managed resource.

arn string

ARN

id string

The provider-assigned unique ID for this managed resource.

arn str

ARN

id str

The provider-assigned unique ID for this managed resource.

arn String

ARN

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing Resolver Resource

Get an existing Resolver resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ResolverState, opts?: CustomResourceOptions): Resolver
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        api_id: Optional[str] = None,
        arn: Optional[str] = None,
        caching_config: Optional[ResolverCachingConfigArgs] = None,
        data_source: Optional[str] = None,
        field: Optional[str] = None,
        kind: Optional[str] = None,
        max_batch_size: Optional[int] = None,
        pipeline_config: Optional[ResolverPipelineConfigArgs] = None,
        request_template: Optional[str] = None,
        response_template: Optional[str] = None,
        sync_config: Optional[ResolverSyncConfigArgs] = None,
        type: Optional[str] = None) -> Resolver
func GetResolver(ctx *Context, name string, id IDInput, state *ResolverState, opts ...ResourceOption) (*Resolver, error)
public static Resolver Get(string name, Input<string> id, ResolverState? state, CustomResourceOptions? opts = null)
public static Resolver get(String name, Output<String> id, ResolverState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ApiId string

API ID for the GraphQL API.

Arn string

ARN

CachingConfig ResolverCachingConfigArgs

CachingConfig.

DataSource string

Data source name.

Field string

Field name from the schema defined in the GraphQL API.

Kind string

Resolver type. Valid values are UNIT and PIPELINE.

MaxBatchSize int

Maximum batching size for a resolver. Valid values are between 0 and 2000.

PipelineConfig ResolverPipelineConfigArgs

PipelineConfig.

RequestTemplate string

Request mapping template for UNIT resolver or 'before mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

ResponseTemplate string

Response mapping template for UNIT resolver or 'after mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

SyncConfig ResolverSyncConfigArgs

Describes a Sync configuration for a resolver. See Sync Config.

Type string

Type name from the schema defined in the GraphQL API.

ApiId string

API ID for the GraphQL API.

Arn string

ARN

CachingConfig ResolverCachingConfigArgs

CachingConfig.

DataSource string

Data source name.

Field string

Field name from the schema defined in the GraphQL API.

Kind string

Resolver type. Valid values are UNIT and PIPELINE.

MaxBatchSize int

Maximum batching size for a resolver. Valid values are between 0 and 2000.

PipelineConfig ResolverPipelineConfigArgs

PipelineConfig.

RequestTemplate string

Request mapping template for UNIT resolver or 'before mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

ResponseTemplate string

Response mapping template for UNIT resolver or 'after mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

SyncConfig ResolverSyncConfigArgs

Describes a Sync configuration for a resolver. See Sync Config.

Type string

Type name from the schema defined in the GraphQL API.

apiId String

API ID for the GraphQL API.

arn String

ARN

cachingConfig ResolverCachingConfigArgs

CachingConfig.

dataSource String

Data source name.

field String

Field name from the schema defined in the GraphQL API.

kind String

Resolver type. Valid values are UNIT and PIPELINE.

maxBatchSize Integer

Maximum batching size for a resolver. Valid values are between 0 and 2000.

pipelineConfig ResolverPipelineConfigArgs

PipelineConfig.

requestTemplate String

Request mapping template for UNIT resolver or 'before mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

responseTemplate String

Response mapping template for UNIT resolver or 'after mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

syncConfig ResolverSyncConfigArgs

Describes a Sync configuration for a resolver. See Sync Config.

type String

Type name from the schema defined in the GraphQL API.

apiId string

API ID for the GraphQL API.

arn string

ARN

cachingConfig ResolverCachingConfigArgs

CachingConfig.

dataSource string

Data source name.

field string

Field name from the schema defined in the GraphQL API.

kind string

Resolver type. Valid values are UNIT and PIPELINE.

maxBatchSize number

Maximum batching size for a resolver. Valid values are between 0 and 2000.

pipelineConfig ResolverPipelineConfigArgs

PipelineConfig.

requestTemplate string

Request mapping template for UNIT resolver or 'before mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

responseTemplate string

Response mapping template for UNIT resolver or 'after mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

syncConfig ResolverSyncConfigArgs

Describes a Sync configuration for a resolver. See Sync Config.

type string

Type name from the schema defined in the GraphQL API.

api_id str

API ID for the GraphQL API.

arn str

ARN

caching_config ResolverCachingConfigArgs

CachingConfig.

data_source str

Data source name.

field str

Field name from the schema defined in the GraphQL API.

kind str

Resolver type. Valid values are UNIT and PIPELINE.

max_batch_size int

Maximum batching size for a resolver. Valid values are between 0 and 2000.

pipeline_config ResolverPipelineConfigArgs

PipelineConfig.

request_template str

Request mapping template for UNIT resolver or 'before mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

response_template str

Response mapping template for UNIT resolver or 'after mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

sync_config ResolverSyncConfigArgs

Describes a Sync configuration for a resolver. See Sync Config.

type str

Type name from the schema defined in the GraphQL API.

apiId String

API ID for the GraphQL API.

arn String

ARN

cachingConfig Property Map

CachingConfig.

dataSource String

Data source name.

field String

Field name from the schema defined in the GraphQL API.

kind String

Resolver type. Valid values are UNIT and PIPELINE.

maxBatchSize Number

Maximum batching size for a resolver. Valid values are between 0 and 2000.

pipelineConfig Property Map

PipelineConfig.

requestTemplate String

Request mapping template for UNIT resolver or 'before mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

responseTemplate String

Response mapping template for UNIT resolver or 'after mapping template' for PIPELINE resolver. Required for non-Lambda resolvers.

syncConfig Property Map

Describes a Sync configuration for a resolver. See Sync Config.

type String

Type name from the schema defined in the GraphQL API.

Supporting Types

ResolverCachingConfig

CachingKeys List<string>

List of caching key.

Ttl int

TTL in seconds.

CachingKeys []string

List of caching key.

Ttl int

TTL in seconds.

cachingKeys List<String>

List of caching key.

ttl Integer

TTL in seconds.

cachingKeys string[]

List of caching key.

ttl number

TTL in seconds.

caching_keys Sequence[str]

List of caching key.

ttl int

TTL in seconds.

cachingKeys List<String>

List of caching key.

ttl Number

TTL in seconds.

ResolverPipelineConfig

Functions List<string>

List of Function ID.

Functions []string

List of Function ID.

functions List<String>

List of Function ID.

functions string[]

List of Function ID.

functions Sequence[str]

List of Function ID.

functions List<String>

List of Function ID.

ResolverSyncConfig

ConflictDetection string

Conflict Detection strategy to use. Valid values are NONE and VERSION.

ConflictHandler string

Conflict Resolution strategy to perform in the event of a conflict. Valid values are NONE, OPTIMISTIC_CONCURRENCY, AUTOMERGE, and LAMBDA.

LambdaConflictHandlerConfig ResolverSyncConfigLambdaConflictHandlerConfig

Lambda Conflict Handler Config when configuring LAMBDA as the Conflict Handler. See Lambda Conflict Handler Config.

ConflictDetection string

Conflict Detection strategy to use. Valid values are NONE and VERSION.

ConflictHandler string

Conflict Resolution strategy to perform in the event of a conflict. Valid values are NONE, OPTIMISTIC_CONCURRENCY, AUTOMERGE, and LAMBDA.

LambdaConflictHandlerConfig ResolverSyncConfigLambdaConflictHandlerConfig

Lambda Conflict Handler Config when configuring LAMBDA as the Conflict Handler. See Lambda Conflict Handler Config.

conflictDetection String

Conflict Detection strategy to use. Valid values are NONE and VERSION.

conflictHandler String

Conflict Resolution strategy to perform in the event of a conflict. Valid values are NONE, OPTIMISTIC_CONCURRENCY, AUTOMERGE, and LAMBDA.

lambdaConflictHandlerConfig ResolverSyncConfigLambdaConflictHandlerConfig

Lambda Conflict Handler Config when configuring LAMBDA as the Conflict Handler. See Lambda Conflict Handler Config.

conflictDetection string

Conflict Detection strategy to use. Valid values are NONE and VERSION.

conflictHandler string

Conflict Resolution strategy to perform in the event of a conflict. Valid values are NONE, OPTIMISTIC_CONCURRENCY, AUTOMERGE, and LAMBDA.

lambdaConflictHandlerConfig ResolverSyncConfigLambdaConflictHandlerConfig

Lambda Conflict Handler Config when configuring LAMBDA as the Conflict Handler. See Lambda Conflict Handler Config.

conflict_detection str

Conflict Detection strategy to use. Valid values are NONE and VERSION.

conflict_handler str

Conflict Resolution strategy to perform in the event of a conflict. Valid values are NONE, OPTIMISTIC_CONCURRENCY, AUTOMERGE, and LAMBDA.

lambda_conflict_handler_config ResolverSyncConfigLambdaConflictHandlerConfig

Lambda Conflict Handler Config when configuring LAMBDA as the Conflict Handler. See Lambda Conflict Handler Config.

conflictDetection String

Conflict Detection strategy to use. Valid values are NONE and VERSION.

conflictHandler String

Conflict Resolution strategy to perform in the event of a conflict. Valid values are NONE, OPTIMISTIC_CONCURRENCY, AUTOMERGE, and LAMBDA.

lambdaConflictHandlerConfig Property Map

Lambda Conflict Handler Config when configuring LAMBDA as the Conflict Handler. See Lambda Conflict Handler Config.

ResolverSyncConfigLambdaConflictHandlerConfig

LambdaConflictHandlerArn string

ARN for the Lambda function to use as the Conflict Handler.

LambdaConflictHandlerArn string

ARN for the Lambda function to use as the Conflict Handler.

lambdaConflictHandlerArn String

ARN for the Lambda function to use as the Conflict Handler.

lambdaConflictHandlerArn string

ARN for the Lambda function to use as the Conflict Handler.

lambda_conflict_handler_arn str

ARN for the Lambda function to use as the Conflict Handler.

lambdaConflictHandlerArn String

ARN for the Lambda function to use as the Conflict Handler.

Import

aws_appsync_resolver can be imported with their api_id, a hyphen, type, a hypen and field e.g.,

 $ pulumi import aws:appsync/resolver:Resolver example abcdef123456-exampleType-exampleField

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.