class GraphqlApiBase
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AppSync.GraphqlApiBase |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsappsync#GraphqlApiBase |
Java | software.amazon.awscdk.services.appsync.GraphqlApiBase |
Python | aws_cdk.aws_appsync.GraphqlApiBase |
TypeScript (source) | aws-cdk-lib » aws_appsync » GraphqlApiBase |
Implements
IConstruct
, IDependable
, IResource
, IGraphql
Extends
Resource
Implemented by
Graphql
Base Class for GraphQL API.
Initializer
new GraphqlApiBase(scope: Construct, id: string, props?: ResourceProps)
Parameters
- scope
Construct
- id
string
- props
Resource
Props
Properties
Name | Type | Description |
---|---|---|
api | string | an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'. |
arn | string | the ARN of the API. |
env | Resource | The environment this resource belongs to. |
graph | string | The GraphQL endpoint ARN. |
modes | Authorization [] | The Authorization Types for this GraphQL Api. |
node | Node | The tree node. |
stack | Stack | The stack in which this resource is defined. |
visibility | Visibility | The visibility of the API. |
apiId
Type:
string
an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.
arn
Type:
string
the ARN of the API.
env
Type:
Resource
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.
graphQLEndpointArn
Type:
string
The GraphQL endpoint ARN.
modes
Type:
Authorization
[]
The Authorization Types for this GraphQL Api.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
visibility
Type:
Visibility
The visibility of the API.
Methods
Name | Description |
---|---|
add | add a new DynamoDB data source to this API. |
add | add a new elasticsearch data source to this API. |
add | Add an EventBridge data source to this api. |
add | add a new http data source to this API. |
add | add a new Lambda data source to this API. |
add | add a new dummy data source to this API. |
add | add a new OpenSearch data source to this API. |
add | add a new Rds data source to this API. |
add | add a new Rds data source to this API. |
add | Add schema dependency if not imported. |
apply | Apply the given removal policy to this resource. |
create | creates a new resolver for this datasource and API using the given properties. |
grant(grantee, resources, ...actions) | Adds an IAM policy statement associated with this GraphQLApi to an IAM principal's policy. |
grant | Adds an IAM policy statement for Mutation access to this GraphQLApi to an IAM principal's policy. |
grant | Adds an IAM policy statement for Query access to this GraphQLApi to an IAM principal's policy. |
grant | Adds an IAM policy statement for Subscription access to this GraphQLApi to an IAM principal's policy. |
to | 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
Data
— The optional configuration for this data source.Source Options
Returns
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
Data
— The optional configuration for this data source.Source Options
Returns
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
IEvent
— The EventBridge EventBus on which to put events.Bus - options
Data
— The optional configuration for this data source.Source Options
Returns
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
Http
— The optional configuration for this data source.Data Source Options
Returns
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
Data
— The optional configuration for this data source.Source Options
Returns
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
Data
— The optional configuration for this data source.Source Options
Returns
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
Data
— The optional configuration for this data source.Source Options
Returns
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
IServerless
— The serverless cluster to interact with this data source.Cluster - 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
Data
— The optional configuration for this data source.Source Options
Returns
add a new Rds data source to this API.
addRdsDataSourceV2(id, serverlessCluster, secretStore, databaseName?, options?)
public addRdsDataSourceV2(id: string, serverlessCluster: IDatabaseCluster, secretStore: ISecret, databaseName?: string, options?: DataSourceOptions): RdsDataSource
Parameters
- id
string
— The data source's id. - serverlessCluster
IDatabase
— The serverless V2 cluster to interact with this data source.Cluster - 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
Data
— The optional configuration for this data source.Source Options
Returns
add a new Rds data source to this API.
addSchemaDependency(construct)
public addSchemaDependency(construct: CfnResource): boolean
Parameters
- construct
Cfn
— the dependee.Resource
Returns
boolean
Add schema dependency if not imported.
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
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
Extended
Resolver Props
Returns
creates a new resolver for this datasource and API using the given properties.
grant(grantee, resources, ...actions)
public grant(grantee: IGrantable, resources: IamResource, ...actions: string[]): Grant
Parameters
- grantee
IGrantable
— The principal. - resources
Iam
— The set of resources to allow (i.e. ...:[region]:[accountId]:apis/GraphQLId/...).Resource - actions
string
— The actions that should be granted to the principal (i.e. appsync:graphql ).
Returns
Adds an IAM policy statement associated with this GraphQLApi to an IAM principal's policy.
grantMutation(grantee, ...fields)
public grantMutation(grantee: IGrantable, ...fields: string[]): Grant
Parameters
- grantee
IGrantable
— The principal. - fields
string
— The fields to grant access to that are Mutations (leave blank for all).
Returns
Adds an IAM policy statement for Mutation access to this GraphQLApi to an IAM principal's policy.
grantQuery(grantee, ...fields)
public grantQuery(grantee: IGrantable, ...fields: string[]): Grant
Parameters
- grantee
IGrantable
— The principal. - fields
string
— The fields to grant access to that are Queries (leave blank for all).
Returns
Adds an IAM policy statement for Query access to this GraphQLApi to an IAM principal's policy.
grantSubscription(grantee, ...fields)
public grantSubscription(grantee: IGrantable, ...fields: string[]): Grant
Parameters
- grantee
IGrantable
— The principal. - fields
string
— The fields to grant access to that are Subscriptions (leave blank for all).
Returns
Adds an IAM policy statement for Subscription access to this GraphQLApi to an IAM principal's policy.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.