aws-cdk-lib.aws_appsync.HttpDataSourceOptions

interface HttpDataSourceOptions

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

Optional configuration for Http data sources.

Example

const api = new appsync.GraphqlApi(this, 'api', {
  name: 'api',
  schema: appsync.SchemaFile.fromAsset(path.join(__dirname, 'schema.graphql')),
});

const httpDs = api.addHttpDataSource(
  'ds',
  'https://states.amazonaws.com',
  {
    name: 'httpDsWithStepF',
    description: 'from appsync to StepFunctions Workflow',
    authorizationConfig: {
      signingRegion: 'us-east-1',
      signingServiceName: 'states',
    }
  }
);

httpDs.createResolver('MutationCallStepFunctionResolver', {
  typeName: 'Mutation',
  fieldName: 'callStepFunction',
  requestMappingTemplate: appsync.MappingTemplate.fromFile('request.vtl'),
  responseMappingTemplate: appsync.MappingTemplate.fromFile('response.vtl'),
});

Properties

NameTypeDescription
authorizationConfig?AwsIamConfigThe authorization config in case the HTTP endpoint requires authorization.
description?stringThe description of the data source.
name?stringThe name of the data source, overrides the id given by cdk.

authorizationConfig?

Type: AwsIamConfig (optional, default: none)

The authorization config in case the HTTP endpoint requires authorization.


description?

Type: string (optional, default: No description)

The description of the data source.


name?

Type: string (optional, default: generated by cdk given the id)

The name of the data source, overrides the id given by cdk.