From e9191ea607d6d0bba54ad64adf3926d57c75af88 Mon Sep 17 00:00:00 2001 From: CloudDrove CI <84795582+clouddrove-ci@users.noreply.github.com> Date: Tue, 18 Jul 2023 17:24:39 +0000 Subject: [PATCH 01/20] docs: update CHANGELOG.md for 1.4.0 --- CHANGELOG.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a097fd9..5cbb4fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,38 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.4.0] - 2023-07-18 +### :sparkles: New Features +- [`fc7b2c3`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/fc7b2c3ecdbe0dd8d92e6078afbc5368ac60930f) - added changelog.yml file use shared workflow *(commit by [@vibhutigoyal](https://github.com/vibhutigoyal))* +- [`1c7b42f`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/1c7b42fd7e5777e35cfdc99de3f1e0c18db2ad9c) - added depemdabot.yml *(commit by [@vibhutigoyal](https://github.com/vibhutigoyal))* +- [`e995898`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/e995898e6f784868160c8f6f7c2589ac1232aa37) - auto changelog action added *(commit by [@vibhutigoyal](https://github.com/vibhutigoyal))* +- [`5f5472e`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/5f5472e8c5b231de8c21a606f016857abd9a70c7) - added rest api policy and make api private *(commit by [@mamrajyadav](https://github.com/mamrajyadav))* +- [`546fe75`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/546fe756d1709e8b4502f74f0f089ab3ea5b012b) - added api policy in example *(commit by [@mamrajyadav](https://github.com/mamrajyadav))* +- [`0a13fbe`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/0a13fbe0d48fc2df28d302a557b7f6b11d2cc4ac) - add deepsource & added assignees,reviewer in dependabot *(commit by [@Tanveer143s](https://github.com/Tanveer143s))* +- [`a085977`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/a085977168f8013f48c09b5235fd3f5a55ad5439) - add deepsource & added assignees,reviewer in dependabot *(commit by [@Tanveer143s](https://github.com/Tanveer143s))* +- [`58729c9`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/58729c96baa75b7c87da843b41dc3931a6245bc7) - crate apigateway-v2 terraform module *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`5d2ef92`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/5d2ef92e1a19245847519066d42879c62a90fa17) - added output.tf *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`b3b36f7`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/b3b36f7b78ee35471fe089557e2a59cfa0338563) - added lambda function routes *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`20cecef`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/20cecef6798dbfa3d634996b8f57a7f1e287b3f0) - code dynamic and add resource, variable description *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`553312e`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/553312e5240250806b38197bf908239080ec5cd4) - code dynamic and add resource, variable description *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`541a62a`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/541a62af3f7a030f8f6dff0bba2afff3b6096965) - code dynamic and add resource, variable description *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`267242e`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/267242e02762f99f171aec272ed26c5cf53e269b) - code dynamic and add resource, variable description *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`b2c1576`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/b2c1576be72322f3fd3e599d405007d8b3343b25) - code dynamic and add resource, variable description *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`20a8a1f`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/20a8a1f14ee685b3b9f4233105dd12e0ee94654d) - code dynamic and add resource, variable description *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`d36d58c`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/d36d58ce68967ff6e65515ecdd433cfe2b326b42) - code dynamic and add resource, variable description *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`553c2a1`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/553c2a1a7211426c34f06ea22b13e92b16f5477a) - code dynamic and add resource, variable description *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`0b394ce`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/0b394ce106837038d79663a4e337f0528cc029f9) - code dynamic and add resource, variable description *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`26397b1`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/26397b1c2370d056795f180f5517c407e9b57202) - code dynamic and add resource, variable description *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`e453dc5`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/e453dc5b00db9efafdb30b6e20ae843e4fb25794) - code dynamic and add resource, variable description *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`da05e2c`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/da05e2cea4a25d582c51c5be41a24301f245d430) - code dynamic and add resource, variable description *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`0f72292`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/0f72292f3a6084bfa317082396ed6ed8e0dd71f2) - update security group version *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`ac45432`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/ac4543227af68196f2ddaf4623be242dc2fa7879) - update security group version *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`687bc25`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/687bc25bf8a7dcec5e680a4e3160ba90e1c7d468) - update security group version *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* + +### :bug: Bug Fixes +- [`94b8325`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/94b83252956581f636b0ea3bcef7eb17c36d77aa) - updated outputs.tf *(commit by [@mamrajyadav](https://github.com/mamrajyadav))* + + ## [1.0.1] - 2022-06-15 ### :bug: Bug Fixes - [`6245f4b`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/6245f4b6d8706cb609c04d59895417ad71c73f82) - use terraform letast version @@ -54,3 +86,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [0.14.0]: https://github.com/clouddrove/terraform-aws-api-gateway/tree/0.14.0 [0.14.1]: https://github.com/clouddrove/terraform-aws-api-gateway/tree/0.14.1 [1.0.1]: https://github.com/clouddrove/terraform-aws-api-gateway/tree/1.0.1 + +[1.4.0]: https://github.com/clouddrove/terraform-aws-api-gateway/compare/1.0.1...1.4.0 \ No newline at end of file From 38d53b0e1361bc77c09aaca8895cedfdb369651a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Jul 2023 01:26:42 +0000 Subject: [PATCH 02/20] build(deps): bump clouddrove/vpc/aws in /_examples/vpc_link_api Bumps [clouddrove/vpc/aws](https://github.com/clouddrove/terraform-aws-vpc) from 1.3.1 to 2.0.0. - [Release notes](https://github.com/clouddrove/terraform-aws-vpc/releases) - [Changelog](https://github.com/clouddrove/terraform-aws-vpc/blob/master/CHANGELOG.md) - [Commits](https://github.com/clouddrove/terraform-aws-vpc/compare/1.3.1...2.0.0) --- updated-dependencies: - dependency-name: clouddrove/vpc/aws dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- _examples/vpc_link_api/example.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_examples/vpc_link_api/example.tf b/_examples/vpc_link_api/example.tf index c9c3ea2..f9c382c 100644 --- a/_examples/vpc_link_api/example.tf +++ b/_examples/vpc_link_api/example.tf @@ -9,7 +9,7 @@ provider "aws" { ####---------------------------------------------------------------------------------- module "vpc" { source = "clouddrove/vpc/aws" - version = "1.3.1" + version = "2.0.0" name = "vpc" environment = "test" From 3264a489ebdf1664dfcfb101777eb28a5b7c5d50 Mon Sep 17 00:00:00 2001 From: theprashantyadav Date: Mon, 31 Jul 2023 17:21:10 +0530 Subject: [PATCH 03/20] feat: Added new vpc tag --- _examples/vpc_link_api/example.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_examples/vpc_link_api/example.tf b/_examples/vpc_link_api/example.tf index c9c3ea2..f9c382c 100644 --- a/_examples/vpc_link_api/example.tf +++ b/_examples/vpc_link_api/example.tf @@ -9,7 +9,7 @@ provider "aws" { ####---------------------------------------------------------------------------------- module "vpc" { source = "clouddrove/vpc/aws" - version = "1.3.1" + version = "2.0.0" name = "vpc" environment = "test" From 8af7e4a0a06de9e4b237beac6a969c6c71cdc120 Mon Sep 17 00:00:00 2001 From: clouddrove-ci Date: Mon, 31 Jul 2023 13:39:21 +0000 Subject: [PATCH 04/20] update README.md --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index d2dede2..bac7e41 100644 --- a/README.md +++ b/README.md @@ -54,12 +54,6 @@ We have [*fifty plus terraform modules*][terraform_modules]. A few of them are c This module has a few dependencies: -- [Terraform 1.x.x](https://learn.hashicorp.com/terraform/getting-started/install.html) -- [Go](https://golang.org/doc/install) -- [github.com/stretchr/testify/assert](https://github.com/stretchr/testify) -- [github.com/gruntwork-io/terratest/modules/terraform](https://github.com/gruntwork-io/terratest) - - From 7eb945739b2d832e25cb6d4ef06285f99d04ebd1 Mon Sep 17 00:00:00 2001 From: theprashantyadav <79893616+theprashantyadav@users.noreply.github.com> Date: Fri, 13 Oct 2023 22:36:04 +0530 Subject: [PATCH 05/20] Update version.tf and remove unuse variable (#51) * feat: update version.tf and remove unuse variable * feat: update version.tf and remove unuse variable * feat: update version.tf and remove unuse variable * feat: update github-action version and use locals in example * feat: update gitinnore and acm version * feat: update tf version --- .github/workflows/auto_assignee.yml | 2 +- .github/workflows/changelog.yml | 2 +- .github/workflows/tf-checks.yml | 4 +- .github/workflows/tflint.yml | 2 +- .github/workflows/tfsec.yml | 2 +- _examples/complete/example.tf | 34 +++---- _examples/complete/outputs.tf | 8 +- _examples/complete/test-api.zip | Bin 0 -> 330 bytes _examples/complete/versions.tf | 11 +++ _examples/vpc_link_api/example.tf | 146 +++++++++++++++++++++------- _examples/vpc_link_api/outputs.tf | 8 +- _examples/vpc_link_api/versions.tf | 11 +++ main.tf | 19 ++-- outputs.tf | 8 +- variables.tf | 14 +-- versions.tf | 4 +- 16 files changed, 178 insertions(+), 97 deletions(-) create mode 100644 _examples/complete/test-api.zip create mode 100644 _examples/complete/versions.tf create mode 100644 _examples/vpc_link_api/versions.tf diff --git a/.github/workflows/auto_assignee.yml b/.github/workflows/auto_assignee.yml index fd2ebf1..267f3b3 100644 --- a/.github/workflows/auto_assignee.yml +++ b/.github/workflows/auto_assignee.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: assign-pr: - uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@master + uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@1.0.6 secrets: GITHUB: ${{ secrets.GITHUB }} with: diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 3e88b85..72fc35b 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: call-workflow-changelog: - uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@master + uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@1.0.6 secrets: inherit with: branch: 'master' \ No newline at end of file diff --git a/.github/workflows/tf-checks.yml b/.github/workflows/tf-checks.yml index a3aa918..bd37ce4 100644 --- a/.github/workflows/tf-checks.yml +++ b/.github/workflows/tf-checks.yml @@ -6,10 +6,10 @@ on: workflow_dispatch: jobs: tf-checks-complete-example: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.6 with: working_directory: './_examples/complete/' tf-checks-basic-example: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.6 with: working_directory: './_examples/vpc_link_api/' diff --git a/.github/workflows/tflint.yml b/.github/workflows/tflint.yml index 99c6300..f00ce70 100644 --- a/.github/workflows/tflint.yml +++ b/.github/workflows/tflint.yml @@ -6,6 +6,6 @@ on: workflow_dispatch: jobs: tf-lint: - uses: clouddrove/test-tfsec/.github/workflows/tflint.yaml@master + uses: clouddrove/test-tfsec/.github/workflows/tflint.yaml@1.0.6 secrets: GITHUB: ${{ secrets.GITHUB }} \ No newline at end of file diff --git a/.github/workflows/tfsec.yml b/.github/workflows/tfsec.yml index c203751..e5e4394 100644 --- a/.github/workflows/tfsec.yml +++ b/.github/workflows/tfsec.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: jobs: tfsec: - uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@master + uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@1.0.6 secrets: inherit with: working_directory: '.' diff --git a/_examples/complete/example.tf b/_examples/complete/example.tf index 3a1c876..268b7ad 100644 --- a/_examples/complete/example.tf +++ b/_examples/complete/example.tf @@ -5,17 +5,19 @@ provider "aws" { region = "eu-west-1" } +locals { + name = "api" + environment = "test" +} ####---------------------------------------------------------------------------------- ## This terraform module is designed to generate consistent label names and tags for resources. ####---------------------------------------------------------------------------------- module "acm" { source = "clouddrove/acm/aws" - version = "1.3.0" - - name = "certificate" - environment = "test" - label_order = ["name", "environment"] + version = "1.4.1" + name = local.name + environment = local.environment enable_aws_certificate = true domain_name = "clouddrove.ca" subject_alternative_names = ["*.clouddrove.ca"] @@ -30,15 +32,13 @@ module "lambda" { source = "clouddrove/lambda/aws" version = "1.3.0" - name = "lambda" - environment = "test" - label_order = ["name", "environment"] - - enabled = true - timeout = 60 - filename = "./lambda_packages" - handler = "index.lambda_handler" - runtime = "python3.8" + name = local.name + environment = local.environment + enabled = true + timeout = 60 + filename = "./lambda_packages" + handler = "index.lambda_handler" + runtime = "python3.8" iam_actions = [ "logs:CreateLogStream", "logs:CreateLogGroup", @@ -72,10 +72,8 @@ module "lambda" { module "api_gateway" { source = "./../../" - name = "api" - environment = "test" - label_order = ["environment", "name"] - + name = local.name + environment = local.environment domain_name = "clouddrove.ca" domain_name_certificate_arn = module.acm.arn integration_uri = module.lambda.arn diff --git a/_examples/complete/outputs.tf b/_examples/complete/outputs.tf index 6fb1fbb..eef9623 100644 --- a/_examples/complete/outputs.tf +++ b/_examples/complete/outputs.tf @@ -1,19 +1,19 @@ output "api_id" { - value = join("", module.api_gateway.*.api_id) + value = join("", module.api_gateway[*].api_id) description = "The API identifier." } output "api_arn" { - value = join("", module.api_gateway.*.api_arn) + value = join("", module.api_gateway[*].api_arn) description = "The API arn." } output "api_endpoint" { - value = join("", module.api_gateway.*.api_endpoint) + value = join("", module.api_gateway[*].api_endpoint) description = "The URI of the API, of the form {api-id}.execute-api.{region}.amazonaws.com." } output "invoke_url" { - value = join("", module.api_gateway.*.invoke_url) + value = join("", module.api_gateway[*].invoke_url) description = "URL to invoke the API pointing to the stage" } \ No newline at end of file diff --git a/_examples/complete/test-api.zip b/_examples/complete/test-api.zip new file mode 100644 index 0000000000000000000000000000000000000000..8589034317795bcd093cef4cc5e4ede7405282fc GIT binary patch literal 330 zcmWIWW@Zs#-~d7f2E{HQ0S6$F%)FG;3cZ5Ln0`m^BL)Jk?|+Iq>+R-#y{m$!VuI_D z?n7D?0-86^W+=b)@mO|L>F@hV5jlp-#qUj@{=G)pf~z2C@-H7BFUy+tW82izSKpeH zZLn^m`y|~tGgqipef#}3=W2%Ru_b4l^p7dl`xkw*Y5C)ITR^IQ+oPF!#gc#9`@44t z?{=JhsqFbKvn5~m-+27KrE{j(*}&OK?q7u&825& iW`zHd Date: Fri, 13 Oct 2023 23:09:57 +0530 Subject: [PATCH 06/20] bug: fix tflint issue (#53) --- .github/workflows/tflint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tflint.yml b/.github/workflows/tflint.yml index f00ce70..40a35b2 100644 --- a/.github/workflows/tflint.yml +++ b/.github/workflows/tflint.yml @@ -6,6 +6,6 @@ on: workflow_dispatch: jobs: tf-lint: - uses: clouddrove/test-tfsec/.github/workflows/tflint.yaml@1.0.6 + uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@1.0.6 secrets: GITHUB: ${{ secrets.GITHUB }} \ No newline at end of file From 233d34bb997fe4cc561ec80bc1a383f27a796992 Mon Sep 17 00:00:00 2001 From: Himanshu Ahirwar <83774016+h1manshu98@users.noreply.github.com> Date: Tue, 14 Nov 2023 23:54:16 +0530 Subject: [PATCH 07/20] feat: custome stage name and auto-deploy variable (#54) --- main.tf | 4 ++-- variables.tf | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index 153d19a..c659ff9 100644 --- a/main.tf +++ b/main.tf @@ -99,8 +99,8 @@ resource "aws_apigatewayv2_stage" "default" { count = var.enabled && var.create_default_stage_enabled ? 1 : 0 api_id = aws_apigatewayv2_api.default[0].id - name = format("%s-stage", module.labels.id) - auto_deploy = false + name = var.stage_name != null ? var.stage_name : format("%s-stage", module.labels.id) + auto_deploy = var.auto_deploy dynamic "access_log_settings" { for_each = var.access_log_settings content { diff --git a/variables.tf b/variables.tf index 01e242a..bda6c8d 100644 --- a/variables.tf +++ b/variables.tf @@ -265,4 +265,16 @@ variable "passthrough_behavior" { type = string default = "WHEN_NO_MATCH" description = "Pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the request_templates attribute. " -} \ No newline at end of file +} + +variable "stage_name" { + type = string + default = null + description = "Stage Name to be used, set to `$default` to use Invoke URL as your default webpage for lambda" +} + +variable "auto_deploy" { + type = bool + default = false + description = "Set this to true to enable stage Auto Deployment" +} From c9417b5e9985d7b9eab1a9ceeef1135b7be350a9 Mon Sep 17 00:00:00 2001 From: CloudDrove CI <84795582+clouddrove-ci@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:18:33 +0000 Subject: [PATCH 08/20] docs: update CHANGELOG.md for 1.4.1 --- CHANGELOG.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cbb4fa..3084e83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.4.1] - 2023-11-15 +### :sparkles: New Features +- [`3264a48`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/3264a489ebdf1664dfcfb101777eb28a5b7c5d50) - Added new vpc tag *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* +- [`233d34b`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/233d34bb997fe4cc561ec80bc1a383f27a796992) - custome stage name and auto-deploy variable *(PR [#54](https://github.com/clouddrove/terraform-aws-api-gateway/pull/54) by [@h1manshu98](https://github.com/h1manshu98))* + +### :construction_worker: Build System +- [`38d53b0`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/38d53b0e1361bc77c09aaca8895cedfdb369651a) - **deps**: bump clouddrove/vpc/aws in /_examples/vpc_link_api *(commit by [@dependabot[bot]](https://github.com/apps/dependabot))* + +### :memo: Documentation Changes +- [`e9191ea`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/e9191ea607d6d0bba54ad64adf3926d57c75af88) - update CHANGELOG.md for 1.4.0 *(commit by [@clouddrove-ci](https://github.com/clouddrove-ci))* + + ## [1.4.0] - 2023-07-18 ### :sparkles: New Features - [`fc7b2c3`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/fc7b2c3ecdbe0dd8d92e6078afbc5368ac60930f) - added changelog.yml file use shared workflow *(commit by [@vibhutigoyal](https://github.com/vibhutigoyal))* @@ -87,4 +99,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [0.14.1]: https://github.com/clouddrove/terraform-aws-api-gateway/tree/0.14.1 [1.0.1]: https://github.com/clouddrove/terraform-aws-api-gateway/tree/1.0.1 -[1.4.0]: https://github.com/clouddrove/terraform-aws-api-gateway/compare/1.0.1...1.4.0 \ No newline at end of file +[1.4.0]: https://github.com/clouddrove/terraform-aws-api-gateway/compare/1.0.1...1.4.0 +[1.4.1]: https://github.com/clouddrove/terraform-aws-api-gateway/compare/1.4.0...1.4.1 \ No newline at end of file From 50cf1051642fb29642d227d51256c37ab8fb4fc6 Mon Sep 17 00:00:00 2001 From: Vaibhav Bhagwat Pendhare Date: Wed, 27 Dec 2023 23:44:30 +0530 Subject: [PATCH 09/20] Feat: Add automerge github shared workflow (#58) Co-authored-by: Anmol Nagpal --- .github/workflows/auto_assignee.yml | 6 ++++-- .github/workflows/automerge.yml | 12 ++++++++++++ .github/workflows/changelog.yml | 6 ++++-- .github/workflows/tf-checks.yml | 6 ++++-- .github/workflows/tflint.yml | 6 ++++-- .github/workflows/tfsec.yml | 4 +++- 6 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/automerge.yml diff --git a/.github/workflows/auto_assignee.yml b/.github/workflows/auto_assignee.yml index 267f3b3..7cd5a6a 100644 --- a/.github/workflows/auto_assignee.yml +++ b/.github/workflows/auto_assignee.yml @@ -1,3 +1,4 @@ +--- name: Auto Assign PRs on: @@ -7,8 +8,9 @@ on: workflow_dispatch: jobs: assign-pr: - uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@1.0.6 + uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@1.0.9 secrets: GITHUB: ${{ secrets.GITHUB }} with: - assignees: 'clouddrove-ci' \ No newline at end of file + assignees: 'clouddrove-ci' +... diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..418e9e2 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,12 @@ +--- +name: Auto merge +on: + pull_request: +jobs: + auto-merge: + uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@1.0.9 + secrets: + GITHUB: ${{ secrets.GITHUB }} + with: + tfcheck: 'tf-checks-complete-example / Check code format' +... diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 72fc35b..0ae2425 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,3 +1,4 @@ +--- name: changelog permissions: write-all on: @@ -7,7 +8,8 @@ on: workflow_dispatch: jobs: call-workflow-changelog: - uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@1.0.6 + uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@1.0.9 secrets: inherit with: - branch: 'master' \ No newline at end of file + branch: 'master' +... diff --git a/.github/workflows/tf-checks.yml b/.github/workflows/tf-checks.yml index bd37ce4..4a5f66a 100644 --- a/.github/workflows/tf-checks.yml +++ b/.github/workflows/tf-checks.yml @@ -1,3 +1,4 @@ +--- name: tf-checks on: push: @@ -6,10 +7,11 @@ on: workflow_dispatch: jobs: tf-checks-complete-example: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.6 + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.9 with: working_directory: './_examples/complete/' tf-checks-basic-example: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.6 + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.9 with: working_directory: './_examples/vpc_link_api/' +... diff --git a/.github/workflows/tflint.yml b/.github/workflows/tflint.yml index 40a35b2..4659c47 100644 --- a/.github/workflows/tflint.yml +++ b/.github/workflows/tflint.yml @@ -1,3 +1,4 @@ +--- name: tf-lint on: push: @@ -6,6 +7,7 @@ on: workflow_dispatch: jobs: tf-lint: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@1.0.6 + uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@1.0.9 secrets: - GITHUB: ${{ secrets.GITHUB }} \ No newline at end of file + GITHUB: ${{ secrets.GITHUB }} +... diff --git a/.github/workflows/tfsec.yml b/.github/workflows/tfsec.yml index e5e4394..f57a2b1 100644 --- a/.github/workflows/tfsec.yml +++ b/.github/workflows/tfsec.yml @@ -1,3 +1,4 @@ +--- name: tfsec permissions: write-all on: @@ -5,7 +6,8 @@ on: workflow_dispatch: jobs: tfsec: - uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@1.0.6 + uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@1.0.9 secrets: inherit with: working_directory: '.' +... From 01808acac8afbcf52a156ce5f0125225d419c9ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Dec 2023 18:16:37 +0000 Subject: [PATCH 10/20] build(deps): bump clouddrove/subnet/aws in /_examples/vpc_link_api Bumps [clouddrove/subnet/aws](https://github.com/clouddrove/terraform-aws-subnet) from 2.0.0 to 2.0.1. - [Release notes](https://github.com/clouddrove/terraform-aws-subnet/releases) - [Changelog](https://github.com/clouddrove/terraform-aws-subnet/blob/master/CHANGELOG.md) - [Commits](https://github.com/clouddrove/terraform-aws-subnet/compare/2.0.0...2.0.1) --- updated-dependencies: - dependency-name: clouddrove/subnet/aws dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- _examples/vpc_link_api/example.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_examples/vpc_link_api/example.tf b/_examples/vpc_link_api/example.tf index 9560257..1cee94e 100644 --- a/_examples/vpc_link_api/example.tf +++ b/_examples/vpc_link_api/example.tf @@ -29,7 +29,7 @@ module "vpc" { #tfsec:ignore:aws-ec2-no-public-ip-subnet module "public_subnets" { source = "clouddrove/subnet/aws" - version = "2.0.0" + version = "2.0.1" name = local.name environment = local.environment From b2a71c724381371d19f028447ee16529c0c906ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Dec 2023 18:16:44 +0000 Subject: [PATCH 11/20] build(deps): bump clouddrove/lambda/aws in /_examples/vpc_link_api Bumps [clouddrove/lambda/aws](https://github.com/clouddrove/terraform-aws-lambda) from 1.3.0 to 1.3.1. - [Release notes](https://github.com/clouddrove/terraform-aws-lambda/releases) - [Changelog](https://github.com/clouddrove/terraform-aws-lambda/blob/master/CHANGELOG.md) - [Commits](https://github.com/clouddrove/terraform-aws-lambda/compare/1.3.0...1.3.1) --- updated-dependencies: - dependency-name: clouddrove/lambda/aws dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- _examples/vpc_link_api/example.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_examples/vpc_link_api/example.tf b/_examples/vpc_link_api/example.tf index 9560257..397599f 100644 --- a/_examples/vpc_link_api/example.tf +++ b/_examples/vpc_link_api/example.tf @@ -153,7 +153,7 @@ module "acm" { ####---------------------------------------------------------------------------------- module "lambda" { source = "clouddrove/lambda/aws" - version = "1.3.0" + version = "1.3.1" name = local.name environment = local.environment From 373ad50f02bac6a35effaa844b65c862a5220b49 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Dec 2023 18:16:52 +0000 Subject: [PATCH 12/20] build(deps): bump clouddrove/lambda/aws in /_examples/complete Bumps [clouddrove/lambda/aws](https://github.com/clouddrove/terraform-aws-lambda) from 1.3.0 to 1.3.1. - [Release notes](https://github.com/clouddrove/terraform-aws-lambda/releases) - [Changelog](https://github.com/clouddrove/terraform-aws-lambda/blob/master/CHANGELOG.md) - [Commits](https://github.com/clouddrove/terraform-aws-lambda/compare/1.3.0...1.3.1) --- updated-dependencies: - dependency-name: clouddrove/lambda/aws dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- _examples/complete/example.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_examples/complete/example.tf b/_examples/complete/example.tf index 268b7ad..8d67613 100644 --- a/_examples/complete/example.tf +++ b/_examples/complete/example.tf @@ -30,7 +30,7 @@ module "acm" { ####---------------------------------------------------------------------------------- module "lambda" { source = "clouddrove/lambda/aws" - version = "1.3.0" + version = "1.3.1" name = local.name environment = local.environment From 42e5ae364952dc4a18522b7ee0e2bad88e9e458c Mon Sep 17 00:00:00 2001 From: Aatish sharma <152850912+Aatishsharma77@users.noreply.github.com> Date: Mon, 11 Mar 2024 23:39:51 +0530 Subject: [PATCH 13/20] Feat/rest api (#59) * feat: terrafrom script for rest-api and rest-api private * feat: terrafrom script for rest-api and rest-api private * feat: terrafrom script for rest-api and rest-api private * feat: terrafrom script for rest-api and rest-api private * feat: terrafrom script for rest-api and rest-api private * feat: terrafrom script for rest-api and rest-api private * feat: terrafrom script for rest-api and rest-api private * feat: terrafrom script for rest-api and rest-api private * fix- if you are fixing changes other than terraform code {such as tfsec, tfchecks, readme issues and all * fix: update region in all _examples * fix: update service name in _examples * feat: update payload version in http api gateway * feat: update payload version in http api gateway * feat: add cloudwatch log group and kms in rest api gateway * feat: add cloudwatch log group and kms in rest api gateway * feat: add cloudwatch log group and kms key * remove unused variables and fix create condtion on resources * fix defsec warnings for nacl --------- Co-authored-by: Himanshu Ahirwar --- .../{ => http-api-gateway}/example.tf | 52 +- .../{ => http-api-gateway}/outputs.tf | 10 +- .../version.tf} | 0 _examples/complete/lambda-test.zip | Bin 330 -> 0 bytes _examples/complete/lambda_packages/index.py | 17 +- _examples/complete/lambda_packages/index.zip | Bin 0 -> 335 bytes .../private-rest-api-gateway/example.tf | 225 +++++++++ .../private-rest-api-gateway/outputs.tf | 21 + .../private-rest-api-gateway/versions.tf | 11 + .../complete/rest-api-gateway/example.tf | 115 +++++ .../complete/rest-api-gateway/outputs.tf | 22 + .../complete/rest-api-gateway/versions.tf | 11 + _examples/complete/test-api.zip | Bin 330 -> 0 bytes _examples/vpc_link_api/example.tf | 2 +- main.tf | 456 ++++++++++++++++-- outputs.tf | 32 +- variables.tf | 440 ++++++++++++++++- 17 files changed, 1322 insertions(+), 92 deletions(-) rename _examples/complete/{ => http-api-gateway}/example.tf (67%) rename _examples/complete/{ => http-api-gateway}/outputs.tf (57%) rename _examples/complete/{versions.tf => http-api-gateway/version.tf} (100%) delete mode 100644 _examples/complete/lambda-test.zip create mode 100644 _examples/complete/lambda_packages/index.zip create mode 100644 _examples/complete/private-rest-api-gateway/example.tf create mode 100644 _examples/complete/private-rest-api-gateway/outputs.tf create mode 100644 _examples/complete/private-rest-api-gateway/versions.tf create mode 100644 _examples/complete/rest-api-gateway/example.tf create mode 100644 _examples/complete/rest-api-gateway/outputs.tf create mode 100644 _examples/complete/rest-api-gateway/versions.tf delete mode 100644 _examples/complete/test-api.zip diff --git a/_examples/complete/example.tf b/_examples/complete/http-api-gateway/example.tf similarity index 67% rename from _examples/complete/example.tf rename to _examples/complete/http-api-gateway/example.tf index 8d67613..94026e0 100644 --- a/_examples/complete/example.tf +++ b/_examples/complete/http-api-gateway/example.tf @@ -1,16 +1,23 @@ ####---------------------------------------------------------------------------------- -## Provider block added, Use the Amazon Web Services (AWS) provider to interact with the many resources supported by AWS. +## PROVIDER ####---------------------------------------------------------------------------------- provider "aws" { - region = "eu-west-1" + region = local.region } +####---------------------------------------------------------------------------------- +## LOCALS +####---------------------------------------------------------------------------------- + locals { - name = "api" - environment = "test" + name = "api" + environment = "test" + region = "us-east-1" + domain_name = "clouddrove.ca" + hosted_zone_id = "Z015XXXXXXXXXXXXXXIEP" } ####---------------------------------------------------------------------------------- -## This terraform module is designed to generate consistent label names and tags for resources. +## ACM ####---------------------------------------------------------------------------------- module "acm" { source = "clouddrove/acm/aws" @@ -19,14 +26,14 @@ module "acm" { name = local.name environment = local.environment enable_aws_certificate = true - domain_name = "clouddrove.ca" - subject_alternative_names = ["*.clouddrove.ca"] + domain_name = local.domain_name + subject_alternative_names = ["*.${local.domain_name}"] validation_method = "DNS" enable_dns_validation = false } ####---------------------------------------------------------------------------------- -## This terraform module is designed to generate consistent label names and tags for resources. +## LAMBDA ####---------------------------------------------------------------------------------- module "lambda" { source = "clouddrove/lambda/aws" @@ -34,9 +41,9 @@ module "lambda" { name = local.name environment = local.environment - enabled = true + enable = true timeout = 60 - filename = "./lambda_packages" + filename = "../lambda_packages/index.zip" handler = "index.lambda_handler" runtime = "python3.8" iam_actions = [ @@ -47,38 +54,39 @@ module "lambda" { names = [ "python_layer" ] - layer_filenames = ["./lambda-test.zip"] compatible_runtimes = [ ["python3.8"] ] statement_ids = [ - "AllowExecutionFromCloudWatch" + "AllowExecutionFromApiGateway" ] actions = [ "lambda:InvokeFunction" ] principals = [ - "events.amazonaws.com" + "apigateway.amazonaws.com" ] - source_arns = [module.api_gateway.api_arn] variables = { foo = "bar" } } ####---------------------------------------------------------------------------------- -## This terraform module is designed to generate consistent label names and tags for resources. +## API GATEWAY ####---------------------------------------------------------------------------------- module "api_gateway" { - source = "./../../" + source = "../../../" name = local.name environment = local.environment - domain_name = "clouddrove.ca" + domain_name = "api.${local.domain_name}" domain_name_certificate_arn = module.acm.arn - integration_uri = module.lambda.arn - zone_id = "1234059QJ345674343" + integration_uri = module.lambda.invoke_arn + zone_id = local.hosted_zone_id + auto_deploy = true + stage_name = "$default" create_vpc_link_enabled = false + create_http_api = true cors_configuration = { allow_credentials = true allow_methods = ["GET", "OPTIONS", "POST"] @@ -88,16 +96,16 @@ module "api_gateway" { "ANY /" = { lambda_arn = module.lambda.arn payload_format_version = "2.0" - timeout_milliseconds = 12000 + timeout_milliseconds = 30000 } "GET /some-route-with-authorizer" = { lambda_arn = module.lambda.arn - payload_format_version = "2.0" + payload_format_version = "1.0" authorizer_key = "cognito" } "POST /start-step-function" = { lambda_arn = module.lambda.arn - payload_format_version = "2.0" + payload_format_version = "1.0" authorizer_key = "cognito" } } diff --git a/_examples/complete/outputs.tf b/_examples/complete/http-api-gateway/outputs.tf similarity index 57% rename from _examples/complete/outputs.tf rename to _examples/complete/http-api-gateway/outputs.tf index eef9623..7025048 100644 --- a/_examples/complete/outputs.tf +++ b/_examples/complete/http-api-gateway/outputs.tf @@ -1,19 +1,19 @@ output "api_id" { - value = join("", module.api_gateway[*].api_id) + value = module.api_gateway.api_id description = "The API identifier." } output "api_arn" { - value = join("", module.api_gateway[*].api_arn) + value = module.api_gateway.api_arn description = "The API arn." } output "api_endpoint" { - value = join("", module.api_gateway[*].api_endpoint) + value = module.api_gateway.api_endpoint description = "The URI of the API, of the form {api-id}.execute-api.{region}.amazonaws.com." } output "invoke_url" { - value = join("", module.api_gateway[*].invoke_url) + value = module.api_gateway.invoke_url description = "URL to invoke the API pointing to the stage" -} \ No newline at end of file +} diff --git a/_examples/complete/versions.tf b/_examples/complete/http-api-gateway/version.tf similarity index 100% rename from _examples/complete/versions.tf rename to _examples/complete/http-api-gateway/version.tf diff --git a/_examples/complete/lambda-test.zip b/_examples/complete/lambda-test.zip deleted file mode 100644 index 8589034317795bcd093cef4cc5e4ede7405282fc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 330 zcmWIWW@Zs#-~d7f2E{HQ0S6$F%)FG;3cZ5Ln0`m^BL)Jk?|+Iq>+R-#y{m$!VuI_D z?n7D?0-86^W+=b)@mO|L>F@hV5jlp-#qUj@{=G)pf~z2C@-H7BFUy+tW82izSKpeH zZLn^m`y|~tGgqipef#}3=W2%Ru_b4l^p7dl`xkw*Y5C)ITR^IQ+oPF!#gc#9`@44t z?{=JhsqFbKvn5~m-+27KrE{j(*}&OK?q7u&825& iW`zHd9fjK34ML1^rkK@?q9KDk+R-#y{m$!VuI_D z?n7D?0-86^W+=b)@mO|L>F@hV5jlp-#qUj@{=G)pf~z2C@-H7BFUy+tW82izSKpeH zZLn^m`y|~tGgqipef#}3=W2%Ru_b4l^p7dl`xkw*Y5C)ITR^IQ+oPF!#gc#9`@44t z?{=JhsqFbKvn5~m-+27KrE{j(*}&OK?q7u&825& iW`zHd Date: Wed, 24 Apr 2024 14:36:00 +0530 Subject: [PATCH 14/20] feat: updated example path and readme parameters (#61) * feat: updated example path and readme parameters * feat- Updated Path for Ignore File --------- Co-authored-by: Vishwajit Nagulkar <119565952+VishwajitNagulkar@users.noreply.github.com> --- .github/dependabot.yml | 4 +- .github/workflows/readme.yml | 59 +++--------------- .github/workflows/tf-checks.yml | 4 +- README.yaml | 21 ++++++- .../complete/http-api-gateway/example.tf | 0 .../complete/http-api-gateway/outputs.tf | 0 .../complete/http-api-gateway/version.tf | 0 .../complete/lambda_packages/index.py | 0 .../complete/lambda_packages/index.zip | Bin .../private-rest-api-gateway/example.tf | 0 .../private-rest-api-gateway/outputs.tf | 0 .../private-rest-api-gateway/versions.tf | 0 .../complete/rest-api-gateway/example.tf | 0 .../complete/rest-api-gateway/outputs.tf | 0 .../complete/rest-api-gateway/versions.tf | 0 .../vpc_link_api/example.tf | 0 .../vpc_link_api/lambda-test.zip | Bin .../vpc_link_api/lambda_packages/index.py | 0 .../vpc_link_api/outputs.tf | 0 .../vpc_link_api/versions.tf | 0 20 files changed, 32 insertions(+), 56 deletions(-) rename {_examples => examples}/complete/http-api-gateway/example.tf (100%) rename {_examples => examples}/complete/http-api-gateway/outputs.tf (100%) rename {_examples => examples}/complete/http-api-gateway/version.tf (100%) rename {_examples => examples}/complete/lambda_packages/index.py (100%) rename {_examples => examples}/complete/lambda_packages/index.zip (100%) rename {_examples => examples}/complete/private-rest-api-gateway/example.tf (100%) rename {_examples => examples}/complete/private-rest-api-gateway/outputs.tf (100%) rename {_examples => examples}/complete/private-rest-api-gateway/versions.tf (100%) rename {_examples => examples}/complete/rest-api-gateway/example.tf (100%) rename {_examples => examples}/complete/rest-api-gateway/outputs.tf (100%) rename {_examples => examples}/complete/rest-api-gateway/versions.tf (100%) rename {_examples => examples}/vpc_link_api/example.tf (100%) rename {_examples => examples}/vpc_link_api/lambda-test.zip (100%) rename {_examples => examples}/vpc_link_api/lambda_packages/index.py (100%) rename {_examples => examples}/vpc_link_api/outputs.tf (100%) rename {_examples => examples}/vpc_link_api/versions.tf (100%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 362fd26..a3c3334 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -16,7 +16,7 @@ updates: reviewers: - "approvers" - package-ecosystem: "terraform" # See documentation for possible values - directory: "_examples/complete" # Location of package manifests + directory: "examples/complete" # Location of package manifests schedule: interval: "weekly" # Add assignees @@ -26,7 +26,7 @@ updates: reviewers: - "approvers" - package-ecosystem: "terraform" # See documentation for possible values - directory: "_examples/vpc_link_api" # Location of package manifests + directory: "examples/vpc_link_api" # Location of package manifests schedule: interval: "weekly" # Add assignees diff --git a/.github/workflows/readme.yml b/.github/workflows/readme.yml index 4bd38ee..3d0c2f1 100644 --- a/.github/workflows/readme.yml +++ b/.github/workflows/readme.yml @@ -1,54 +1,15 @@ -name: 'Create README.md file' +name: Readme Workflow on: push: branches: - master - + paths-ignore: + - 'README.md' + - 'docs/**' + workflow_dispatch: jobs: - readme-create: - name: 'readme-create' - runs-on: ubuntu-latest - steps: - - name: 'Checkout' - uses: actions/checkout@master - - - name: 'Set up Python 3.7' - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - - name: 'create readme' - uses: 'clouddrove/github-actions@v9.0.2' - with: - actions_subcommand: 'readme' - github_token: '${{ secrets.GITHUB }}' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - - name: 'pre-commit check errors' - uses: pre-commit/action@v3.0.0 - continue-on-error: true - - - name: 'pre-commit fix erros' - uses: pre-commit/action@v3.0.0 - continue-on-error: true - - - name: 'push readme' - uses: 'clouddrove/github-actions@v9.0.2' - continue-on-error: true - with: - actions_subcommand: 'push' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: 'Slack Notification' - uses: clouddrove/action-slack@v2 - with: - status: ${{ job.status }} - fields: repo,author - author_name: 'CloudDrove' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required - if: always() + README: + uses: clouddrove/github-shared-workflows/.github/workflows/readme.yml@1.2.4 + secrets: + TOKEN : ${{ secrets.GITHUB }} + SLACK_WEBHOOK_TERRAFORM: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} diff --git a/.github/workflows/tf-checks.yml b/.github/workflows/tf-checks.yml index 4a5f66a..cb1028f 100644 --- a/.github/workflows/tf-checks.yml +++ b/.github/workflows/tf-checks.yml @@ -9,9 +9,9 @@ jobs: tf-checks-complete-example: uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.9 with: - working_directory: './_examples/complete/' + working_directory: './examples/complete/' tf-checks-basic-example: uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.9 with: - working_directory: './_examples/vpc_link_api/' + working_directory: './examples/vpc_link_api/' ... diff --git a/README.yaml b/README.yaml index d589e53..ac0396c 100644 --- a/README.yaml +++ b/README.yaml @@ -24,13 +24,28 @@ badges: - name: "Licence" image: "https://img.shields.io/badge/License-APACHE-blue.svg" url: "LICENSE.md" + - name: "Changelog" + image: "https://img.shields.io/badge/Changelog-blue" + url: "CHANGELOG.md" +prerequesties: + - name: Terraform + url: https://learn.hashicorp.com/terraform/getting-started/install.html + version: ">= 1.6.1" + +providers: + - name: aws + url: https://aws.amazon.com/ + version: ">= 5.20.0" + +module_dependencies: + - name: Labels Module + url: https://github.com/clouddrove/terraform-aws-labels + description: Provides resource tagging. + # description of this project description: |- Terraform module api-gateway-v2 to create new modules using this as baseline -# extra content -include: - - "terraform.md" # How to use this project # How to use this project diff --git a/_examples/complete/http-api-gateway/example.tf b/examples/complete/http-api-gateway/example.tf similarity index 100% rename from _examples/complete/http-api-gateway/example.tf rename to examples/complete/http-api-gateway/example.tf diff --git a/_examples/complete/http-api-gateway/outputs.tf b/examples/complete/http-api-gateway/outputs.tf similarity index 100% rename from _examples/complete/http-api-gateway/outputs.tf rename to examples/complete/http-api-gateway/outputs.tf diff --git a/_examples/complete/http-api-gateway/version.tf b/examples/complete/http-api-gateway/version.tf similarity index 100% rename from _examples/complete/http-api-gateway/version.tf rename to examples/complete/http-api-gateway/version.tf diff --git a/_examples/complete/lambda_packages/index.py b/examples/complete/lambda_packages/index.py similarity index 100% rename from _examples/complete/lambda_packages/index.py rename to examples/complete/lambda_packages/index.py diff --git a/_examples/complete/lambda_packages/index.zip b/examples/complete/lambda_packages/index.zip similarity index 100% rename from _examples/complete/lambda_packages/index.zip rename to examples/complete/lambda_packages/index.zip diff --git a/_examples/complete/private-rest-api-gateway/example.tf b/examples/complete/private-rest-api-gateway/example.tf similarity index 100% rename from _examples/complete/private-rest-api-gateway/example.tf rename to examples/complete/private-rest-api-gateway/example.tf diff --git a/_examples/complete/private-rest-api-gateway/outputs.tf b/examples/complete/private-rest-api-gateway/outputs.tf similarity index 100% rename from _examples/complete/private-rest-api-gateway/outputs.tf rename to examples/complete/private-rest-api-gateway/outputs.tf diff --git a/_examples/complete/private-rest-api-gateway/versions.tf b/examples/complete/private-rest-api-gateway/versions.tf similarity index 100% rename from _examples/complete/private-rest-api-gateway/versions.tf rename to examples/complete/private-rest-api-gateway/versions.tf diff --git a/_examples/complete/rest-api-gateway/example.tf b/examples/complete/rest-api-gateway/example.tf similarity index 100% rename from _examples/complete/rest-api-gateway/example.tf rename to examples/complete/rest-api-gateway/example.tf diff --git a/_examples/complete/rest-api-gateway/outputs.tf b/examples/complete/rest-api-gateway/outputs.tf similarity index 100% rename from _examples/complete/rest-api-gateway/outputs.tf rename to examples/complete/rest-api-gateway/outputs.tf diff --git a/_examples/complete/rest-api-gateway/versions.tf b/examples/complete/rest-api-gateway/versions.tf similarity index 100% rename from _examples/complete/rest-api-gateway/versions.tf rename to examples/complete/rest-api-gateway/versions.tf diff --git a/_examples/vpc_link_api/example.tf b/examples/vpc_link_api/example.tf similarity index 100% rename from _examples/vpc_link_api/example.tf rename to examples/vpc_link_api/example.tf diff --git a/_examples/vpc_link_api/lambda-test.zip b/examples/vpc_link_api/lambda-test.zip similarity index 100% rename from _examples/vpc_link_api/lambda-test.zip rename to examples/vpc_link_api/lambda-test.zip diff --git a/_examples/vpc_link_api/lambda_packages/index.py b/examples/vpc_link_api/lambda_packages/index.py similarity index 100% rename from _examples/vpc_link_api/lambda_packages/index.py rename to examples/vpc_link_api/lambda_packages/index.py diff --git a/_examples/vpc_link_api/outputs.tf b/examples/vpc_link_api/outputs.tf similarity index 100% rename from _examples/vpc_link_api/outputs.tf rename to examples/vpc_link_api/outputs.tf diff --git a/_examples/vpc_link_api/versions.tf b/examples/vpc_link_api/versions.tf similarity index 100% rename from _examples/vpc_link_api/versions.tf rename to examples/vpc_link_api/versions.tf From 21be13ec627b90ff37bd1379f4e83a5391ea86d9 Mon Sep 17 00:00:00 2001 From: clouddrove-ci Date: Wed, 24 Apr 2024 09:15:41 +0000 Subject: [PATCH 15/20] update README.md --- README.md | 295 ++++++++++++++++++++++------------------------------- docs/io.md | 130 +++++++++++++++++++++++ 2 files changed, 252 insertions(+), 173 deletions(-) create mode 100644 docs/io.md diff --git a/README.md b/README.md index bac7e41..07c6e17 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,13 @@ - -

- - +[![Banner](https://github.com/clouddrove/terraform-gcp-vpc/blob/master/docs/CloudDrove.png)][website]

Terraform Module API-GATEWAY-V2

-

- Terraform module api-gateway-v2 to create new modules using this as baseline -

+

+ With our comprehensive DevOps toolkit - streamline operations, automate workflows, enhance collaboration and, most importantly, deploy with confidence. +

+

@@ -22,6 +20,9 @@ Licence + + Changelog +

@@ -30,6 +31,9 @@ + + + @@ -41,19 +45,22 @@
-We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy Bigger problems are always solved by breaking them into smaller manageable problems. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller connected yet manageable pieces within the infrastructure. +We are a group of DevOps engineers & architects, joining hands in this ever evolving digital landscape. With our strong belief in Automation; just like microservices, always on the lookout to split the the infrastructure into smaller connected resources (database, cluster and more) which could be standardized, are manageable, scalable, secure & follow industry best practices. -This module is basically combination of [Terraform open source](https://www.terraform.io/) and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself. -We have [*fifty plus terraform modules*][terraform_modules]. A few of them are comepleted and are available for open source usage while a few others are in progress. +This module includes Terraform open source, examples, and automation tests (for better understanding), which would help you create and improve your infrastructure with minimalistic coding. -## Prerequisites +## Prerequisites and Providers -This module has a few dependencies: +This table contains both Prerequisites and Providers: +| Description | Name | Version | +|:-------------:|:-------------------------------------------:|:---------:| +| **Prerequisite** | [Terraform](https://learn.hashicorp.com/terraform/getting-started/install.html) | >= 1.6.1 | +| **Provider** | [aws](https://aws.amazon.com/) | >= 5.20.0 | @@ -61,180 +68,122 @@ This module has a few dependencies: ## Examples +**IMPORTANT:** Since the master branch used in source varies based on new modifications, we recommend using the [release versions](https://github.com/clouddrove/terraform-aws-api-gateway/releases). + +πŸ“Œ For additional usage examples, check the complete list under [`examples/`](./examples) directory. + + + +## Inputs and Outputs + +Refer to complete documentation: [here](docs/io.md) + + + + + +## Module Dependencies + +This module has dependencies on: +- [Labels Module](https://github.com/clouddrove/terraform-aws-labels): Provides resource tagging. + + +## πŸ“‘ Changelog + +Refer [here](CHANGELOG.md). + + + + +## ✨ Contributors + +Big thanks to our contributors for elevating our project with their dedication and expertise! But, we do not wish to stop there, would like to invite contributions from the community in improving these projects and making them more versatile for better reach. Remember, every bit of contribution is immensely valuable, as, together, we are moving in only 1 direction, i.e. forward. + + + + +
+
+ + If you're considering contributing to our project, here are a few quick guidelines that we have been following (Got a suggestion? We are all ears!): + +- **Fork the Repository:** Create a new branch for your feature or bug fix. +- **Coding Standards:** You know the drill. +- **Clear Commit Messages:** Write clear and concise commit messages to facilitate understanding. +- **Thorough Testing:** Test your changes thoroughly before submitting a pull request. +- **Documentation Updates:** Include relevant documentation updates if your changes impact it. + + + + + + + + + -**IMPORTANT:** Since the `master` branch used in `source` varies based on new modifications, we suggest that you use the release versions [here](https://github.com/clouddrove/terraform-aws-api-gateway/releases). - - -Here are examples of how you can use this module in your inventory structure: -### complete Example -```hcl - module "api-gateway" { - source = "clouddrove/api-gateway/aws" - version = "1.4.0" - - domain_name = "example.cam" - domain_name_certificate_arn = module.acm.arn - integration_uri = module.lambda.arn - zone_id = "1234059QJ345674343" - create_vpc_link_enabled = false - cors_configuration = { - allow_credentials = true - allow_methods = ["GET", "OPTIONS", "POST"] - max_age = 5 - } - integrations = { - "ANY /" = { - lambda_arn = module.lambda.arn - payload_format_version = "2.0" - timeout_milliseconds = 12000 - } - "GET /some-route-with-authorizer" = { - lambda_arn = module.lambda.arn - payload_format_version = "2.0" - authorizer_key = "cognito" - } - "POST /start-step-function" = { - lambda_arn = module.lambda.arn - payload_format_version = "2.0" - authorizer_key = "cognito" - } - } - } -``` -### vpc_link_api Example -```hcl - module "api-gateway" { - source = "clouddrove/api-gateway/aws" - version = "1.4.0" - - name = "api" - environment = "test" - label_order = ["environment", "name"] - domain_name = "example.cam" - create_vpc_link_enabled = true - zone_id = "1`23456059QJZ25345678" - integration_uri = module.lambda.arn - domain_name_certificate_arn = module.acm.arn - subnet_ids = tolist(module.public_subnets.public_subnet_id) - security_group_ids = [module.security_group.security_group_ids] - cors_configuration = { - allow_credentials = true - allow_methods = ["GET", "OPTIONS", "POST"] - max_age = 5 - } - integrations = { - "ANY /" = { - lambda_arn = module.lambda.arn - payload_format_version = "2.0" - timeout_milliseconds = 12000 - } - "GET /some-route-with-authorizer" = { - lambda_arn = module.lambda.arn - payload_format_version = "2.0" - authorizer_key = "cognito" - } - "POST /start-step-function" = { - lambda_arn = module.lambda.arn - payload_format_version = "2.0" - authorizer_key = "cognito" - } - } - } -``` - - - - - - -## Inputs - -| Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| access\_log\_settings | Settings for logging access in this stage. | `map(string)` | `{}` | no | -| api\_description | the description of the API. | `string` | `"Manages an Amazon API Gateway Version 2 API."` | no | -| api\_key\_selection\_expression | An API key selection expression. Valid values: $context.authorizer.usageIdentifierKey, $request.header.x-api-key. | `string` | `"$request.header.x-api-key"` | no | -| api\_version | A version identifier for the API | `string` | `null` | no | -| apigatewayv2\_api\_mapping\_enabled | Flag to control the mapping creation. | `bool` | `true` | no | -| attributes | Additional attributes (e.g. `1`). | `list(any)` | `[]` | no | -| authorizer\_type | The authorizer type. Valid values: JWT, REQUEST. For WebSocket APIs, specify REQUEST for a Lambda function using incoming request parameters. For HTTP APIs, specify JWT to use JSON Web Tokens. | `string` | `"JWT"` | no | -| authorizers | Map of API gateway authorizers | `map(any)` | `{}` | no | -| body | An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs. | `string` | `null` | no | -| connection\_type | Type of the network connection to the integration endpoint. Valid values: INTERNET, VPC\_LINK. Default is INTERNET. | `string` | `"INTERNET"` | no | -| cors\_configuration | The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs. | `any` | `{}` | no | -| create\_api\_domain\_name\_enabled | Flag to control the domain creation. | `bool` | `true` | no | -| create\_api\_gateway\_enabled | Flag to control the api creation. | `bool` | `true` | no | -| create\_default\_stage\_enabled | Flag to control the stage creation. | `bool` | `true` | no | -| create\_routes\_and\_integrations\_enabled | Whether to create routes and integrations resources | `bool` | `true` | no | -| create\_vpc\_link\_enabled | Whether to create VPC links | `bool` | `true` | no | -| credentials\_arn | Part of quick create. Specifies any credentials required for the integration. Applicable for HTTP APIs. | `string` | `null` | no | -| default\_route\_settings | Default route settings for the stage. | `map(string)` | `{}` | no | -| default\_stage\_access\_log\_destination\_arn | ARN of the CloudWatch Logs log group to receive access logs. | `string` | `null` | no | -| default\_stage\_access\_log\_format | Single line format of the access logs of data. Refer to log settings for HTTP or Websocket. | `string` | `null` | no | -| domain\_name | The domain name to use for API gateway | `string` | `null` | no | -| domain\_name\_certificate\_arn | The ARN of an AWS-managed certificate that will be used by the endpoint for the domain name | `string` | `""` | no | -| domain\_name\_ownership\_verification\_certificate\_arn | ARN of the AWS-issued certificate used to validate custom domain ownership (when certificate\_arn is issued via an ACM Private CA or mutual\_tls\_authentication is configured with an ACM-imported certificate.) | `string` | `null` | no | -| enabled | Flag to control the api creation. | `bool` | `true` | no | -| environment | Environment (e.g. `prod`, `dev`, `staging`). | `string` | `"test"` | no | -| identity\_sources | The identity sources for which authorization is requested. | `list(string)` |
[
"$request.header.Authorization"
]
| no | -| integration\_description | Description of the integration. | `string` | `"Lambda example"` | no | -| integration\_method | Integration's HTTP method. Must be specified if integration\_type is not MOCK. | `string` | `"POST"` | no | -| integration\_type | Integration type of an integration. Valid values: AWS (supported only for WebSocket APIs), AWS\_PROXY, HTTP (supported only for WebSocket APIs), HTTP\_PROXY, MOCK (supported only for WebSocket APIs). | `string` | `"AWS_PROXY"` | no | -| integration\_uri | URI of the Lambda function for a Lambda proxy integration, when integration\_type is AWS\_PROXY. For an HTTP integration, specify a fully-qualified URL. | `string` | `""` | no | -| integrations | Map of API gateway routes with integrations | `map(any)` | `{}` | no | -| label\_order | Label order, e.g. `name`,`application`. | `list(any)` | `[]` | no | -| managedby | ManagedBy, eg 'CloudDrove' | `string` | `"hello@clouddrove.com"` | no | -| mutual\_tls\_authentication | An Amazon S3 URL that specifies the truststore for mutual TLS authentication as well as version, keyed at uri and version | `map(string)` | `{}` | no | -| name | Name (e.g. `app` or `cluster`). | `string` | `"api"` | no | -| passthrough\_behavior | Pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the request\_templates attribute. | `string` | `"WHEN_NO_MATCH"` | no | -| protocol\_type | The API protocol. Valid values: HTTP, WEBSOCKET | `string` | `"HTTP"` | no | -| repository | Terraform current module repo | `string` | `""` | no | -| route\_key | Part of quick create. Specifies any route key. Applicable for HTTP APIs. | `string` | `null` | no | -| route\_selection\_expression | The route selection expression for the API. | `string` | `"$request.method $request.path"` | no | -| route\_settings | Settings for default route | `map(string)` | `{}` | no | -| security\_group\_ids | A list of security group IDs to associate with. | `list(string)` | `[]` | no | -| subnet\_ids | A list of VPC Subnet IDs to launch in. | `list(string)` | `[]` | no | -| tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`). | `map(any)` | `{}` | no | -| target | Part of quick create. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP\_PROXY or AWS\_PROXY, respectively. Applicable for HTTP APIs. | `string` | `null` | no | -| vpc\_links | Map of VPC Links details to create | `map(any)` | `{}` | no | -| zone\_id | The ID of the hosted zone to contain this record. | `string` | `""` | no | - -## Outputs - -| Name | Description | -|------|-------------| -| api\_arn | The API identifier. | -| api\_endpoint | The URI of the API, of the form {api-id}.execute-api.{region}.amazonaws.com. | -| api\_id | The API identifier. | -| invoke\_url | URL to invoke the API pointing to the stage | - - - - -## Testing -In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system. - -You need to run the following command in the testing folder: -```hcl - go test -run Test -``` ## Feedback -If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/terraform-aws-api-gateway/issues), or feel free to drop us an email at [hello@clouddrove.com](mailto:hello@clouddrove.com). +Spot a bug or have thoughts to share with us? Let's squash it together! Log it in our [issue tracker](https://github.com/clouddrove/terraform-aws-api-gateway/issues), feel free to drop us an email at [hello@clouddrove.com](mailto:hello@clouddrove.com). + +Show some love with a β˜… on [our GitHub](https://github.com/clouddrove/terraform-aws-api-gateway)! if our work has brightened your day! – your feedback fuels our journey! + + +## :rocket: Our Accomplishment + +We have [*100+ Terraform modules*][terraform_modules] πŸ™Œ. You could consider them finished, but, with enthusiasts like yourself, we are able to ever improve them, so we call our status - improvement in progress. + +- [Terraform Module Registry:](https://registry.terraform.io/namespaces/clouddrove) Discover our Terraform modules here. + +- [Terraform Modules for AWS/Azure Modules:](https://github.com/clouddrove/toc) Explore our comprehensive Table of Contents for easy navigation through our documentation for modules pertaining to AWS, Azure & GCP. + +- [Terraform Modules for Digital Ocean:](https://github.com/terraform-do-modules/toc) Check out our specialized Terraform modules for Digital Ocean. + + + + +## Join Our Slack Community + +Join our vibrant open-source slack community and embark on an ever-evolving journey with CloudDrove; helping you in moving upwards in your career path. +Join our vibrant Open Source Slack Community and embark on a learning journey with CloudDrove. Grow with us in the world of DevOps and set your career on a path of consistency. + +πŸŒπŸ’¬What you'll get after joining this Slack community: + +- πŸš€ Encouragement to upgrade your best version. +- 🌈 Learning companionship with our DevOps squad. +- 🌱 Relentless growth with daily updates on new advancements in technologies. + +Join our tech elites [Join Now][slack] πŸš€ + + +## Explore Our Blogs -If you have found it worth your time, go ahead and give us a β˜… on [our GitHub](https://github.com/clouddrove/terraform-aws-api-gateway)! + Click [here][blog] :books: :star2: -## About us +## Tap into our capabilities +We provide a platform for organizations to engage with experienced top-tier DevOps & Cloud services. Tap into our pool of certified engineers and architects to elevate your DevOps and Cloud Solutions. -At [CloudDrove][website], we offer expert guidance, implementation support and services to help organisations accelerate their journey to the cloud. Our services include docker and container orchestration, cloud migration and adoption, infrastructure automation, application modernisation and remediation, and performance engineering. +At [CloudDrove][website], has extensive experience in designing, building & migrating environments, securing, consulting, monitoring, optimizing, automating, and maintaining complex and large modern systems. With remarkable client footprints in American & European corridors, our certified architects & engineers are ready to serve you as per your requirements & schedule. Write to us at [business@clouddrove.com](mailto:business@clouddrove.com).

We are The Cloud Experts!


-

We ❀️ Open Source and you can check out our other modules to get help with your new Cloud ideas.

+

We ❀️ Open Source and you can check out our other modules to get help with your new Cloud ideas.

[website]: https://clouddrove.com + [blog]: https://blog.clouddrove.com + [slack]: https://www.launchpass.com/devops-talks [github]: https://github.com/clouddrove [linkedin]: https://cpco.io/linkedin [twitter]: https://twitter.com/clouddrove/ diff --git a/docs/io.md b/docs/io.md new file mode 100644 index 0000000..2d743d9 --- /dev/null +++ b/docs/io.md @@ -0,0 +1,130 @@ +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| access\_log\_settings | Settings for logging access in this stage. | `map(string)` | `{}` | no | +| api\_deployment\_description | flag to manage description of api deployment | `string` | `"test"` | no | +| api\_description | the description of the API. | `string` | `"Manages an Amazon API Gateway Version 2 API."` | no | +| api\_key\_selection\_expression | An API key selection expression. Valid values: $context.authorizer.usageIdentifierKey, $request.header.x-api-key. | `string` | `"$request.header.x-api-key"` | no | +| api\_resources | flag to control of resources path | `map(map(string))` | `{}` | no | +| api\_version | A version identifier for the API | `string` | `null` | no | +| apigatewayv2\_api\_mapping\_enabled | Flag to control the mapping creation. | `bool` | `true` | no | +| authorization | Required The type of authorization used for the method (NONE, CUSTOM, AWS\_IAM, COGNITO\_USER\_POOLS) | `string` | `"NONE"` | no | +| authorizer\_iam\_role | Custome IAMRole for Authorizer Credentials. | `string` | `""` | no | +| authorizer\_result\_ttl\_in\_seconds | TTL of cached authorizer results in seconds. Defaults to 300. | `number` | `300` | no | +| authorizer\_type | The authorizer type. Valid values: JWT, REQUEST. For WebSocket APIs, specify REQUEST for a Lambda function using incoming request parameters. For HTTP APIs, specify JWT to use JSON Web Tokens. | `string` | `"JWT"` | no | +| authorizers | Map of API gateway authorizers | `map(any)` | `{}` | no | +| auto\_deploy | Set this to true to enable stage Auto Deployment | `bool` | `false` | no | +| body | An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs. | `string` | `null` | no | +| cache\_cluster\_enabled | Whether a cache cluster is enabled for the stage | `bool` | `false` | no | +| cache\_cluster\_size | Size of the cache cluster for the stage, if enabled. Allowed values include 0.5, 1.6, 6.1, 13.5, 28.4, 58.2, 118 and 237. | `string` | `"0.5"` | no | +| cache\_key\_parameters | List of cache key parameters for the integration. | `list(any)` | `[]` | no | +| cache\_namespace | Integration's cache namespace. | `string` | `""` | no | +| canary\_settings | (optional) describe your variable | `map(any)` | `{}` | no | +| client\_certificate\_id | Identifier of a client certificate for the stage. | `string` | `""` | no | +| connection\_id | ID of the VpcLink used for the integration. Required if connection\_type is VPC\_LINK | `string` | `""` | no | +| connection\_rest\_api\_type | 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). | `string` | `"INTERNET"` | no | +| connection\_type | Type of the network connection to the integration endpoint. Valid values: INTERNET, VPC\_LINK. Default is INTERNET. | `string` | `"INTERNET"` | no | +| content\_handling | 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. | `string` | `"CONVERT_TO_TEXT"` | no | +| cors\_configuration | The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs. | `any` | `{}` | no | +| create\_api\_domain\_name\_enabled | Flag to control the domain creation. | `bool` | `true` | no | +| create\_default\_stage\_enabled | Flag to control the stage creation. | `bool` | `true` | no | +| create\_http\_api | Flag to control creation of HTTP api. | `bool` | `false` | no | +| create\_kms\_key | Set this to `false` to provide existing kms key arn in `kms_key_arn` variable. | `bool` | `true` | no | +| create\_rest\_api | Flag to control the rest api creation. | `bool` | `false` | no | +| create\_rest\_api\_deployment | Flag to control the mapping creation. | `bool` | `true` | no | +| create\_rest\_api\_gateway\_authorizer | Flag to control the rest api gateway authorizer creation. | `bool` | `true` | no | +| create\_rest\_api\_gateway\_integration | Flag to control the rest api gateway integration creation. | `bool` | `true` | no | +| create\_rest\_api\_gateway\_integration\_response | Flag to control the rest api gateway integration response creation. | `bool` | `true` | no | +| create\_rest\_api\_gateway\_method | Flag to control the rest api gateway method creation. | `bool` | `true` | no | +| create\_rest\_api\_gateway\_method\_response | Flag to control the rest api gateway stage creation. | `bool` | `true` | no | +| create\_rest\_api\_gateway\_resource | flag to control the rest api gateway resources creation | `bool` | `true` | no | +| create\_rest\_api\_gateway\_stage | Flag to control the rest api gateway stage creation. | `bool` | `true` | no | +| create\_routes\_and\_integrations\_enabled | Whether to create routes and integrations resources | `bool` | `true` | no | +| create\_vpc\_endpoint | VPC endpoint is required to access api gateway url from outside the vpc. Set this to `false` to prevent vpc endpoint creation. | `bool` | `true` | no | +| create\_vpc\_link\_enabled | Whether to create VPC links | `bool` | `true` | no | +| credentials | 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 | `string` | `""` | no | +| credentials\_arn | Part of quick create. Specifies any credentials required for the integration. Applicable for HTTP APIs. | `string` | `null` | no | +| default\_route\_settings | Default route settings for the stage. | `map(string)` | `{}` | no | +| default\_stage\_access\_log\_destination\_arn | ARN of the CloudWatch Logs log group to receive access logs. | `string` | `null` | no | +| default\_stage\_access\_log\_format | Single line format of the access logs of data. Refer to log settings for HTTP or Websocket. | `string` | `null` | no | +| description\_gateway\_stage | (optional) describe your variable | `string` | `"demo-test"` | no | +| documentation\_version | Version of the associated API documentation | `string` | `""` | no | +| domain\_name | The domain name to use for API gateway | `string` | `null` | no | +| domain\_name\_certificate\_arn | The ARN of an AWS-managed certificate that will be used by the endpoint for the domain name | `string` | `""` | no | +| domain\_name\_ownership\_verification\_certificate\_arn | ARN of the AWS-issued certificate used to validate custom domain ownership (when certificate\_arn is issued via an ACM Private CA or mutual\_tls\_authentication is configured with an ACM-imported certificate.) | `string` | `null` | no | +| enable\_access\_logs | flag to manage of cloudwatch log group creation | `bool` | `true` | no | +| enable\_key\_rotation | Specifies whether key rotation is enabled. Defaults to false. | `bool` | `null` | no | +| enabled | Set this to `false` to prevent resource creation by this terraform module. | `bool` | `true` | no | +| environment | Environment (e.g. `prod`, `dev`, `staging`). | `string` | `"test"` | no | +| gateway\_authorizer | flag to control the gateway authorizer name. | `string` | `"demo"` | no | +| gateway\_integration\_type | flag tp control the gatway integration type. | `string` | `"AWS_PROXY"` | no | +| http\_method | HTTP method (GET, POST, PUT, DELETE, HEAD, OPTION, ANY) when calling the associated resource. | `string` | `"ANY"` | no | +| identity\_source | Source of the identity in an incoming request. Defaults to method.request.header.Authorization. For REQUEST type, this may be a comma-separated list of values, including headers, query string parameters and stage variable | `string` | `"method.request.header.Authorization"` | no | +| identity\_sources | The identity sources for which authorization is requested. | `list(string)` |
[
"$request.header.Authorization"
]
| no | +| integration\_description | Description of the integration. | `string` | `"Lambda example"` | no | +| integration\_http\_method | flag to control the gateway intergration http method. | `string` | `"POST"` | no | +| integration\_method | Integration's HTTP method. Must be specified if integration\_type is not MOCK. | `string` | `"POST"` | no | +| integration\_response\_parameters | Map of response parameters that can be read from the backend response. For example: response\_parameters = { method.response.header.X-Some-Header = integration.response.header.X-Some-Other-Header }. | `map(string)` | `{}` | no | +| integration\_type | Integration type of an integration. Valid values: AWS (supported only for WebSocket APIs), AWS\_PROXY, HTTP (supported only for WebSocket APIs), HTTP\_PROXY, MOCK (supported only for WebSocket APIs). | `string` | `"AWS_PROXY"` | no | +| integration\_uri | URI of the Lambda function for a Lambda proxy integration, when integration\_type is AWS\_PROXY. For an HTTP integration, specify a fully-qualified URL. | `string` | `""` | no | +| integrations | Map of API gateway routes with integrations | `map(any)` | `{}` | no | +| kms\_key\_arn | Pass existing KMS key arn. Only applicable when `create_kms_key` is set to false. | `string` | `""` | no | +| label\_order | Label order, e.g. `name`,`application`. | `list(any)` |
[
"name",
"environment"
]
| no | +| log\_format | Formatting and values recorded in the logs. For more information on configuring the log format rules visit the AWS documentation | `string` | `" {\n\t\"requestTime\": \"$context.requestTime\",\n\t\"requestId\": \"$context.requestId\",\n\t\"httpMethod\": \"$context.httpMethod\",\n\t\"path\": \"$context.path\",\n\t\"resourcePath\": \"$context.resourcePath\",\n\t\"status\": $context.status,\n\t\"responseLatency\": $context.responseLatency,\n \"xrayTraceId\": \"$context.xrayTraceId\",\n \"integrationRequestId\": \"$context.integration.requestId\",\n\t\"functionResponseStatus\": \"$context.integration.status\",\n \"integrationLatency\": \"$context.integration.latency\",\n\t\"integrationServiceStatus\": \"$context.integration.integrationStatus\",\n \"authorizeResultStatus\": \"$context.authorize.status\",\n\t\"authorizerServiceStatus\": \"$context.authorizer.status\",\n\t\"authorizerLatency\": \"$context.authorizer.latency\",\n\t\"authorizerRequestId\": \"$context.authorizer.requestId\",\n \"ip\": \"$context.identity.sourceIp\",\n\t\"userAgent\": \"$context.identity.userAgent\",\n\t\"principalId\": \"$context.authorizer.principalId\",\n\t\"cognitoUser\": \"$context.identity.cognitoIdentityId\",\n \"user\": \"$context.identity.user\"\n}\n"` | no | +| log\_group\_class | Specified the log class of the log group. Possible values are: STANDARD or INFREQUENT\_ACCESS. | `string` | `"STANDARD"` | no | +| managedby | ManagedBy, eg 'CloudDrove' | `string` | `"hello@clouddrove.com"` | no | +| multi\_region | ndicates whether the KMS key is a multi-Region (true) or regional (false) key. Defaults to false. | `bool` | `false` | no | +| mutual\_tls\_authentication | An Amazon S3 URL that specifies the truststore for mutual TLS authentication as well as version, keyed at uri and version | `map(string)` | `{}` | no | +| name | Name (e.g. `app` or `api`). | `string` | `""` | no | +| passthrough\_behavior | Pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the request\_templates attribute. | `string` | `"WHEN_NO_MATCH"` | no | +| private\_dns\_enabled | AWS services and AWS Marketplace partner services only) Whether or not to associate a private hosted zone with the specified VPC. Applicable for endpoints of type Interface. Most users will want this enabled to allow services within the VPC to automatically use the endpoint. Defaults to false. | `bool` | `false` | no | +| protocol\_type | The API protocol. Valid values: HTTP, WEBSOCKET | `string` | `"HTTP"` | no | +| provider\_arns | required for type COGNITO\_USER\_POOLS) List of the Amazon Cognito user pool ARNs. Each element is of this format: arn:aws:cognito-idp:{region}:{account\_id}:userpool/{user\_pool\_id}. | `set(string)` | `[]` | no | +| repository | Terraform current module repo | `string` | `""` | no | +| request\_parameters | Map of request query string parameters and headers that should be passed to the backend responder | `map(string)` | `null` | no | +| request\_templates | Map of the integration's request templates. | `map(string)` | `null` | no | +| response\_models | A map of the API models used for the response's content type | `map(string)` |
{
"application/json": "Empty"
}
| no | +| response\_parameters | Map of response parameters that can be sent to the caller. For example: response\_parameters { method.response.header.X-Some-Header = true } would define that the header X-Some-Header can be provided on the response | `map(bool)` | `{}` | no | +| rest\_api\_assume\_role\_policy | Custome Trust Relationship Policy for Authorizer IAMRole. | `string` | `""` | no | +| rest\_api\_base\_path | Path segment that must be prepended to the path when accessing the API via this mapping. If omitted, the API is exposed at the root of the given domain. | `string` | `""` | no | +| rest\_api\_description | The description of the REST API | `string` | `"test"` | no | +| rest\_api\_endpoint\_type | (Required) List of endpoint types. This resource currently only supports managing a single value. Valid values: EDGE, REGIONAL or PRIVATE. If unspecified, defaults to EDGE. | `string` | `null` | no | +| rest\_api\_resource\_policy | (Optional) custom resource policy for private rest api. | `string` | `""` | no | +| rest\_api\_stage\_name | The name of the stage | `string` | `""` | no | +| rest\_variables | Map to set on the stage managed by the stage\_name argument. | `map(string)` | `{}` | no | +| retention\_in\_days | Specifies the number of days you want to retain log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, 3653, and 0. If you select 0, the events in the log group are always retained and never expire. | `number` | `null` | no | +| route\_key | Part of quick create. Specifies any route key. Applicable for HTTP APIs. | `string` | `null` | no | +| route\_selection\_expression | The route selection expression for the API. | `string` | `"$request.method $request.path"` | no | +| route\_settings | Settings for default route | `map(string)` | `{}` | no | +| security\_group\_ids | A list of security group IDs to associate with. | `list(string)` | `[]` | no | +| service\_name | The service name. For AWS services the service name is usually in the form com.amazonaws.. (the SageMaker Notebook service is an exception to this rule, the service name is in the form aws.sagemaker..notebook). | `string` | `""` | no | +| skip\_destroy | Set to true if you do not wish the log group (and any logs it may contain) to be deleted at destroy time, and instead just remove the log group from the Terraform state. | `bool` | `null` | no | +| stage\_description | Description to set on the stage managed by the stage\_name argument. | `string` | `"test"` | no | +| stage\_name | Stage Name to be used, set to `$default` to use Invoke URL as your default webpage for lambda | `string` | `null` | no | +| stage\_variables | Map that defines the stage variables | `map(string)` | `{}` | no | +| status\_code | flag to control the status code | `string` | `"200"` | no | +| subnet\_ids | A list of VPC Subnet IDs to launch in. | `list(string)` | `[]` | no | +| target | Part of quick create. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP\_PROXY or AWS\_PROXY, respectively. Applicable for HTTP APIs. | `string` | `null` | no | +| timeout\_milliseconds | Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds. | `number` | `null` | no | +| type | Type of the authorizer. Possible values are TOKEN for a Lambda function using a single authorization token submitted in a custom header, REQUEST for a Lambda function using incoming request parameters, or COGNITO\_USER\_POOLS for using an Amazon Cognito user pool. Defaults to TOKEN. | `string` | `"TOKEN"` | no | +| vpc\_endpoint\_id | ID of the vpc endpoint. Only applicable when | `string` | `""` | no | +| vpc\_endpoint\_type | The VPC endpoint type, Gateway, GatewayLoadBalancer, or Interface. Defaults to Gateway. | `string` | `"Gateway"` | no | +| vpc\_id | The ID of the VPC in which the endpoint will be used. | `string` | `""` | no | +| vpc\_links | Map of VPC Links details to create | `map(any)` | `{}` | no | +| xray\_tracing\_enabled | A flag to indicate whether to enable X-Ray tracing. | `bool` | `true` | no | +| zone\_id | The ID of the hosted zone to contain this record. | `string` | `""` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| api\_arn | The HTTP API ARN. | +| api\_endpoint | The URI of the API, of the form {api-id}.execute-api.{region}.amazonaws.com. | +| api\_id | The HTTP Api ID. | +| invoke\_url | URL to invoke the API pointing to the stage | +| rest\_api\_arn | The Rest Api Arn. | +| rest\_api\_execution\_arn | Execution arn of rest api gateway. | +| rest\_api\_id | The ID of the REST API | +| rest\_api\_invoke\_url | The URL to invoke the API pointing to the stage | + From 47812297ac350d8d17f77574adcfe49eadb193b7 Mon Sep 17 00:00:00 2001 From: rakeshclouddevops Date: Fri, 9 Aug 2024 17:20:29 +0530 Subject: [PATCH 16/20] feat: updated branch name in uses of workflow (#62) --- .github/workflows/auto_assignee.yml | 2 +- .github/workflows/automerge.yml | 2 +- .github/workflows/changelog.yml | 2 +- .github/workflows/readme.yml | 2 +- .github/workflows/tf-checks.yml | 4 ++-- .github/workflows/tflint.yml | 2 +- .github/workflows/tfsec.yml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/auto_assignee.yml b/.github/workflows/auto_assignee.yml index 7cd5a6a..2c50a82 100644 --- a/.github/workflows/auto_assignee.yml +++ b/.github/workflows/auto_assignee.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: jobs: assign-pr: - uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@1.0.9 + uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@master secrets: GITHUB: ${{ secrets.GITHUB }} with: diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 418e9e2..1761e98 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -4,7 +4,7 @@ on: pull_request: jobs: auto-merge: - uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@1.0.9 + uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@master secrets: GITHUB: ${{ secrets.GITHUB }} with: diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 0ae2425..0b873d3 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: jobs: call-workflow-changelog: - uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@1.0.9 + uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@master secrets: inherit with: branch: 'master' diff --git a/.github/workflows/readme.yml b/.github/workflows/readme.yml index 3d0c2f1..c4a5793 100644 --- a/.github/workflows/readme.yml +++ b/.github/workflows/readme.yml @@ -9,7 +9,7 @@ on: workflow_dispatch: jobs: README: - uses: clouddrove/github-shared-workflows/.github/workflows/readme.yml@1.2.4 + uses: clouddrove/github-shared-workflows/.github/workflows/readme.yml@master secrets: TOKEN : ${{ secrets.GITHUB }} SLACK_WEBHOOK_TERRAFORM: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} diff --git a/.github/workflows/tf-checks.yml b/.github/workflows/tf-checks.yml index cb1028f..561d5c6 100644 --- a/.github/workflows/tf-checks.yml +++ b/.github/workflows/tf-checks.yml @@ -7,11 +7,11 @@ on: workflow_dispatch: jobs: tf-checks-complete-example: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.9 + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master with: working_directory: './examples/complete/' tf-checks-basic-example: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.0.9 + uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master with: working_directory: './examples/vpc_link_api/' ... diff --git a/.github/workflows/tflint.yml b/.github/workflows/tflint.yml index 4659c47..3a48f31 100644 --- a/.github/workflows/tflint.yml +++ b/.github/workflows/tflint.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: tf-lint: - uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@1.0.9 + uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@master secrets: GITHUB: ${{ secrets.GITHUB }} ... diff --git a/.github/workflows/tfsec.yml b/.github/workflows/tfsec.yml index f57a2b1..5054227 100644 --- a/.github/workflows/tfsec.yml +++ b/.github/workflows/tfsec.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: jobs: tfsec: - uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@1.0.9 + uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@master secrets: inherit with: working_directory: '.' From 29572850b9a98dfee58fa390a982604efef8ee86 Mon Sep 17 00:00:00 2001 From: clouddrove-ci Date: Fri, 9 Aug 2024 12:00:04 +0000 Subject: [PATCH 17/20] update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 07c6e17..8a36d2c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![Banner](https://github.com/clouddrove/terraform-gcp-vpc/blob/master/docs/CloudDrove.png)][website] +[![Banner](https://github.com/clouddrove/terraform-module-template/assets/119565952/67a8a1af-2eb7-40b7-ae07-c94cde9ce062)][website]

Terraform Module API-GATEWAY-V2

From 2d0cee303784cc3168a3365bd5ca8ff9b37343de Mon Sep 17 00:00:00 2001 From: Aatish sharma <152850912+Aatishsharma77@users.noreply.github.com> Date: Fri, 14 Mar 2025 17:47:31 +0530 Subject: [PATCH 18/20] Fix: Error in count condition of HTTP-Api-Gateway (#60) * fix: resolved a kms key error in http-api * fix: remove unnecessary comment * fix: resolve a tflint interpolation issue * fix: fixed variable default value * fix: updated a directory structure * fix: update a .github/workflow/tf-check.yml file * fix: Change the name of the example file. * fix: upadate a tf-check file --------- Co-authored-by: CloudDrove CI <84795582+clouddrove-ci@users.noreply.github.com> --- .github/workflows/tf-checks.yml | 2 +- examples/http-api-gateway/example.tf | 112 +++++++++ examples/http-api-gateway/outputs.tf | 19 ++ examples/http-api-gateway/version.tf | 11 + examples/lambda_packages/index.py | 7 + examples/lambda_packages/index.zip | Bin 0 -> 335 bytes examples/private-rest-api-gateway/example.tf | 225 ++++++++++++++++++ examples/private-rest-api-gateway/outputs.tf | 21 ++ examples/private-rest-api-gateway/versions.tf | 11 + examples/rest-api-gateway/example.tf | 115 +++++++++ examples/rest-api-gateway/outputs.tf | 22 ++ examples/rest-api-gateway/versions.tf | 11 + main.tf | 5 +- variables.tf | 4 +- 14 files changed, 560 insertions(+), 5 deletions(-) create mode 100644 examples/http-api-gateway/example.tf create mode 100644 examples/http-api-gateway/outputs.tf create mode 100644 examples/http-api-gateway/version.tf create mode 100644 examples/lambda_packages/index.py create mode 100644 examples/lambda_packages/index.zip create mode 100644 examples/private-rest-api-gateway/example.tf create mode 100644 examples/private-rest-api-gateway/outputs.tf create mode 100644 examples/private-rest-api-gateway/versions.tf create mode 100644 examples/rest-api-gateway/example.tf create mode 100644 examples/rest-api-gateway/outputs.tf create mode 100644 examples/rest-api-gateway/versions.tf diff --git a/.github/workflows/tf-checks.yml b/.github/workflows/tf-checks.yml index 561d5c6..b8e595f 100644 --- a/.github/workflows/tf-checks.yml +++ b/.github/workflows/tf-checks.yml @@ -9,7 +9,7 @@ jobs: tf-checks-complete-example: uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master with: - working_directory: './examples/complete/' + working_directory: './examples/' tf-checks-basic-example: uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master with: diff --git a/examples/http-api-gateway/example.tf b/examples/http-api-gateway/example.tf new file mode 100644 index 0000000..6a7f3d8 --- /dev/null +++ b/examples/http-api-gateway/example.tf @@ -0,0 +1,112 @@ +####---------------------------------------------------------------------------------- +## PROVIDER +####---------------------------------------------------------------------------------- +provider "aws" { + region = local.region +} + +####---------------------------------------------------------------------------------- +## LOCALS +####---------------------------------------------------------------------------------- + +locals { + name = "api" + environment = "test" + region = "us-east-1" + domain_name = "clouddrove.ca" + hosted_zone_id = "Z0xxxxxxxxxxxxxxEP" +} +####---------------------------------------------------------------------------------- +## ACM +####---------------------------------------------------------------------------------- +module "acm" { + source = "clouddrove/acm/aws" + version = "1.4.1" + + name = local.name + environment = local.environment + enable_aws_certificate = true + domain_name = local.domain_name + subject_alternative_names = ["*.${local.domain_name}"] + validation_method = "DNS" + enable_dns_validation = false +} + +####---------------------------------------------------------------------------------- +## LAMBDA +####---------------------------------------------------------------------------------- +module "lambda" { + source = "clouddrove/lambda/aws" + version = "1.3.1" + + name = local.name + environment = local.environment + enable = true + timeout = 60 + filename = "../lambda_packages/index.zip" + handler = "index.lambda_handler" + runtime = "python3.8" + iam_actions = [ + "logs:CreateLogStream", + "logs:CreateLogGroup", + "logs:PutLogEvents" + ] + names = [ + "python_layer" + ] + compatible_runtimes = [ + ["python3.8"] + ] + statement_ids = [ + "AllowExecutionFromApiGateway" + ] + actions = [ + "lambda:InvokeFunction" + ] + principals = [ + "apigateway.amazonaws.com" + ] + variables = { + foo = "bar" + } +} + +####---------------------------------------------------------------------------------- +## API GATEWAY +####---------------------------------------------------------------------------------- +module "api_gateway" { + source = "../../." + + name = local.name + environment = local.environment + domain_name = "api.${local.domain_name}" + domain_name_certificate_arn = module.acm.arn + integration_uri = module.lambda.invoke_arn + zone_id = local.hosted_zone_id + auto_deploy = true + stage_name = "$default" + create_vpc_link_enabled = false + create_http_api = true + cors_configuration = { + allow_credentials = true + allow_methods = ["GET", "OPTIONS", "POST"] + max_age = 5 + } + integrations = { + "ANY /" = { + lambda_arn = module.lambda.arn + payload_format_version = "2.0" + timeout_milliseconds = 30000 + } + "GET /some-route-with-authorizer" = { + lambda_arn = module.lambda.arn + payload_format_version = "1.0" + authorizer_key = "cognito" + } + "POST /start-step-function" = { + lambda_arn = module.lambda.arn + payload_format_version = "1.0" + authorizer_key = "cognito" + } + } +} \ No newline at end of file diff --git a/examples/http-api-gateway/outputs.tf b/examples/http-api-gateway/outputs.tf new file mode 100644 index 0000000..7025048 --- /dev/null +++ b/examples/http-api-gateway/outputs.tf @@ -0,0 +1,19 @@ +output "api_id" { + value = module.api_gateway.api_id + description = "The API identifier." +} + +output "api_arn" { + value = module.api_gateway.api_arn + description = "The API arn." +} + +output "api_endpoint" { + value = module.api_gateway.api_endpoint + description = "The URI of the API, of the form {api-id}.execute-api.{region}.amazonaws.com." +} + +output "invoke_url" { + value = module.api_gateway.invoke_url + description = "URL to invoke the API pointing to the stage" +} diff --git a/examples/http-api-gateway/version.tf b/examples/http-api-gateway/version.tf new file mode 100644 index 0000000..3f60246 --- /dev/null +++ b/examples/http-api-gateway/version.tf @@ -0,0 +1,11 @@ +# Terraform version +terraform { + required_version = ">= 1.6.1" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 5.20.0" + } + } +} \ No newline at end of file diff --git a/examples/lambda_packages/index.py b/examples/lambda_packages/index.py new file mode 100644 index 0000000..a0f3277 --- /dev/null +++ b/examples/lambda_packages/index.py @@ -0,0 +1,7 @@ +import json +def lambda_handler(event, context): + print('Lambda function with Python!|') + return { + 'statusCode': 200, + 'body': json.dumps('Hello from Lambda!') + } diff --git a/examples/lambda_packages/index.zip b/examples/lambda_packages/index.zip new file mode 100644 index 0000000000000000000000000000000000000000..f7f278d2512ef361a87817c1e9e6645ab5d2bbe0 GIT binary patch literal 335 zcmWIWW@Zs#-~hs@Q;i}RpkNJ<=3r1@$jnPgt9fjK34ML1^rkK@?q9KDk Date: Fri, 14 Mar 2025 12:18:38 +0000 Subject: [PATCH 19/20] docs: update CHANGELOG.md for 1.5.0 --- CHANGELOG.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3084e83..3cd1dd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.5.0] - 2025-03-14 +### :sparkles: New Features +- [`50cf105`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/50cf1051642fb29642d227d51256c37ab8fb4fc6) - Add automerge github shared workflow *(PR [#58](https://github.com/clouddrove/terraform-aws-api-gateway/pull/58) by [@vaibhav7797](https://github.com/vaibhav7797))* +- [`32d8469`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/32d8469e8a30aff35159a5e3e31107eb8bc37df1) - updated example path and readme parameters *(PR [#61](https://github.com/clouddrove/terraform-aws-api-gateway/pull/61) by [@Tanveer143s](https://github.com/Tanveer143s))* +- [`4781229`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/47812297ac350d8d17f77574adcfe49eadb193b7) - updated branch name in uses of workflow *(PR [#62](https://github.com/clouddrove/terraform-aws-api-gateway/pull/62) by [@rakeshclouddevops](https://github.com/rakeshclouddevops))* + +### :bug: Bug Fixes +- [`2d0cee3`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/2d0cee303784cc3168a3365bd5ca8ff9b37343de) - Error in count condition of HTTP-Api-Gateway *(PR [#60](https://github.com/clouddrove/terraform-aws-api-gateway/pull/60) by [@Aatishsharma77](https://github.com/Aatishsharma77))* + +### :construction_worker: Build System +- [`01808ac`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/01808acac8afbcf52a156ce5f0125225d419c9ba) - **deps**: bump clouddrove/subnet/aws in /_examples/vpc_link_api *(commit by [@dependabot[bot]](https://github.com/apps/dependabot))* +- [`b2a71c7`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/b2a71c724381371d19f028447ee16529c0c906ed) - **deps**: bump clouddrove/lambda/aws in /_examples/vpc_link_api *(commit by [@dependabot[bot]](https://github.com/apps/dependabot))* +- [`373ad50`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/373ad50f02bac6a35effaa844b65c862a5220b49) - **deps**: bump clouddrove/lambda/aws in /_examples/complete *(commit by [@dependabot[bot]](https://github.com/apps/dependabot))* + +### :memo: Documentation Changes +- [`c9417b5`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/c9417b5e9985d7b9eab1a9ceeef1135b7be350a9) - update CHANGELOG.md for 1.4.1 *(commit by [@clouddrove-ci](https://github.com/clouddrove-ci))* + + ## [1.4.1] - 2023-11-15 ### :sparkles: New Features - [`3264a48`](https://github.com/clouddrove/terraform-aws-api-gateway/commit/3264a489ebdf1664dfcfb101777eb28a5b7c5d50) - Added new vpc tag *(commit by [@theprashantyadav](https://github.com/theprashantyadav))* @@ -100,4 +118,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [1.0.1]: https://github.com/clouddrove/terraform-aws-api-gateway/tree/1.0.1 [1.4.0]: https://github.com/clouddrove/terraform-aws-api-gateway/compare/1.0.1...1.4.0 -[1.4.1]: https://github.com/clouddrove/terraform-aws-api-gateway/compare/1.4.0...1.4.1 \ No newline at end of file +[1.4.1]: https://github.com/clouddrove/terraform-aws-api-gateway/compare/1.4.0...1.4.1 +[1.5.0]: https://github.com/clouddrove/terraform-aws-api-gateway/compare/1.4.1...1.5.0 From 226598b35a0769d30c42fb7c1abdf3a68c583c74 Mon Sep 17 00:00:00 2001 From: clouddrove-ci Date: Fri, 14 Mar 2025 12:28:24 +0000 Subject: [PATCH 20/20] update README.md --- docs/io.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/io.md b/docs/io.md index 2d743d9..2f23165 100644 --- a/docs/io.md +++ b/docs/io.md @@ -108,7 +108,7 @@ | target | Part of quick create. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP\_PROXY or AWS\_PROXY, respectively. Applicable for HTTP APIs. | `string` | `null` | no | | timeout\_milliseconds | Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds. | `number` | `null` | no | | type | Type of the authorizer. Possible values are TOKEN for a Lambda function using a single authorization token submitted in a custom header, REQUEST for a Lambda function using incoming request parameters, or COGNITO\_USER\_POOLS for using an Amazon Cognito user pool. Defaults to TOKEN. | `string` | `"TOKEN"` | no | -| vpc\_endpoint\_id | ID of the vpc endpoint. Only applicable when | `string` | `""` | no | +| vpc\_endpoint\_id | ID of the vpc endpoint. Only applicable when | `set(string)` |
[
""
]
| no | | vpc\_endpoint\_type | The VPC endpoint type, Gateway, GatewayLoadBalancer, or Interface. Defaults to Gateway. | `string` | `"Gateway"` | no | | vpc\_id | The ID of the VPC in which the endpoint will be used. | `string` | `""` | no | | vpc\_links | Map of VPC Links details to create | `map(any)` | `{}` | no |