Skip to content
v2.278.0

IntegrationConfig Struct ​

Result of binding an Integration to a Method.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_apigateway as apigateway } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';

declare const role: iam.Role;
declare const vpcLink: apigateway.VpcLink;
const integrationConfig: apigateway.IntegrationConfig = {
  type: apigateway.IntegrationType.AWS,

  // the properties below are optional
  deploymentToken: 'deploymentToken',
  integrationHttpMethod: 'integrationHttpMethod',
  options: {
    cacheKeyParameters: ['cacheKeyParameters'],
    cacheNamespace: 'cacheNamespace',
    connectionType: apigateway.ConnectionType.INTERNET,
    contentHandling: apigateway.ContentHandling.CONVERT_TO_BINARY,
    credentialsPassthrough: false,
    credentialsRole: role,
    integrationResponses: [{
      statusCode: 'statusCode',

      // the properties below are optional
      contentHandling: apigateway.ContentHandling.CONVERT_TO_BINARY,
      responseParameters: {
        responseParametersKey: 'responseParameters',
      },
      responseTemplates: {
        responseTemplatesKey: 'responseTemplates',
      },
      selectionPattern: 'selectionPattern',
    }],
    passthroughBehavior: apigateway.PassthroughBehavior.WHEN_NO_MATCH,
    requestParameters: {
      requestParametersKey: 'requestParameters',
    },
    requestTemplates: {
      requestTemplatesKey: 'requestTemplates',
    },
    responseTransferMode: apigateway.ResponseTransferMode.BUFFERED,
    timeout: cdk.Duration.minutes(30),
    vpcLink: vpcLink,
  },
  uri: 'uri',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_apigateway as apigateway
from aws_cdk import aws_iam as iam

# role: iam.Role
# vpc_link: apigateway.VpcLink

integration_config = apigateway.IntegrationConfig(
    type=apigateway.IntegrationType.AWS,

    # the properties below are optional
    deployment_token="deploymentToken",
    integration_http_method="integrationHttpMethod",
    options=apigateway.IntegrationOptions(
        cache_key_parameters=["cacheKeyParameters"],
        cache_namespace="cacheNamespace",
        connection_type=apigateway.ConnectionType.INTERNET,
        content_handling=apigateway.ContentHandling.CONVERT_TO_BINARY,
        credentials_passthrough=False,
        credentials_role=role,
        integration_responses=[apigateway.IntegrationResponse(
            status_code="statusCode",

            # the properties below are optional
            content_handling=apigateway.ContentHandling.CONVERT_TO_BINARY,
            response_parameters={
                "response_parameters_key": "responseParameters"
            },
            response_templates={
                "response_templates_key": "responseTemplates"
            },
            selection_pattern="selectionPattern"
        )],
        passthrough_behavior=apigateway.PassthroughBehavior.WHEN_NO_MATCH,
        request_parameters={
            "request_parameters_key": "requestParameters"
        },
        request_templates={
            "request_templates_key": "requestTemplates"
        },
        response_transfer_mode=apigateway.ResponseTransferMode.BUFFERED,
        timeout=cdk.Duration.minutes(30),
        vpc_link=vpc_link
    ),
    uri="uri"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.apigateway.*;
import software.amazon.awscdk.services.iam.*;

Role role;
VpcLink vpcLink;

IntegrationConfig integrationConfig = IntegrationConfig.builder()
        .type(IntegrationType.AWS)

        // the properties below are optional
        .deploymentToken("deploymentToken")
        .integrationHttpMethod("integrationHttpMethod")
        .options(IntegrationOptions.builder()
                .cacheKeyParameters(List.of("cacheKeyParameters"))
                .cacheNamespace("cacheNamespace")
                .connectionType(ConnectionType.INTERNET)
                .contentHandling(ContentHandling.CONVERT_TO_BINARY)
                .credentialsPassthrough(false)
                .credentialsRole(role)
                .integrationResponses(List.of(IntegrationResponse.builder()
                        .statusCode("statusCode")

                        // the properties below are optional
                        .contentHandling(ContentHandling.CONVERT_TO_BINARY)
                        .responseParameters(Map.of(
                                "responseParametersKey", "responseParameters"))
                        .responseTemplates(Map.of(
                                "responseTemplatesKey", "responseTemplates"))
                        .selectionPattern("selectionPattern")
                        .build()))
                .passthroughBehavior(PassthroughBehavior.WHEN_NO_MATCH)
                .requestParameters(Map.of(
                        "requestParametersKey", "requestParameters"))
                .requestTemplates(Map.of(
                        "requestTemplatesKey", "requestTemplates"))
                .responseTransferMode(ResponseTransferMode.BUFFERED)
                .timeout(Duration.minutes(30))
                .vpcLink(vpcLink)
                .build())
        .uri("uri")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.APIGateway;
using Amazon.CDK.AWS.IAM;

Role role;
VpcLink vpcLink;

var integrationConfig = new IntegrationConfig {
    Type = IntegrationType.AWS,

    // the properties below are optional
    DeploymentToken = "deploymentToken",
    IntegrationHttpMethod = "integrationHttpMethod",
    Options = new IntegrationOptions {
        CacheKeyParameters = new [] { "cacheKeyParameters" },
        CacheNamespace = "cacheNamespace",
        ConnectionType = ConnectionType.INTERNET,
        ContentHandling = ContentHandling.CONVERT_TO_BINARY,
        CredentialsPassthrough = false,
        CredentialsRole = role,
        IntegrationResponses = new [] { new IntegrationResponse {
            StatusCode = "statusCode",

            // the properties below are optional
            ContentHandling = ContentHandling.CONVERT_TO_BINARY,
            ResponseParameters = new Dictionary<string, string> {
                { "responseParametersKey", "responseParameters" }
            },
            ResponseTemplates = new Dictionary<string, string> {
                { "responseTemplatesKey", "responseTemplates" }
            },
            SelectionPattern = "selectionPattern"
        } },
        PassthroughBehavior = PassthroughBehavior.WHEN_NO_MATCH,
        RequestParameters = new Dictionary<string, string> {
            { "requestParametersKey", "requestParameters" }
        },
        RequestTemplates = new Dictionary<string, string> {
            { "requestTemplatesKey", "requestTemplates" }
        },
        ResponseTransferMode = ResponseTransferMode.BUFFERED,
        Timeout = Duration.Minutes(30),
        VpcLink = vpcLink
    },
    Uri = "uri"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var role Role
var vpcLink VpcLink

integrationConfig := &IntegrationConfig{
	Type: awscdk.Aws_apigateway.IntegrationType_AWS,

	// the properties below are optional
	DeploymentToken: jsii.String("deploymentToken"),
	IntegrationHttpMethod: jsii.String("integrationHttpMethod"),
	Options: &IntegrationOptions{
		CacheKeyParameters: []*string{
			jsii.String("cacheKeyParameters"),
		},
		CacheNamespace: jsii.String("cacheNamespace"),
		ConnectionType: awscdk.*Aws_apigateway.ConnectionType_INTERNET,
		ContentHandling: awscdk.*Aws_apigateway.ContentHandling_CONVERT_TO_BINARY,
		CredentialsPassthrough: jsii.Boolean(false),
		CredentialsRole: role,
		IntegrationResponses: []IntegrationResponse{
			&IntegrationResponse{
				StatusCode: jsii.String("statusCode"),

				// the properties below are optional
				ContentHandling: awscdk.*Aws_apigateway.ContentHandling_CONVERT_TO_BINARY,
				ResponseParameters: map[string]*string{
					"responseParametersKey": jsii.String("responseParameters"),
				},
				ResponseTemplates: map[string]*string{
					"responseTemplatesKey": jsii.String("responseTemplates"),
				},
				SelectionPattern: jsii.String("selectionPattern"),
			},
		},
		PassthroughBehavior: awscdk.*Aws_apigateway.PassthroughBehavior_WHEN_NO_MATCH,
		RequestParameters: map[string]*string{
			"requestParametersKey": jsii.String("requestParameters"),
		},
		RequestTemplates: map[string]*string{
			"requestTemplatesKey": jsii.String("requestTemplates"),
		},
		ResponseTransferMode: awscdk.*Aws_apigateway.ResponseTransferMode_BUFFERED,
		Timeout: cdk.Duration_Minutes(jsii.Number(30)),
		VpcLink: vpcLink,
	},
	Uri: jsii.String("uri"),
}

Properties ​

deploymentTokenoptionalstringdeployment_tokenoptionalstrdeploymentTokenoptionalStringDeploymentTokenoptionalstringDeploymentTokenoptional*string #
This value is included in computing the Deployment's fingerprint.

Default: undefined deployments are not triggered for any change to this integration.

When the fingerprint changes, a new deployment is triggered. This property should contain values associated with the Integration that upon changing should trigger a fresh the Deployment needs to be refreshed.

integrationHttpMethodoptionalstringintegration_http_methodoptionalstrintegrationHttpMethodoptionalStringIntegrationHttpMethodoptionalstringIntegrationHttpMethodoptional*string #
The integration's HTTP method type.

Default: no integration method specified.

Required unless you use a MOCK integration.

optionsoptionalIntegrationOptionsoptionsoptionalIntegrationOptionsoptionsoptionalIntegrationOptionsOptionsoptionalIntegrationOptionsOptionsoptionalIntegrationOptions #
Integration options.

Default: no integration options

Specifies an API method integration type.
urioptionalstringurioptionalstrurioptionalStringUrioptionalstringUrioptional*string #
The Uniform Resource Identifier (URI) for the integration.

Default: no URI. Usually applies to MOCK integration