aws-cdk-lib.aws_appsync.CfnDataSourceProps

interface CfnDataSourceProps

LanguageType name
.NETAmazon.CDK.AWS.AppSync.CfnDataSourceProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsappsync#CfnDataSourceProps
Javasoftware.amazon.awscdk.services.appsync.CfnDataSourceProps
Pythonaws_cdk.aws_appsync.CfnDataSourceProps
TypeScript aws-cdk-lib » aws_appsync » CfnDataSourceProps

Properties for defining a CfnDataSource.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appsync as appsync } from 'aws-cdk-lib';
const cfnDataSourceProps: appsync.CfnDataSourceProps = {
  apiId: 'apiId',
  name: 'name',
  type: 'type',

  // the properties below are optional
  description: 'description',
  dynamoDbConfig: {
    awsRegion: 'awsRegion',
    tableName: 'tableName',

    // the properties below are optional
    deltaSyncConfig: {
      baseTableTtl: 'baseTableTtl',
      deltaSyncTableName: 'deltaSyncTableName',
      deltaSyncTableTtl: 'deltaSyncTableTtl',
    },
    useCallerCredentials: false,
    versioned: false,
  },
  elasticsearchConfig: {
    awsRegion: 'awsRegion',
    endpoint: 'endpoint',
  },
  eventBridgeConfig: {
    eventBusArn: 'eventBusArn',
  },
  httpConfig: {
    endpoint: 'endpoint',

    // the properties below are optional
    authorizationConfig: {
      authorizationType: 'authorizationType',

      // the properties below are optional
      awsIamConfig: {
        signingRegion: 'signingRegion',
        signingServiceName: 'signingServiceName',
      },
    },
  },
  lambdaConfig: {
    lambdaFunctionArn: 'lambdaFunctionArn',
  },
  openSearchServiceConfig: {
    awsRegion: 'awsRegion',
    endpoint: 'endpoint',
  },
  relationalDatabaseConfig: {
    relationalDatabaseSourceType: 'relationalDatabaseSourceType',

    // the properties below are optional
    rdsHttpEndpointConfig: {
      awsRegion: 'awsRegion',
      awsSecretStoreArn: 'awsSecretStoreArn',
      dbClusterIdentifier: 'dbClusterIdentifier',

      // the properties below are optional
      databaseName: 'databaseName',
      schema: 'schema',
    },
  },
  serviceRoleArn: 'serviceRoleArn',
};

Properties

NameTypeDescription
apiIdstringUnique AWS AppSync GraphQL API identifier where this data source will be created.
namestringFriendly name for you to identify your AppSync data source after creation.
typestringThe type of the data source.
description?stringThe description of the data source.
dynamoDbConfig?IResolvable | DynamoDBConfigPropertyAWS Region and TableName for an Amazon DynamoDB table in your account.
elasticsearchConfig?IResolvable | ElasticsearchConfigPropertyAWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.
eventBridgeConfig?IResolvable | EventBridgeConfigPropertyAn EventBridge configuration that contains a valid ARN of an event bus.
httpConfig?IResolvable | HttpConfigPropertyEndpoints for an HTTP data source.
lambdaConfig?IResolvable | LambdaConfigPropertyAn ARN of a Lambda function in valid ARN format.
openSearchServiceConfig?IResolvable | OpenSearchServiceConfigPropertyAWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.
relationalDatabaseConfig?IResolvable | RelationalDatabaseConfigPropertyRelational Database configuration of the relational database data source.
serviceRoleArn?stringThe AWS Identity and Access Management service role ARN for the data source.

apiId

Type: string

Unique AWS AppSync GraphQL API identifier where this data source will be created.


name

Type: string

Friendly name for you to identify your AppSync data source after creation.


type

Type: string

The type of the data source.

  • AWS_LAMBDA : The data source is an AWS Lambda function.
  • AMAZON_DYNAMODB : The data source is an Amazon DynamoDB table.
  • AMAZON_ELASTICSEARCH : The data source is an Amazon OpenSearch Service domain.
  • AMAZON_EVENTBRIDGE : The data source is an Amazon EventBridge event bus.
  • AMAZON_OPENSEARCH_SERVICE : The data source is an Amazon OpenSearch Service domain.
  • NONE : There is no data source. This type is used when you wish to invoke a GraphQL operation without connecting to a data source, such as performing data transformation with resolvers or triggering a subscription to be invoked from a mutation.
  • HTTP : The data source is an HTTP endpoint.
  • RELATIONAL_DATABASE : The data source is a relational database.

description?

Type: string (optional)

The description of the data source.


dynamoDbConfig?

Type: IResolvable | DynamoDBConfigProperty (optional)

AWS Region and TableName for an Amazon DynamoDB table in your account.


elasticsearchConfig?

Type: IResolvable | ElasticsearchConfigProperty (optional)

AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.

As of September 2021, Amazon Elasticsearch Service is Amazon OpenSearch Service . This property is deprecated. For new data sources, use OpenSearchServiceConfig to specify an OpenSearch Service data source.


eventBridgeConfig?

Type: IResolvable | EventBridgeConfigProperty (optional)

An EventBridge configuration that contains a valid ARN of an event bus.


httpConfig?

Type: IResolvable | HttpConfigProperty (optional)

Endpoints for an HTTP data source.


lambdaConfig?

Type: IResolvable | LambdaConfigProperty (optional)

An ARN of a Lambda function in valid ARN format.

This can be the ARN of a Lambda function that exists in the current account or in another account.


openSearchServiceConfig?

Type: IResolvable | OpenSearchServiceConfigProperty (optional)

AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.


relationalDatabaseConfig?

Type: IResolvable | RelationalDatabaseConfigProperty (optional)

Relational Database configuration of the relational database data source.


serviceRoleArn?

Type: string (optional)

The AWS Identity and Access Management service role ARN for the data source.

The system assumes this role when accessing the data source.

Required if Type is specified as AWS_LAMBDA , AMAZON_DYNAMODB , AMAZON_ELASTICSEARCH , AMAZON_EVENTBRIDGE , or AMAZON_OPENSEARCH_SERVICE .