# HttpDataSourceOptions

Optional configuration for Http data sources.

Extends: HttpDataSourceOptions
Extends: DataSourceOptions

- Source: [`aws-appsync/lib/graphqlapi-base.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-appsync/lib/graphqlapi-base.ts#L58)
- Type last changed: v2.60.0 · 12 Jan 2023

## Example

```ts
const api = new appsync.GraphqlApi(this, 'api', {
  name: 'api',
  definition: appsync.Definition.fromFile(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

- `authorizationConfig`: [AwsIamConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.AwsIamConfig.html) = none — The authorization config in case the HTTP endpoint requires authorization.

- `description`: string — The description of the data source.

  **Default:** No description

- `metricsConfig`: [DataSourceMetricsConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.DataSourceMetricsConfig.html) — Whether to enable enhanced metrics of the data source Value will be ignored, if `enhancedMetricsConfig.dataSourceLevelMetricsBehavior` on AppSync GraphqlApi construct is set to `FULL_REQUEST_DATA_SOURCE_METRICS`.

  **Default:** Enhance metrics are disabled

- `name`: string — The name of the data source, overrides the id given by cdk.

  **Default:** generated by cdk given the id
