aws-cdk-lib.aws_appsync.GraphqlApiBase

class GraphqlApiBase

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

Implements IConstruct, IDependable, IResource, IGraphqlApi

Extends Resource

Implemented by GraphqlApi

Base Class for GraphQL API.

Initializer

new GraphqlApiBase(scope: Construct, id: string, props?: ResourceProps)

Parameters

  • scope Construct
  • id string
  • props ResourceProps

Properties

NameTypeDescription
apiIdstringan unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.
arnstringthe ARN of the API.
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
stackStackThe stack in which this resource is defined.

apiId

Type: string

an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.


arn

Type: string

the ARN of the API.


env

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node

Type: Node

The tree node.


stack

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
addDynamoDbDataSource(id, table, options?)add a new DynamoDB data source to this API.
addElasticsearchDataSource(id, domain, options?)⚠️add a new elasticsearch data source to this API.
addEventBridgeDataSource(id, eventBus, options?)Add an EventBridge data source to this api.
addHttpDataSource(id, endpoint, options?)add a new http data source to this API.
addLambdaDataSource(id, lambdaFunction, options?)add a new Lambda data source to this API.
addNoneDataSource(id, options?)add a new dummy data source to this API.
addOpenSearchDataSource(id, domain, options?)add a new OpenSearch data source to this API.
addRdsDataSource(id, serverlessCluster, secretStore, databaseName?, options?)add a new Rds data source to this API.
addSchemaDependency(construct)Add schema dependency if not imported.
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
createResolver(id, props)creates a new resolver for this datasource and API using the given properties.
toString()Returns a string representation of this construct.

addDynamoDbDataSource(id, table, options?)

public addDynamoDbDataSource(id: string, table: ITable, options?: DataSourceOptions): DynamoDbDataSource

Parameters

  • id string — The data source's id.
  • table ITable — The DynamoDB table backing this data source.
  • options DataSourceOptions — The optional configuration for this data source.

Returns

  • DynamoDbDataSource

add a new DynamoDB data source to this API.


addElasticsearchDataSource(id, domain, options?)⚠️

public addElasticsearchDataSource(id: string, domain: IDomain, options?: DataSourceOptions): ElasticsearchDataSource

⚠️ Deprecated: - use addOpenSearchDataSource

Parameters

  • id string — The data source's id.
  • domain IDomain — The elasticsearch domain for this data source.
  • options DataSourceOptions — The optional configuration for this data source.

Returns

  • ElasticsearchDataSource

add a new elasticsearch data source to this API.


addEventBridgeDataSource(id, eventBus, options?)

public addEventBridgeDataSource(id: string, eventBus: IEventBus, options?: DataSourceOptions): EventBridgeDataSource

Parameters

  • id string — The data source's id.
  • eventBus IEventBus — The EventBridge EventBus on which to put events.
  • options DataSourceOptions — The optional configuration for this data source.

Returns

  • EventBridgeDataSource

Add an EventBridge data source to this api.


addHttpDataSource(id, endpoint, options?)

public addHttpDataSource(id: string, endpoint: string, options?: HttpDataSourceOptions): HttpDataSource

Parameters

  • id string — The data source's id.
  • endpoint string — The http endpoint.
  • options HttpDataSourceOptions — The optional configuration for this data source.

Returns

  • HttpDataSource

add a new http data source to this API.


addLambdaDataSource(id, lambdaFunction, options?)

public addLambdaDataSource(id: string, lambdaFunction: IFunction, options?: DataSourceOptions): LambdaDataSource

Parameters

  • id string — The data source's id.
  • lambdaFunction IFunction — The Lambda function to call to interact with this data source.
  • options DataSourceOptions — The optional configuration for this data source.

Returns

  • LambdaDataSource

add a new Lambda data source to this API.


addNoneDataSource(id, options?)

public addNoneDataSource(id: string, options?: DataSourceOptions): NoneDataSource

Parameters

  • id string — The data source's id.
  • options DataSourceOptions — The optional configuration for this data source.

Returns

  • NoneDataSource

add a new dummy data source to this API.

Useful for pipeline resolvers and for backend changes that don't require a data source.


addOpenSearchDataSource(id, domain, options?)

public addOpenSearchDataSource(id: string, domain: IDomain, options?: DataSourceOptions): OpenSearchDataSource

Parameters

  • id string — The data source's id.
  • domain IDomain — The OpenSearch domain for this data source.
  • options DataSourceOptions — The optional configuration for this data source.

Returns

  • OpenSearchDataSource

add a new OpenSearch data source to this API.


addRdsDataSource(id, serverlessCluster, secretStore, databaseName?, options?)

public addRdsDataSource(id: string, serverlessCluster: IServerlessCluster, secretStore: ISecret, databaseName?: string, options?: DataSourceOptions): RdsDataSource

Parameters

  • id string — The data source's id.
  • serverlessCluster IServerlessCluster — The serverless cluster to interact with this data source.
  • secretStore ISecret — The secret store that contains the username and password for the serverless cluster.
  • databaseName string — The optional name of the database to use within the cluster.
  • options DataSourceOptions — The optional configuration for this data source.

Returns

  • RdsDataSource

add a new Rds data source to this API.


addSchemaDependency(construct)

public addSchemaDependency(construct: CfnResource): boolean

Parameters

  • construct CfnResource — the dependee.

Returns

  • boolean

Add schema dependency if not imported.


applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


createResolver(id, props)

public createResolver(id: string, props: ExtendedResolverProps): Resolver

Parameters

  • id string
  • props ExtendedResolverProps

Returns

  • Resolver

creates a new resolver for this datasource and API using the given properties.


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.