integration#
- async idem_aws.states.aws.apigateway.integration.present(hub, ctx, name: str, rest_api_id: str, parent_resource_id: str, http_method: str, input_type: str, resource_id: str = None, cache_namespace: str = None, cache_key_parameters: list = None, integration_responses: dict = None, timeout_in_millis: int = None, passthrough_behavior: str = None, connection_id: str = None, integration_http_method: str = None, uri: str = None)[source]#
Creates a new API Gateway Integration or modifies an existing one.
- Parameters:
name (str) – An idem name of the resource.
rest_api_id (str) – AWS rest_api id of the associated RestApi.
parent_resource_id (str) – The parent resource’s id.
http_method (str) – String that specifies the method request’s HTTP method type.
input_type (str) – Specifies a put integration input’s type.
resource_id (str, Optional) – Idem resource id, formatted as: rest_api_id-parent_resource_id-http_method. Defaults to None.
cache_namespace (str, Optional) – Specifies a group of related cached parameters. By default, API Gateway uses the resource ID as the cacheNamespace . You can specify the same cacheNamespace across resources to return the same cached data for requests to different resources.
cache_key_parameters (list, Optional) – A list of request parameters whose values API Gateway caches. To be valid values for cacheKeyParameters , these parameters must also be specified for Method requestParameters.
timeout_in_millis (int, Optional) – Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
passthrough_behavior – Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.
connection_id (str, Optional) – The ID of the VpcLink used for the integration. Specify this value only if you specify VPC_LINK as the connection type.
integration_responses (dict, Optional) – Specifies the integration’s responses. The status code must map to an existing MethodResponse, and parameters and templates can be used to transform the back-end response.
integration_http_method (string, Optional) – The HTTP method for the integration.
uri (string, Optional) – Specifies Uniform Resource Identifier (URI) of the integration endpoint. For HTTP or HTTP_PROXY integrations, the URI must be a fully formed, encoded HTTP(S) URL according to the RFC-3986 specification, for either standard integration, where connectionType is not VPC_LINK , or private integration, where connectionType is VPC_LINK . For a private HTTP integration, the URI is not used for routing. For AWS or AWS_PROXY integrations, the URI is of the form arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api }. Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is the name of the integrated Amazon Web Services service (e.g., s3); and {subdomain} is a designated subdomain supported by certain Amazon Web Services service for fast host-name lookup. action can be used for an Amazon Web Services service action-based API, using an Action={name}&{p1}={v1}&p2={v2}… query string. The ensuing {service_api} refers to a supported action {name} plus any required input parameters. Alternatively, path can be used for an Amazon Web Services service path-based API. The ensuing service_api refers to the path to an Amazon Web Services service resource, including the region of the integrated Amazon Web Services service, if applicable. For example, for integration with the S3 API of GetObject , the uri can be either arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key} or arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key} .
- Request Syntax:
- [idem_test_aws_apigateway_integration]:
- aws.apigateway.integration.present:
name: ‘string’
rest_api_id: ‘string’
parent_resource_id: ‘string’
http_method: ‘string’
input_type: ‘string’
- Returns:
dict[str, Any]
Examples
idem_test_aws_apigateway_integration: aws.apigateway.integration.present: - name: test_integration - rest_api_id: ${aws.apigateway.rest_api:idem_test_aws_apigateway_rest_api:resource_id} - parent_resource_id: ${aws.apigateway.rest_api:test_rest_api:root_resource_id} - http_method: ${aws.apigateway.method:test_method:http_method} - input_type: MOCK idem_test_aws_apigateway_method: aws.apigateway.method.present: - name: test_method - rest_api_id: ${aws.apigateway.rest_api:idem_test_aws_apigateway_rest_api:resource_id} - parent_resource_id: ${aws.apigateway.rest_api:idem_test_aws_apigateway_rest_api:root_resource_id} - http_method: GET - authorization_type: AWS_IAM idem_test_aws_apigateway_rest_api: aws.apigateway.rest_api.present: - name: test_rest_api
Above, note that the integration’s http_method is
${aws.apigateway.method:test_method:http_method}
. This evaluates toGET
, plus an implicitrequire
of the resource. You could also set it toGET
explicitly, and use an explicitrequire
:idem_test_aws_apigateway_integration: aws.apigateway.integration.present: - require: - aws.apigateway.method: test_method - http_method: GET ...
[idem_test_aws_apigateway_integration]: aws.apigateway.integration.present: - name: 'string' - rest_api_id: 'string' - parent_resource_id: 'string' - http_method: 'string' - input_type: 'string'