HttpDataSourceOptions

class aws_cdk.aws_appsync.HttpDataSourceOptions(*, description=None, name=None, authorization_config=None)

Bases: DataSourceOptions

Optional configuration for Http data sources.

Parameters:
  • description (Optional[str]) – The description of the data source. Default: - No description

  • name (Optional[str]) – The name of the data source, overrides the id given by cdk. Default: - generated by cdk given the id

  • authorization_config (Union[AwsIamConfig, Dict[str, Any], None]) – The authorization config in case the HTTP endpoint requires authorization. Default: - none

ExampleMetadata:

infused

Example:

api = appsync.GraphqlApi(self, "api",
    name="api",
    definition=appsync.Definition.from_file(path.join(__dirname, "schema.graphql"))
)

http_ds = api.add_http_data_source("ds", "https://states.amazonaws.com",
    name="httpDsWithStepF",
    description="from appsync to StepFunctions Workflow",
    authorization_config=appsync.AwsIamConfig(
        signing_region="us-east-1",
        signing_service_name="states"
    )
)

http_ds.create_resolver("MutationCallStepFunctionResolver",
    type_name="Mutation",
    field_name="callStepFunction",
    request_mapping_template=appsync.MappingTemplate.from_file("request.vtl"),
    response_mapping_template=appsync.MappingTemplate.from_file("response.vtl")
)

Attributes

authorization_config

The authorization config in case the HTTP endpoint requires authorization.

Default:
  • none

description

The description of the data source.

Default:
  • No description

name

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

Default:
  • generated by cdk given the id