Skip to content

AppSyncDataSource

Reference doc for the `sst.aws.AppSyncDataSource` component.

The AppSyncDataSource component is internally used by the AppSync component to add data sources to AWS AppSync.

You’ll find this component returned by the addDataSource method of the AppSync component.


Constructor

new AppSyncDataSource(name, args, opts?)

Parameters

Properties

name

Type Output<string>

The name of the data source.

nodes

Type Object

The underlying resources this component creates.

nodes.dataSource

Type DataSource

The Amazon AppSync DataSource.

nodes.function

Type Output<Function>

The Lambda function used by the data source.

nodes.serviceRole

Type Role

The DataSource service’s IAM role.

DataSourceArgs

apiComponentName

Type string

The AppSync component name.

apiId

Type Input<string>

The AppSync GraphQL API ID.

dynamodb?

Type Input<string>

The ARN for the DynamoDB table.

{
dynamodb: "arn:aws:dynamodb:us-east-1:123456789012:table/my-table"
}

elasticSearch?

Type Input<string>

The ARN for the Elasticsearch domain.

{
elasticSearch: "arn:aws:es:us-east-1:123456789012:domain/my-domain"
}

eventBridge?

Type Input<string>

The ARN for the EventBridge event bus.

{
eventBridge: "arn:aws:events:us-east-1:123456789012:event-bus/my-event-bus"
}

http?

Type Input<string>

The URL for the HTTP endpoint.

{
http: "https://api.example.com"
}

lambda?

Type Input<string | FunctionArgs | “arn:aws:lambda:${string}”>

The handler for the Lambda function.

{
lambda: "src/lambda.handler"
}

You can pass in the full function props.

{
lambda: {
handler: "src/lambda.handler",
timeout: "60 seconds"
}
}

You can also pass in the function ARN.

{
lambda: "arn:aws:lambda:us-east-1:123456789012:function:my-function"
}

name

Type string

The name of the data source.

{
name: "lambdaDS"
}

openSearch?

Type Input<string>

The ARN for the OpenSearch domain.

{
openSearch: "arn:aws:opensearch:us-east-1:123456789012:domain/my-domain"
}

rds?

Type Input<Object>

Configure the RDS data source.

{
rds: {
cluster: "arn:aws:rds:us-east-1:123456789012:cluster:my-cluster",
credentials: "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-secret"
}
}

rds.cluster

Type Input<string>

The ARN for the RDS cluster.

rds.credentials

Type Input<string>

The ARN for the credentials secret store.

transform?

Type Object

Transform how this component creates its underlying resources.

transform.dataSource?

Type DataSourceArgs | (args: DataSourceArgs, opts: ComponentResourceOptions, name: string) => void

Transform the AppSync DataSource resource.

transform.serviceRole?

Type RoleArgs | (args: RoleArgs, opts: ComponentResourceOptions, name: string) => void

Transform the AppSync DataSource service role resource.