Class: AWSCDK::APIGatewayv2Integrations::HttpLambdaIntegrationProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
api_gatewayv2_integrations/http_lambda_integration_props.rb

Overview

Lambda Proxy integration properties.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parameter_mapping: nil, payload_format_version: nil, scope_permission_to_route: nil, timeout: nil) ⇒ HttpLambdaIntegrationProps

Returns a new instance of HttpLambdaIntegrationProps.

Parameters:

  • parameter_mapping (AWSCDK::APIGatewayv2::ParameterMapping, nil) (defaults to: nil)

    Specifies how to transform HTTP requests before sending them to the backend.

  • payload_format_version (AWSCDK::APIGatewayv2::PayloadFormatVersion, nil) (defaults to: nil)

    Version of the payload sent to the lambda handler.

  • scope_permission_to_route (Boolean, nil) (defaults to: nil)

    Scope the permission for invoking the AWS Lambda down to the specific route associated with this integration.

  • timeout (AWSCDK::Duration, nil) (defaults to: nil)

    The maximum amount of time an integration will run before it returns without a response.



11
12
13
14
15
16
17
18
19
20
# File 'api_gatewayv2_integrations/http_lambda_integration_props.rb', line 11

def initialize(parameter_mapping: nil, payload_format_version: nil, scope_permission_to_route: nil, timeout: nil)
  @parameter_mapping = parameter_mapping
  Jsii::Type.check_type(@parameter_mapping, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheXYyLlBhcmFtZXRlck1hcHBpbmcifQ==")), "parameterMapping") unless @parameter_mapping.nil?
  @payload_format_version = payload_format_version
  Jsii::Type.check_type(@payload_format_version, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheXYyLlBheWxvYWRGb3JtYXRWZXJzaW9uIn0=")), "payloadFormatVersion") unless @payload_format_version.nil?
  @scope_permission_to_route = scope_permission_to_route
  Jsii::Type.check_type(@scope_permission_to_route, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "scopePermissionToRoute") unless @scope_permission_to_route.nil?
  @timeout = timeout
  Jsii::Type.check_type(@timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "timeout") unless @timeout.nil?
end

Instance Attribute Details

#parameter_mappingAWSCDK::APIGatewayv2::ParameterMapping? (readonly)

Note:

Default: undefined requests are sent to the backend unmodified

Specifies how to transform HTTP requests before sending them to the backend.



27
28
29
# File 'api_gatewayv2_integrations/http_lambda_integration_props.rb', line 27

def parameter_mapping
  @parameter_mapping
end

#payload_format_versionAWSCDK::APIGatewayv2::PayloadFormatVersion? (readonly)

Note:

Default: PayloadFormatVersion.VERSION_2_0

Version of the payload sent to the lambda handler.



33
34
35
# File 'api_gatewayv2_integrations/http_lambda_integration_props.rb', line 33

def payload_format_version
  @payload_format_version
end

#scope_permission_to_routeBoolean? (readonly)

Note:

Default: true

Scope the permission for invoking the AWS Lambda down to the specific route associated with this integration.

If this is set to false, the permission will allow invoking the AWS Lambda from any route. This is useful for reducing the AWS Lambda policy size for cases where the same AWS Lambda function is reused for many integrations.

Returns:

  • (Boolean, nil)


42
43
44
# File 'api_gatewayv2_integrations/http_lambda_integration_props.rb', line 42

def scope_permission_to_route
  @scope_permission_to_route
end

#timeoutAWSCDK::Duration? (readonly)

Note:

Default: Duration.seconds(29)

The maximum amount of time an integration will run before it returns without a response.

Must be between 50 milliseconds and 29 seconds.

Returns:



49
50
51
# File 'api_gatewayv2_integrations/http_lambda_integration_props.rb', line 49

def timeout
  @timeout
end

Class Method Details

.jsii_propertiesObject



51
52
53
54
55
56
57
58
# File 'api_gatewayv2_integrations/http_lambda_integration_props.rb', line 51

def self.jsii_properties
  {
    :parameter_mapping => "parameterMapping",
    :payload_format_version => "payloadFormatVersion",
    :scope_permission_to_route => "scopePermissionToRoute",
    :timeout => "timeout",
  }
end

Instance Method Details

#to_jsiiObject



60
61
62
63
64
65
66
67
68
69
# File 'api_gatewayv2_integrations/http_lambda_integration_props.rb', line 60

def to_jsii
  result = {}
  result.merge!({
    "parameterMapping" => @parameter_mapping,
    "payloadFormatVersion" => @payload_format_version,
    "scopePermissionToRoute" => @scope_permission_to_route,
    "timeout" => @timeout,
  })
  result.compact
end