interface IEventApi
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.AppSync.IEventApi |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsappsync#IEventApi |
Java | software.amazon.awscdk.services.appsync.IEventApi |
Python | aws_cdk.aws_appsync.IEventApi |
TypeScript (source) | aws-cdk-lib ยป aws_appsync ยป IEventApi |
Implements
IDependable, IConstruct, IEnvironment, IResource, IApi, IApi
Implemented by
Event
Obtainable from
Event.fromEventApiAttributes()
Interface for Event API.
Properties
| Name | Type | Description |
|---|---|---|
| api | string | The ARN of the AWS AppSync Api. |
| api | string | The unique identifier for the AWS AppSync Api generated by the service. |
| api | Api | A reference to a Api resource. |
| auth | App[] | The Authorization Types for this Event Api. |
| env | Resource | The environment this resource belongs to. |
| http | string | The domain name of the Api's HTTP endpoint. |
| node | Node | The tree node. |
| realtime | string | The domain name of the Api's real-time endpoint. |
| stack | Stack | The stack in which this resource is defined. |
apiArn
Type:
string
The ARN of the AWS AppSync Api.
apiId
Type:
string
The unique identifier for the AWS AppSync Api generated by the service.
apiRef
Type:
Api
A reference to a Api resource.
authProviderTypes
Type:
App[]
The Authorization Types for this Event Api.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
httpDns
Type:
string
The domain name of the Api's HTTP endpoint.
node
Type:
Node
The tree node.
realtimeDns
Type:
string
The domain name of the Api's real-time endpoint.
stack
Type:
Stack
The stack in which this resource is defined.
Methods
| Name | Description |
|---|---|
| add | add a new channel namespace. |
| add | Add a new DynamoDB 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 OpenSearch data source to this API. |
| add | add a new Rds data source to this API. |
| apply | Apply the given removal policy to this resource. |
| grant(grantee, resources, ...actions) | Adds an IAM policy statement associated with this Event API to an IAM principal's policy. |
| grant | Adds an IAM policy statement for EventConnect access to this EventApi to an IAM principal's policy. |
| grant | Adds an IAM policy statement for EventPublish access to this EventApi to an IAM principal's policy. |
| grant | Adds an IAM policy statement to publish and subscribe to this API for an IAM principal's policy. |
| grant | Adds an IAM policy statement for EventSubscribe access to this EventApi to an IAM principal's policy. |
addChannelNamespace(id, options?)
public addChannelNamespace(id: string, options?: ChannelNamespaceOptions): ChannelNamespace
Parameters
- id
stringโ the id of the channel namespace. - options
Channelโ the options for the channel namespace.Namespace Options
Returns
add a new channel namespace.
addDynamoDbDataSource(id, table, options?)
public addDynamoDbDataSource(id: string, table: ITable, options?: AppSyncDataSourceOptions): AppSyncDynamoDbDataSource
Parameters
- id
stringโ The data source's id. - table
ITableโ The DynamoDB table backing this data source. - options
Appโ The optional configuration for this data source.Sync Data Source Options
Returns
Add a new DynamoDB data source to this API.
addEventBridgeDataSource(id, eventBus, options?)
public addEventBridgeDataSource(id: string, eventBus: IEventBus, options?: AppSyncDataSourceOptions): AppSyncEventBridgeDataSource
Parameters
- id
stringโ The data source's id. - eventBus
IEventโ The EventBridge EventBus on which to put events.Bus - options
Appโ The optional configuration for this data source.Sync Data Source Options
Returns
Add an EventBridge data source to this api.
addHttpDataSource(id, endpoint, options?)
public addHttpDataSource(id: string, endpoint: string, options?: AppSyncHttpDataSourceOptions): AppSyncHttpDataSource
Parameters
- id
stringโ The data source's id. - endpoint
stringโ The http endpoint. - options
Appโ The optional configuration for this data source.Sync Http Data Source Options
Returns
add a new http data source to this API.
addLambdaDataSource(id, lambdaFunction, options?)
public addLambdaDataSource(id: string, lambdaFunction: IFunction, options?: AppSyncDataSourceOptions): AppSyncLambdaDataSource
Parameters
- id
stringโ The data source's id. - lambdaFunction
IFunctionโ The Lambda function to call to interact with this data source. - options
Appโ The optional configuration for this data source.Sync Data Source Options
Returns
add a new Lambda data source to this API.
addOpenSearchDataSource(id, domain, options?)
public addOpenSearchDataSource(id: string, domain: IDomain, options?: AppSyncDataSourceOptions): AppSyncOpenSearchDataSource
Parameters
- id
stringโ The data source's id. - domain
IDomainโ The OpenSearch domain for this data source. - options
Appโ The optional configuration for this data source.Sync Data Source Options
Returns
Add a new OpenSearch data source to this API.
addRdsDataSource(id, serverlessCluster, secretStore, databaseName?, options?)
public addRdsDataSource(id: string, serverlessCluster: IDatabaseCluster | IServerlessCluster, secretStore: ISecret, databaseName?: string, options?: AppSyncDataSourceOptions): AppSyncRdsDataSource
Parameters
- id
stringโ The data source's id. - serverlessCluster
IDatabaseCluster |IServerlessโ The database cluster to interact with this data source.Cluster - secretStore
ISecretโ The secret store that contains the username and password for the database cluster. - databaseName
stringโ The optional name of the database to use within the cluster. - options
Appโ The optional configuration for this data source.Sync Data Source Options
Returns
add a new Rds data source to this API.
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).
grant(grantee, resources, ...actions)
public grant(grantee: IGrantable, resources: AppSyncEventResource, ...actions: string[]): Grant
Parameters
- grantee
IGrantableโ The principal. - resources
Appโ The set of resources to allow (i.e. ...:[region]:[accountId]:apis/EventApiId/...).Sync Event Resource - actions
stringโ The actions that should be granted to the principal (i.e. appsync:EventPublish ).
Returns
Adds an IAM policy statement associated with this Event API to an IAM principal's policy.
grantConnect(grantee)
public grantConnect(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ The principal.
Returns
Adds an IAM policy statement for EventConnect access to this EventApi to an IAM principal's policy.
grantPublish(grantee)
public grantPublish(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ The principal.
Returns
Adds an IAM policy statement for EventPublish access to this EventApi to an IAM principal's policy.
grantPublishAndSubscribe(grantee)
public grantPublishAndSubscribe(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ The principal.
Returns
Adds an IAM policy statement to publish and subscribe to this API for an IAM principal's policy.
grantSubscribe(grantee)
public grantSubscribe(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ The principal.
Returns
Adds an IAM policy statement for EventSubscribe access to this EventApi to an IAM principal's policy.

.NET
Go
Java
Python
TypeScript (