Class CfnDataSource
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.appsync.CfnDataSource
- All Implemented Interfaces:
IInspectable,IDataSourceRef,IEnvironmentAware,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-17T14:40:45.417Z")
@Stability(Stable)
public class CfnDataSource
extends CfnResource
implements IInspectable, IDataSourceRef
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceTheAuthorizationConfigproperty type specifies the authorization type and configuration for an AWS AppSync http data source.static interfaceUse theAwsIamConfigproperty type to specifyAwsIamConfigfor a AWS AppSync authorizaton.static final classA fluent builder forCfnDataSource.static interfaceDescribes a Delta Sync configuration.static interfaceTheDynamoDBConfigproperty type specifies theAwsRegionandTableNamefor an Amazon DynamoDB table in your account for an AWS AppSync data source.static interfaceExample:static interfaceThe data source.static interfaceUse theHttpConfigproperty type to specifyHttpConfigfor an AWS AppSync data source.static interfaceTheLambdaConfigproperty type specifies the Lambda function ARN for an AWS AppSync data source.static interfaceTheOpenSearchServiceConfigproperty type specifies theAwsRegionandEndpointsfor an Amazon OpenSearch Service domain in your account for an AWS AppSync data source.static interfaceUse theRdsHttpEndpointConfigproperty type to specify theRdsHttpEndpointfor an AWS AppSync relational database.static interfaceUse theRelationalDatabaseConfigproperty type to specifyRelationalDatabaseConfigfor an AWS AppSync data source.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.appsync.IDataSourceRef
IDataSourceRef.Jsii$Default, IDataSourceRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnDataSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnDataSource(software.amazon.jsii.JsiiObjectRef objRef) CfnDataSource(software.constructs.Construct scope, String id, CfnDataSourceProps props) Create a newAWS::AppSync::DataSource. -
Method Summary
Modifier and TypeMethodDescriptiongetApiId()Unique AWS AppSync GraphQL API identifier where this data source will be created.The Amazon Resource Name (ARN) of the API key, such asarn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid/datasources/datasourcename.Friendly name for you to identify your AWS AppSync data source after creation.A reference to a DataSource resource.The description of the data source.AWS Region and TableName for an Amazon DynamoDB table in your account.Deprecated.this property has been deprecatedAn EventBridge configuration that contains a valid ARN of an event bus.Endpoints for an HTTP data source.An ARN of a Lambda function in valid ARN format.Enables or disables enhanced data source metrics for specified data sources.getName()Friendly name for you to identify your AppSync data source after creation.AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.Relational Database configuration of the relational database data source.The AWS Identity and Access Management service role ARN for the data source.getType()The type of the data source.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidUnique AWS AppSync GraphQL API identifier where this data source will be created.voidsetDescription(String value) The description of the data source.voidsetDynamoDbConfig(IResolvable value) AWS Region and TableName for an Amazon DynamoDB table in your account.voidAWS Region and TableName for an Amazon DynamoDB table in your account.voidDeprecated.this property has been deprecatedvoidDeprecated.this property has been deprecatedvoidsetEventBridgeConfig(IResolvable value) An EventBridge configuration that contains a valid ARN of an event bus.voidAn EventBridge configuration that contains a valid ARN of an event bus.voidsetHttpConfig(IResolvable value) Endpoints for an HTTP data source.voidEndpoints for an HTTP data source.voidsetLambdaConfig(IResolvable value) An ARN of a Lambda function in valid ARN format.voidAn ARN of a Lambda function in valid ARN format.voidsetMetricsConfig(String value) Enables or disables enhanced data source metrics for specified data sources.voidFriendly name for you to identify your AppSync data source after creation.voidAWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.voidAWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.voidRelational Database configuration of the relational database data source.voidRelational Database configuration of the relational database data source.voidsetServiceRoleArn(String value) The AWS Identity and Access Management service role ARN for the data source.voidThe type of the data source.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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) Create a newAWS::AppSync::DataSource.- 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
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrDataSourceArn
The Amazon Resource Name (ARN) of the API key, such asarn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid/datasources/datasourcename. -
getAttrName
Friendly name for you to identify your AWS AppSync data source after creation. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getDataSourceRef
A reference to a DataSource resource.- Specified by:
getDataSourceRefin interfaceIDataSourceRef
-
getApiId
Unique AWS AppSync GraphQL API identifier where this data source will be created. -
setApiId
Unique AWS AppSync GraphQL API identifier where this data source will be created. -
getName
Friendly name for you to identify your AppSync data source after creation. -
setName
Friendly name for you to identify your AppSync data source after creation. -
getType
The type of the data source. -
setType
The type of the data source. -
getDescription
The description of the data source. -
setDescription
The description of the data source. -
getDynamoDbConfig
AWS Region and TableName for an Amazon DynamoDB table in your account.Returns union: either
IResolvableorCfnDataSource.DynamoDBConfigProperty -
setDynamoDbConfig
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
Deprecated.this property has been deprecatedReturns union: eitherIResolvableorCfnDataSource.ElasticsearchConfigProperty -
setElasticsearchConfig
Deprecated.this property has been deprecated -
setElasticsearchConfig
@Stability(Deprecated) @Deprecated public void setElasticsearchConfig(@Nullable CfnDataSource.ElasticsearchConfigProperty value) Deprecated.this property has been deprecated -
getEventBridgeConfig
An EventBridge configuration that contains a valid ARN of an event bus.Returns union: either
IResolvableorCfnDataSource.EventBridgeConfigProperty -
setEventBridgeConfig
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
Endpoints for an HTTP data source.Returns union: either
IResolvableorCfnDataSource.HttpConfigProperty -
setHttpConfig
Endpoints for an HTTP data source. -
setHttpConfig
Endpoints for an HTTP data source. -
getLambdaConfig
An ARN of a Lambda function in valid ARN format.Returns union: either
IResolvableorCfnDataSource.LambdaConfigProperty -
setLambdaConfig
An ARN of a Lambda function in valid ARN format. -
setLambdaConfig
An ARN of a Lambda function in valid ARN format. -
getMetricsConfig
Enables or disables enhanced data source metrics for specified data sources. -
setMetricsConfig
Enables or disables enhanced data source metrics for specified data sources. -
getOpenSearchServiceConfig
AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.Returns union: either
IResolvableorCfnDataSource.OpenSearchServiceConfigProperty -
setOpenSearchServiceConfig
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
Relational Database configuration of the relational database data source.Returns union: either
IResolvableorCfnDataSource.RelationalDatabaseConfigProperty -
setRelationalDatabaseConfig
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
The AWS Identity and Access Management service role ARN for the data source. -
setServiceRoleArn
The AWS Identity and Access Management service role ARN for the data source.
-