Class CfnDataSource
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
AWS::AppSync::DataSource
.
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()) .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();
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
TheAuthorizationConfig
property type specifies the authorization type and configuration for an AWS AppSync http data source.static interface
Use theAwsIamConfig
property type to specifyAwsIamConfig
for a AWS AppSync authorizaton.static final class
A fluent builder forCfnDataSource
.static interface
Describes a Delta Sync configuration.static interface
TheDynamoDBConfig
property type specifies theAwsRegion
andTableName
for an Amazon DynamoDB table in your account for an AWS AppSync data source.static interface
TheElasticsearchConfig
property type specifies theAwsRegion
andEndpoints
for an Amazon OpenSearch Service domain in your account for an AWS AppSync data source.static interface
The data source.static interface
Use theHttpConfig
property type to specifyHttpConfig
for an AWS AppSync data source.static interface
TheLambdaConfig
property type specifies the Lambda function ARN for an AWS AppSync data source.static interface
TheOpenSearchServiceConfig
property type specifies theAwsRegion
andEndpoints
for an Amazon OpenSearch Service domain in your account for an AWS AppSync data source.static interface
Use theRdsHttpEndpointConfig
property type to specify theRdsHttpEndpoint
for an AWS AppSync relational database.static interface
Use theRelationalDatabaseConfig
property type to specifyRelationalDatabaseConfig
for an AWS AppSync data source.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionCfnDataSource
(Construct scope, String id, CfnDataSourceProps props) Create a newAWS::AppSync::DataSource
.protected
CfnDataSource
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnDataSource
(software.amazon.jsii.JsiiObjectRef objRef) -
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.The description of the data source.AWS Region and TableName for an Amazon DynamoDB table in your account.AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.An 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.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.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
Unique AWS AppSync GraphQL API identifier where this data source will be created.void
setDescription
(String value) The description of the data source.void
setDynamoDbConfig
(IResolvable value) AWS Region and TableName for an Amazon DynamoDB table in your account.void
AWS Region and TableName for an Amazon DynamoDB table in your account.void
AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.void
AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.void
setEventBridgeConfig
(IResolvable value) An EventBridge configuration that contains a valid ARN of an event bus.void
An EventBridge configuration that contains a valid ARN of an event bus.void
setHttpConfig
(IResolvable value) Endpoints for an HTTP data source.void
Endpoints for an HTTP data source.void
setLambdaConfig
(IResolvable value) An ARN of a Lambda function in valid ARN format.void
An ARN of a Lambda function in valid ARN format.void
Friendly name for you to identify your AppSync data source after creation.void
AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.void
AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.void
Relational Database configuration of the relational database data source.void
Relational Database configuration of the relational database data source.void
setServiceRoleArn
(String value) The AWS Identity and Access Management service role ARN for the data source.void
The type of the data source.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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 Construct scope, @NotNull String id, @NotNull CfnDataSourceProps props) Create a newAWS::AppSync::DataSource
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in 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:
getCfnProperties
in classCfnResource
-
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.- 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.
-
setType
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.
-
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. -
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
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.
-
setElasticsearchConfig
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.
-
setElasticsearchConfig
@Stability(Stable) public void setElasticsearchConfig(@Nullable CfnDataSource.ElasticsearchConfigProperty value) 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.
-
getEventBridgeConfig
An EventBridge configuration that contains a valid ARN of an event bus. -
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. -
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.This can be the ARN of a Lambda function that exists in the current account or in another account.
-
setLambdaConfig
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.
-
setLambdaConfig
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.
-
getOpenSearchServiceConfig
AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account. -
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. -
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.The system assumes this role when accessing the data source.
Required if
Type
is specified asAWS_LAMBDA
,AMAZON_DYNAMODB
,AMAZON_ELASTICSEARCH
,AMAZON_EVENTBRIDGE
, orAMAZON_OPENSEARCH_SERVICE
. -
setServiceRoleArn
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 asAWS_LAMBDA
,AMAZON_DYNAMODB
,AMAZON_ELASTICSEARCH
,AMAZON_EVENTBRIDGE
, orAMAZON_OPENSEARCH_SERVICE
.
-