@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)
140 lines • 6.05 kB
JavaScript
;
// *** 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.DataSource = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource Type definition for AWS::AppSync::DataSource
*
* ## 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 dataSourceDescription = config.require("dataSourceDescription");
* const serviceRoleArn = config.require("serviceRoleArn");
* const lambdaFunctionArn = config.require("lambdaFunctionArn");
* const dataSource = new aws_native.appsync.DataSource("dataSource", {
* apiId: graphQlApiId,
* name: dataSourceName,
* description: dataSourceDescription,
* type: "AWS_LAMBDA",
* serviceRoleArn: serviceRoleArn,
* lambdaConfig: {
* lambdaFunctionArn: lambdaFunctionArn,
* },
* });
*
* ```
* ### 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 dataSourceDescription = config.require("dataSourceDescription");
* const serviceRoleArn = config.require("serviceRoleArn");
* const lambdaFunctionArn = config.require("lambdaFunctionArn");
* const dataSource = new aws_native.appsync.DataSource("dataSource", {
* apiId: graphQlApiId,
* name: dataSourceName,
* description: dataSourceDescription,
* type: "AWS_LAMBDA",
* serviceRoleArn: serviceRoleArn,
* lambdaConfig: {
* lambdaFunctionArn: lambdaFunctionArn,
* },
* });
*
* ```
*/
class DataSource extends pulumi.CustomResource {
/**
* Get an existing DataSource 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 DataSource(name, undefined, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of DataSource. 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'] === DataSource.__pulumiType;
}
/**
* Create a DataSource 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?.apiId === undefined && !opts.urn) {
throw new Error("Missing required property 'apiId'");
}
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["apiId"] = args?.apiId;
resourceInputs["description"] = args?.description;
resourceInputs["dynamoDbConfig"] = args?.dynamoDbConfig;
resourceInputs["elasticsearchConfig"] = args?.elasticsearchConfig;
resourceInputs["eventBridgeConfig"] = args?.eventBridgeConfig;
resourceInputs["httpConfig"] = args?.httpConfig;
resourceInputs["lambdaConfig"] = args?.lambdaConfig;
resourceInputs["metricsConfig"] = args?.metricsConfig;
resourceInputs["name"] = args?.name;
resourceInputs["openSearchServiceConfig"] = args?.openSearchServiceConfig;
resourceInputs["relationalDatabaseConfig"] = args?.relationalDatabaseConfig;
resourceInputs["serviceRoleArn"] = args?.serviceRoleArn;
resourceInputs["type"] = args?.type;
resourceInputs["dataSourceArn"] = undefined /*out*/;
}
else {
resourceInputs["apiId"] = undefined /*out*/;
resourceInputs["dataSourceArn"] = undefined /*out*/;
resourceInputs["description"] = undefined /*out*/;
resourceInputs["dynamoDbConfig"] = undefined /*out*/;
resourceInputs["elasticsearchConfig"] = undefined /*out*/;
resourceInputs["eventBridgeConfig"] = undefined /*out*/;
resourceInputs["httpConfig"] = undefined /*out*/;
resourceInputs["lambdaConfig"] = undefined /*out*/;
resourceInputs["metricsConfig"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["openSearchServiceConfig"] = undefined /*out*/;
resourceInputs["relationalDatabaseConfig"] = undefined /*out*/;
resourceInputs["serviceRoleArn"] = undefined /*out*/;
resourceInputs["type"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const replaceOnChanges = { replaceOnChanges: ["apiId", "name"] };
opts = pulumi.mergeOptions(opts, replaceOnChanges);
super(DataSource.__pulumiType, name, resourceInputs, opts);
}
}
exports.DataSource = DataSource;
/** @internal */
DataSource.__pulumiType = 'aws-native:appsync:DataSource';
//# sourceMappingURL=dataSource.js.map