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
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 interfaceTheElasticsearchConfigproperty type specifies theAwsRegionandEndpointsfor an Amazon OpenSearch Service domain in your account for an AWS AppSync data source.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.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnDataSource(Construct scope, String id, CfnDataSourceProps props) Create a newAWS::AppSync::DataSource.protectedCfnDataSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnDataSource(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.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.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.voidsetEventBridgeConfig(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.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.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods 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.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:
inspectin 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:
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
-
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
Typeis 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
Typeis specified asAWS_LAMBDA,AMAZON_DYNAMODB,AMAZON_ELASTICSEARCH,AMAZON_EVENTBRIDGE, orAMAZON_OPENSEARCH_SERVICE.
-