linzhengen / tech-notes

My tech notes write in github issues🧲
1 stars 0 forks source link

[20210715] Amazon API Gateway OpenAPI の拡張 `x-amazon-apigateway-integration.uri`の暗号を半分解けた #123

Open linzhengen opened 3 years ago

linzhengen commented 3 years ago

Amazon API Gateway デベロッパーガイド https://docs.aws.amazon.com/ja_jp/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration.html の中に

バックエンドのエンドポイント URI。aws タイプの統合の場合、この URI は ARN 値です。HTTP 統合の場合、この URI は、https または http スキームを含む HTTP エンドポイントの URL です。

の記載はありますが、lambda、s3と統合する場合、ARN値ではなく、下記の形式で書く必要があります。 ARNではない!!

腹落ちしないため、下記のドキュメントを見つけた!半分暗号解けた! arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api} https://docs.aws.amazon.com/apigateway/api-reference/resource/integration/#uri

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 AWS service (e.g., s3); and {subdomain} is a designated subdomain supported by certain AWS service for fast host-name lookup. action can be used for an AWS 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 AWS service path-based API. The ensuing service_api refers to the path to an AWS service resource, including the region of the integrated AWS 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}

SAMのリポジトリを検索してもlambdaしか出てこない https://github.com/aws/serverless-application-model/search?q=%22arn%3Aaws%3Aapigateway%22 SQS、DynamoDBと統合する場合の書き方がわからないです。