Class Integration
Provides an HTTP Method Integration for an API Gateway Integration.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var myDemoAPI = new Aws.ApiGateway.RestApi("myDemoAPI", new Aws.ApiGateway.RestApiArgs
{
Description = "This is my API for demonstration purposes",
});
var myDemoResource = new Aws.ApiGateway.Resource("myDemoResource", new Aws.ApiGateway.ResourceArgs
{
ParentId = myDemoAPI.RootResourceId,
PathPart = "mydemoresource",
RestApi = myDemoAPI.Id,
});
var myDemoMethod = new Aws.ApiGateway.Method("myDemoMethod", new Aws.ApiGateway.MethodArgs
{
Authorization = "NONE",
HttpMethod = "GET",
ResourceId = myDemoResource.Id,
RestApi = myDemoAPI.Id,
});
var myDemoIntegration = new Aws.ApiGateway.Integration("myDemoIntegration", new Aws.ApiGateway.IntegrationArgs
{
CacheKeyParameters =
{
"method.request.path.param",
},
CacheNamespace = "foobar",
HttpMethod = myDemoMethod.HttpMethod,
RequestParameters =
{
{ "integration.request.header.X-Authorization", "'static'" },
},
RequestTemplates =
{
{ "application/xml", @"{
""body"" : $$input.json('$$')
}
" },
},
ResourceId = myDemoResource.Id,
RestApi = myDemoAPI.Id,
TimeoutMilliseconds = 29000,
Type = "MOCK",
});
}
}
VPC Link
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var name = config.RequireObject<dynamic>("name");
var subnetId = config.RequireObject<dynamic>("subnetId");
var testLoadBalancer = new Aws.LB.LoadBalancer("testLoadBalancer", new Aws.LB.LoadBalancerArgs
{
Internal = true,
LoadBalancerType = "network",
Subnets =
{
subnetId,
},
});
var testVpcLink = new Aws.ApiGateway.VpcLink("testVpcLink", new Aws.ApiGateway.VpcLinkArgs
{
TargetArn = testLoadBalancer.Arn,
});
var testRestApi = new Aws.ApiGateway.RestApi("testRestApi", new Aws.ApiGateway.RestApiArgs
{
});
var testResource = new Aws.ApiGateway.Resource("testResource", new Aws.ApiGateway.ResourceArgs
{
ParentId = testRestApi.RootResourceId,
PathPart = "test",
RestApi = testRestApi.Id,
});
var testMethod = new Aws.ApiGateway.Method("testMethod", new Aws.ApiGateway.MethodArgs
{
Authorization = "NONE",
HttpMethod = "GET",
RequestModels =
{
{ "application/json", "Error" },
},
ResourceId = testResource.Id,
RestApi = testRestApi.Id,
});
var testIntegration = new Aws.ApiGateway.Integration("testIntegration", new Aws.ApiGateway.IntegrationArgs
{
ConnectionId = testVpcLink.Id,
ConnectionType = "VPC_LINK",
ContentHandling = "CONVERT_TO_TEXT",
HttpMethod = testMethod.HttpMethod,
IntegrationHttpMethod = "GET",
PassthroughBehavior = "WHEN_NO_MATCH",
RequestParameters =
{
{ "integration.request.header.X-Authorization", "'static'" },
{ "integration.request.header.X-Foo", "'Bar'" },
},
RequestTemplates =
{
{ "application/json", "" },
{ "application/xml", @"#set($$inputRoot = $$input.path('$$'))
{ }
" },
},
ResourceId = testResource.Id,
RestApi = testRestApi.Id,
Type = "HTTP",
Uri = "https://www.google.de",
});
}
}
Inherited Members
Namespace: Pulumi.Aws.ApiGateway
Assembly: Pulumi.Aws.dll
Syntax
public class Integration : CustomResource
Constructors
View SourceIntegration(String, IntegrationArgs, CustomResourceOptions)
Create a Integration resource with the given unique name, arguments, and options.
Declaration
public Integration(string name, IntegrationArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| IntegrationArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCacheKeyParameters
A list of cache key parameters for the integration.
Declaration
public Output<ImmutableArray<string>> CacheKeyParameters { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
CacheNamespace
The integration's cache namespace.
Declaration
public Output<string> CacheNamespace { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ConnectionId
The id of the VpcLink used for the integration. Required if connection_type is VPC_LINK
Declaration
public Output<string> ConnectionId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ConnectionType
The integration input's connectionType. Valid values are INTERNET (default for connections through the public routable internet), and VPC_LINK (for private connections between API Gateway and a network load balancer in a VPC).
Declaration
public Output<string> ConnectionType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ContentHandling
Specifies how to handle request payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT. If this property is not defined, the request payload will be passed through from the method request to integration request without modification, provided that the passthroughBehaviors is configured to support payload pass-through.
Declaration
public Output<string> ContentHandling { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Credentials
The credentials required for the integration. For AWS integrations, 2 options are available. To specify an IAM Role for Amazon API Gateway to assume, use the role's ARN. To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::\*:user/\*.
Declaration
public Output<string> Credentials { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
HttpMethod
The HTTP method (GET, POST, PUT, DELETE, HEAD, OPTION, ANY)
when calling the associated resource.
Declaration
public Output<string> HttpMethod { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
IntegrationHttpMethod
The integration HTTP method
(GET, POST, PUT, DELETE, HEAD, OPTIONs, ANY, PATCH) specifying how API Gateway will interact with the back end.
Required if type is AWS, AWS_PROXY, HTTP or HTTP_PROXY.
Not all methods are compatible with all AWS integrations.
e.g. Lambda function can only be invoked via POST.
Declaration
public Output<string> IntegrationHttpMethod { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PassthroughBehavior
The integration passthrough behavior (WHEN_NO_MATCH, WHEN_NO_TEMPLATES, NEVER). Required if request_templates is used.
Declaration
public Output<string> PassthroughBehavior { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RequestParameters
A map of request query string parameters and headers that should be passed to the backend responder.
For example: request_parameters = { "integration.request.header.X-Some-Other-Header" = "method.request.header.X-Some-Header" }
Declaration
public Output<ImmutableDictionary<string, string>> RequestParameters { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
RequestTemplates
A map of the integration's request templates.
Declaration
public Output<ImmutableDictionary<string, string>> RequestTemplates { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
ResourceId
The API resource ID.
Declaration
public Output<string> ResourceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RestApi
The ID of the associated REST API.
Declaration
public Output<string> RestApi { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
TimeoutMilliseconds
Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds.
Declaration
public Output<int?> TimeoutMilliseconds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Type
The integration input's type. Valid values are HTTP (for HTTP backends), MOCK (not calling any real backend), AWS (for AWS services), AWS_PROXY (for Lambda proxy integration) and HTTP_PROXY (for HTTP proxy integration). An HTTP or HTTP_PROXY integration with a connection_type of VPC_LINK is referred to as a private integration and uses a VpcLink to connect API Gateway to a network load balancer of a VPC.
Declaration
public Output<string> Type { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Uri
The input's URI. Required if type is AWS, AWS_PROXY, HTTP or HTTP_PROXY.
For HTTP integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification . For AWS integrations, the URI should be of the form arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}. region, subdomain and service are used to determine the right endpoint.
e.g. arn:aws:apigateway:eu-west-1:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-1:012345678901:function:my-func/invocations
Declaration
public Output<string> Uri { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, IntegrationState, CustomResourceOptions)
Get an existing Integration resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Integration Get(string name, Input<string> id, IntegrationState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| IntegrationState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Integration |