UNPKG

@pulumi/aws-native

Version:

The Pulumi AWS Cloud Control Provider enables you to build, deploy, and manage [any AWS resource that's supported by the AWS Cloud Control API](https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-gen-aws-native/supported-types.txt)

210 lines (209 loc) 10.9 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; import * as enums from "../types/enums"; /** * The ``AWS::AppSync::Resolver`` resource 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](https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference.html). * When you submit an update, CFNLong 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 CFNshort template. Changing the S3 file content without changing a property value will not result in an update operation. * See [Update Behaviors of Stack Resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html) in the *User Guide*. * * ## Example Usage * ### Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws_native from "@pulumi/aws-native"; * * const config = new pulumi.Config(); * const graphQlApiId = config.require("graphQlApiId"); * const dataSourceName = config.require("dataSourceName"); * const fieldName = config.require("fieldName"); * const typeName = config.require("typeName"); * const requestMappingTemplateS3LocationInput = config.require("requestMappingTemplateS3LocationInput"); * const responseMappingTemplateS3LocationInput = config.require("responseMappingTemplateS3LocationInput"); * const resolver = new aws_native.appsync.Resolver("resolver", { * apiId: graphQlApiId, * typeName: typeName, * fieldName: fieldName, * dataSourceName: dataSourceName, * requestMappingTemplateS3Location: requestMappingTemplateS3LocationInput, * responseMappingTemplateS3Location: responseMappingTemplateS3LocationInput, * }); * * ``` */ export declare class Resolver extends pulumi.CustomResource { /** * Get an existing Resolver resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): Resolver; /** * Returns true if the given object is an instance of Resolver. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Resolver; /** * The APSYlong GraphQL API to which you want to attach this resolver. */ readonly apiId: pulumi.Output<string>; /** * The caching configuration for the resolver. */ readonly cachingConfig: pulumi.Output<outputs.appsync.ResolverCachingConfig | undefined>; /** * 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``. */ readonly code: pulumi.Output<string | undefined>; /** * The Amazon S3 endpoint. */ readonly codeS3Location: pulumi.Output<string | undefined>; /** * The resolver data source name. */ readonly dataSourceName: pulumi.Output<string | undefined>; /** * The GraphQL field on a type that invokes the resolver. */ readonly fieldName: pulumi.Output<string>; /** * The resolver type. * + *UNIT*: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source. * + *PIPELINE*: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of ``Function`` objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources. */ readonly kind: pulumi.Output<string | undefined>; /** * The maximum number of resolver request inputs that will be sent to a single LAMlong function in a ``BatchInvoke`` operation. */ readonly maxBatchSize: pulumi.Output<number | undefined>; /** * Enables or disables enhanced resolver metrics for specified resolvers. Note that ``MetricsConfig`` won't be used unless the ``resolverLevelMetricsBehavior`` value is set to ``PER_RESOLVER_METRICS``. If the ``resolverLevelMetricsBehavior`` is set to ``FULL_REQUEST_RESOLVER_METRICS`` instead, ``MetricsConfig`` will be ignored. However, you can still set its value. */ readonly metricsConfig: pulumi.Output<enums.appsync.ResolverMetricsConfig | undefined>; /** * Functions linked with the pipeline resolver. */ readonly pipelineConfig: pulumi.Output<outputs.appsync.ResolverPipelineConfig | undefined>; /** * The request mapping template. * Request mapping templates are optional when using a Lambda data source. For all other data sources, a request mapping template is required. */ readonly requestMappingTemplate: pulumi.Output<string | undefined>; /** * The location of a request mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template. */ readonly requestMappingTemplateS3Location: pulumi.Output<string | undefined>; /** * ARN of the resolver, such as `arn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid/types/typename/resolvers/resolvername` . */ readonly resolverArn: pulumi.Output<string>; /** * The response mapping template. */ readonly responseMappingTemplate: pulumi.Output<string | undefined>; /** * The location of a response mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template. */ readonly responseMappingTemplateS3Location: pulumi.Output<string | undefined>; /** * Describes a runtime used by an APSYlong resolver or APSYlong function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. */ readonly runtime: pulumi.Output<outputs.appsync.ResolverAppSyncRuntime | undefined>; /** * The ``SyncConfig`` for a resolver attached to a versioned data source. */ readonly syncConfig: pulumi.Output<outputs.appsync.ResolverSyncConfig | undefined>; /** * The GraphQL type that invokes this resolver. */ readonly typeName: pulumi.Output<string>; /** * Create a Resolver resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ResolverArgs, opts?: pulumi.CustomResourceOptions); } /** * The set of arguments for constructing a Resolver resource. */ export interface ResolverArgs { /** * The APSYlong GraphQL API to which you want to attach this resolver. */ apiId: pulumi.Input<string>; /** * The caching configuration for the resolver. */ cachingConfig?: pulumi.Input<inputs.appsync.ResolverCachingConfigArgs>; /** * 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?: pulumi.Input<string>; /** * The Amazon S3 endpoint. */ codeS3Location?: pulumi.Input<string>; /** * The resolver data source name. */ dataSourceName?: pulumi.Input<string>; /** * The GraphQL field on a type that invokes the resolver. */ fieldName: pulumi.Input<string>; /** * The resolver type. * + *UNIT*: A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source. * + *PIPELINE*: A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of ``Function`` objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources. */ kind?: pulumi.Input<string>; /** * The maximum number of resolver request inputs that will be sent to a single LAMlong function in a ``BatchInvoke`` operation. */ maxBatchSize?: pulumi.Input<number>; /** * Enables or disables enhanced resolver metrics for specified resolvers. Note that ``MetricsConfig`` won't be used unless the ``resolverLevelMetricsBehavior`` value is set to ``PER_RESOLVER_METRICS``. If the ``resolverLevelMetricsBehavior`` is set to ``FULL_REQUEST_RESOLVER_METRICS`` instead, ``MetricsConfig`` will be ignored. However, you can still set its value. */ metricsConfig?: pulumi.Input<enums.appsync.ResolverMetricsConfig>; /** * Functions linked with the pipeline resolver. */ pipelineConfig?: pulumi.Input<inputs.appsync.ResolverPipelineConfigArgs>; /** * The request mapping template. * Request mapping templates are optional when using a Lambda data source. For all other data sources, a request mapping template is required. */ requestMappingTemplate?: pulumi.Input<string>; /** * The location of a request mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template. */ requestMappingTemplateS3Location?: pulumi.Input<string>; /** * The response mapping template. */ responseMappingTemplate?: pulumi.Input<string>; /** * The location of a response mapping template in an S3 bucket. Use this if you want to provision with a template file in S3 rather than embedding it in your CFNshort template. */ responseMappingTemplateS3Location?: pulumi.Input<string>; /** * Describes a runtime used by an APSYlong resolver or APSYlong function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. */ runtime?: pulumi.Input<inputs.appsync.ResolverAppSyncRuntimeArgs>; /** * The ``SyncConfig`` for a resolver attached to a versioned data source. */ syncConfig?: pulumi.Input<inputs.appsync.ResolverSyncConfigArgs>; /** * The GraphQL type that invokes this resolver. */ typeName: pulumi.Input<string>; }