# Integration

Base class for backend integrations for an API Gateway method.

Use one of the concrete classes such as `MockIntegration`, `AwsIntegration`, `LambdaIntegration`
or implement on your own by specifying the set of props.

Extends: Integration
Superclass of: AwsIntegration, HttpIntegration, LambdaIntegration, MockIntegration, SagemakerIntegration

- Source: [`aws-apigateway/lib/integration.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-apigateway/lib/integration.ts#L228)
- Type last changed: v2.178.0 · 6 Feb 2025

## Example

```ts
declare const books: apigateway.Resource;
declare const iamUser: iam.User;

const getBooks = books.addMethod('GET', new apigateway.HttpIntegration('http://amazon.com'), {
  authorizationType: apigateway.AuthorizationType.IAM
});

iamUser.attachInlinePolicy(new iam.Policy(this, 'AllowBooks', {
  statements: [
    new iam.PolicyStatement({
      actions: [ 'execute-api:Invoke' ],
      effect: iam.Effect.ALLOW,
      resources: [ getBooks.methodArn ]
    })
  ]
}))
```

## Initializer

```ts
new Integration(props: IntegrationProps)
```

## Methods

- `bind(method: Method): IntegrationConfig` — Can be overridden by subclasses to allow the integration to interact with the method being integrated, access the REST API object, method ARNs, etc.
