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)

128 lines 7.33 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Resolver = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * 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, * }); * * ``` */ 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, id, opts) { return new Resolver(name, undefined, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Resolver.__pulumiType; } /** * 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, args, opts) { let resourceInputs = {}; opts = opts || {}; if (!opts.id) { if ((!args || args.apiId === undefined) && !opts.urn) { throw new Error("Missing required property 'apiId'"); } if ((!args || args.fieldName === undefined) && !opts.urn) { throw new Error("Missing required property 'fieldName'"); } if ((!args || args.typeName === undefined) && !opts.urn) { throw new Error("Missing required property 'typeName'"); } resourceInputs["apiId"] = args ? args.apiId : undefined; resourceInputs["cachingConfig"] = args ? args.cachingConfig : undefined; resourceInputs["code"] = args ? args.code : undefined; resourceInputs["codeS3Location"] = args ? args.codeS3Location : undefined; resourceInputs["dataSourceName"] = args ? args.dataSourceName : undefined; resourceInputs["fieldName"] = args ? args.fieldName : undefined; resourceInputs["kind"] = args ? args.kind : undefined; resourceInputs["maxBatchSize"] = args ? args.maxBatchSize : undefined; resourceInputs["metricsConfig"] = args ? args.metricsConfig : undefined; resourceInputs["pipelineConfig"] = args ? args.pipelineConfig : undefined; resourceInputs["requestMappingTemplate"] = args ? args.requestMappingTemplate : undefined; resourceInputs["requestMappingTemplateS3Location"] = args ? args.requestMappingTemplateS3Location : undefined; resourceInputs["responseMappingTemplate"] = args ? args.responseMappingTemplate : undefined; resourceInputs["responseMappingTemplateS3Location"] = args ? args.responseMappingTemplateS3Location : undefined; resourceInputs["runtime"] = args ? args.runtime : undefined; resourceInputs["syncConfig"] = args ? args.syncConfig : undefined; resourceInputs["typeName"] = args ? args.typeName : undefined; resourceInputs["resolverArn"] = undefined /*out*/; } else { resourceInputs["apiId"] = undefined /*out*/; resourceInputs["cachingConfig"] = undefined /*out*/; resourceInputs["code"] = undefined /*out*/; resourceInputs["codeS3Location"] = undefined /*out*/; resourceInputs["dataSourceName"] = undefined /*out*/; resourceInputs["fieldName"] = undefined /*out*/; resourceInputs["kind"] = undefined /*out*/; resourceInputs["maxBatchSize"] = undefined /*out*/; resourceInputs["metricsConfig"] = undefined /*out*/; resourceInputs["pipelineConfig"] = undefined /*out*/; resourceInputs["requestMappingTemplate"] = undefined /*out*/; resourceInputs["requestMappingTemplateS3Location"] = undefined /*out*/; resourceInputs["resolverArn"] = undefined /*out*/; resourceInputs["responseMappingTemplate"] = undefined /*out*/; resourceInputs["responseMappingTemplateS3Location"] = undefined /*out*/; resourceInputs["runtime"] = undefined /*out*/; resourceInputs["syncConfig"] = undefined /*out*/; resourceInputs["typeName"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const replaceOnChanges = { replaceOnChanges: ["apiId", "fieldName", "typeName"] }; opts = pulumi.mergeOptions(opts, replaceOnChanges); super(Resolver.__pulumiType, name, resourceInputs, opts); } } exports.Resolver = Resolver; /** @internal */ Resolver.__pulumiType = 'aws-native:appsync:Resolver'; //# sourceMappingURL=resolver.js.map