How to use the @aws-cdk/aws-apigateway.AwsIntegration function in @aws-cdk/aws-apigateway

To help you get started, we’ve selected a few @aws-cdk/aws-apigateway examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fogfish / aws-cdk-pure / hoc / src / staticweb.ts View on Github external
function StaticContent(
  origin: s3.IBucket,
  role: iam.IRole,
  gw: api.RestApi,
  root: {origin: string, site: string}
): pure.IPure {
  const iaac = pure.wrap(api.AwsIntegration)
  const content = (path: string) => (): api.AwsIntegrationProps => ({
    integrationHttpMethod: 'GET',
    options: {
      credentialsRole: role,
      integrationResponses: [
        {
          selectionPattern: 'default',
          statusCode: '500',
        },
        {
          responseParameters: {
            "method.response.header.Content-Length": "integration.response.header.Content-Length",
            "method.response.header.Content-Type": "integration.response.header.Content-Type",
          },
          selectionPattern: '2\\d{2}',
          statusCode: '200',