Class CfnDataSource

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:12.737Z") @Stability(Stable) public class CfnDataSource extends CfnResource implements IInspectable
The AWS::AppSync::DataSource resource creates data sources for resolvers in AWS AppSync to connect to, such as Amazon DynamoDB , AWS Lambda , and Amazon OpenSearch Service .

Resolvers use these data sources to fetch data when clients make GraphQL calls.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.appsync.*;
 CfnDataSource cfnDataSource = CfnDataSource.Builder.create(this, "MyCfnDataSource")
         .apiId("apiId")
         .name("name")
         .type("type")
         // the properties below are optional
         .description("description")
         .dynamoDbConfig(DynamoDBConfigProperty.builder()
                 .awsRegion("awsRegion")
                 .tableName("tableName")
                 // the properties below are optional
                 .deltaSyncConfig(DeltaSyncConfigProperty.builder()
                         .baseTableTtl("baseTableTtl")
                         .deltaSyncTableName("deltaSyncTableName")
                         .deltaSyncTableTtl("deltaSyncTableTtl")
                         .build())
                 .useCallerCredentials(false)
                 .versioned(false)
                 .build())
         .elasticsearchConfig(ElasticsearchConfigProperty.builder()
                 .awsRegion("awsRegion")
                 .endpoint("endpoint")
                 .build())
         .eventBridgeConfig(EventBridgeConfigProperty.builder()
                 .eventBusArn("eventBusArn")
                 .build())
         .httpConfig(HttpConfigProperty.builder()
                 .endpoint("endpoint")
                 // the properties below are optional
                 .authorizationConfig(AuthorizationConfigProperty.builder()
                         .authorizationType("authorizationType")
                         // the properties below are optional
                         .awsIamConfig(AwsIamConfigProperty.builder()
                                 .signingRegion("signingRegion")
                                 .signingServiceName("signingServiceName")
                                 .build())
                         .build())
                 .build())
         .lambdaConfig(LambdaConfigProperty.builder()
                 .lambdaFunctionArn("lambdaFunctionArn")
                 .build())
         .metricsConfig("metricsConfig")
         .openSearchServiceConfig(OpenSearchServiceConfigProperty.builder()
                 .awsRegion("awsRegion")
                 .endpoint("endpoint")
                 .build())
         .relationalDatabaseConfig(RelationalDatabaseConfigProperty.builder()
                 .relationalDatabaseSourceType("relationalDatabaseSourceType")
                 // the properties below are optional
                 .rdsHttpEndpointConfig(RdsHttpEndpointConfigProperty.builder()
                         .awsRegion("awsRegion")
                         .awsSecretStoreArn("awsSecretStoreArn")
                         .dbClusterIdentifier("dbClusterIdentifier")
                         // the properties below are optional
                         .databaseName("databaseName")
                         .schema("schema")
                         .build())
                 .build())
         .serviceRoleArn("serviceRoleArn")
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnDataSource

      protected CfnDataSource(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnDataSource

      protected CfnDataSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnDataSource

      @Stability(Stable) public CfnDataSource(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnDataSourceProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrDataSourceArn

      @Stability(Stable) @NotNull public String getAttrDataSourceArn()
      The Amazon Resource Name (ARN) of the API key, such as arn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid/datasources/datasourcename .
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
      The ID value.
    • getAttrName

      @Stability(Stable) @NotNull public String getAttrName()
      Friendly name for you to identify your AWS AppSync data source after creation.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getApiId

      @Stability(Stable) @NotNull public String getApiId()
      Unique AWS AppSync GraphQL API identifier where this data source will be created.
    • setApiId

      @Stability(Stable) public void setApiId(@NotNull String value)
      Unique AWS AppSync GraphQL API identifier where this data source will be created.
    • getName

      @Stability(Stable) @NotNull public String getName()
      Friendly name for you to identify your AppSync data source after creation.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      Friendly name for you to identify your AppSync data source after creation.
    • getType

      @Stability(Stable) @NotNull public String getType()
      The type of the data source.
    • setType

      @Stability(Stable) public void setType(@NotNull String value)
      The type of the data source.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the data source.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      The description of the data source.
    • getDynamoDbConfig

      @Stability(Stable) @Nullable public Object getDynamoDbConfig()
      AWS Region and TableName for an Amazon DynamoDB table in your account.
    • setDynamoDbConfig

      @Stability(Stable) public void setDynamoDbConfig(@Nullable IResolvable value)
      AWS Region and TableName for an Amazon DynamoDB table in your account.
    • setDynamoDbConfig

      @Stability(Stable) public void setDynamoDbConfig(@Nullable CfnDataSource.DynamoDBConfigProperty value)
      AWS Region and TableName for an Amazon DynamoDB table in your account.
    • getElasticsearchConfig

      @Stability(Stable) @Nullable public Object getElasticsearchConfig()
      AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.
    • setElasticsearchConfig

      @Stability(Stable) public void setElasticsearchConfig(@Nullable IResolvable value)
      AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.
    • setElasticsearchConfig

      @Stability(Stable) public void setElasticsearchConfig(@Nullable CfnDataSource.ElasticsearchConfigProperty value)
      AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.
    • getEventBridgeConfig

      @Stability(Stable) @Nullable public Object getEventBridgeConfig()
      An EventBridge configuration that contains a valid ARN of an event bus.
    • setEventBridgeConfig

      @Stability(Stable) public void setEventBridgeConfig(@Nullable IResolvable value)
      An EventBridge configuration that contains a valid ARN of an event bus.
    • setEventBridgeConfig

      @Stability(Stable) public void setEventBridgeConfig(@Nullable CfnDataSource.EventBridgeConfigProperty value)
      An EventBridge configuration that contains a valid ARN of an event bus.
    • getHttpConfig

      @Stability(Stable) @Nullable public Object getHttpConfig()
      Endpoints for an HTTP data source.
    • setHttpConfig

      @Stability(Stable) public void setHttpConfig(@Nullable IResolvable value)
      Endpoints for an HTTP data source.
    • setHttpConfig

      @Stability(Stable) public void setHttpConfig(@Nullable CfnDataSource.HttpConfigProperty value)
      Endpoints for an HTTP data source.
    • getLambdaConfig

      @Stability(Stable) @Nullable public Object getLambdaConfig()
      An ARN of a Lambda function in valid ARN format.
    • setLambdaConfig

      @Stability(Stable) public void setLambdaConfig(@Nullable IResolvable value)
      An ARN of a Lambda function in valid ARN format.
    • setLambdaConfig

      @Stability(Stable) public void setLambdaConfig(@Nullable CfnDataSource.LambdaConfigProperty value)
      An ARN of a Lambda function in valid ARN format.
    • getMetricsConfig

      @Stability(Stable) @Nullable public String getMetricsConfig()
      Enables or disables enhanced data source metrics for specified data sources.
    • setMetricsConfig

      @Stability(Stable) public void setMetricsConfig(@Nullable String value)
      Enables or disables enhanced data source metrics for specified data sources.
    • getOpenSearchServiceConfig

      @Stability(Stable) @Nullable public Object getOpenSearchServiceConfig()
      AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.
    • setOpenSearchServiceConfig

      @Stability(Stable) public void setOpenSearchServiceConfig(@Nullable IResolvable value)
      AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.
    • setOpenSearchServiceConfig

      @Stability(Stable) public void setOpenSearchServiceConfig(@Nullable CfnDataSource.OpenSearchServiceConfigProperty value)
      AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.
    • getRelationalDatabaseConfig

      @Stability(Stable) @Nullable public Object getRelationalDatabaseConfig()
      Relational Database configuration of the relational database data source.
    • setRelationalDatabaseConfig

      @Stability(Stable) public void setRelationalDatabaseConfig(@Nullable IResolvable value)
      Relational Database configuration of the relational database data source.
    • setRelationalDatabaseConfig

      @Stability(Stable) public void setRelationalDatabaseConfig(@Nullable CfnDataSource.RelationalDatabaseConfigProperty value)
      Relational Database configuration of the relational database data source.
    • getServiceRoleArn

      @Stability(Stable) @Nullable public String getServiceRoleArn()
      The AWS Identity and Access Management service role ARN for the data source.
    • setServiceRoleArn

      @Stability(Stable) public void setServiceRoleArn(@Nullable String value)
      The AWS Identity and Access Management service role ARN for the data source.