├── versions.tf ├── examples ├── complete │ ├── versions.tf │ ├── variables.tf │ ├── outputs.tf │ ├── main.tf │ └── README.md └── README.md ├── outputs.tf ├── main.tf ├── .editorconfig ├── variables.tf ├── .gitignore ├── .github └── workflows │ ├── lock.yml │ ├── release.yml │ ├── stale-actions.yaml │ ├── pr-title.yml │ └── pre-commit.yml ├── .releaserc.json ├── .pre-commit-config.yaml ├── README.md ├── CHANGELOG.md └── LICENSE /versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = ">= 1.0" 3 | 4 | required_providers { 5 | aws = { 6 | source = "hashicorp/aws" 7 | version = ">= 4.40" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/complete/versions.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = ">= 1.0" 3 | 4 | required_providers { 5 | aws = { 6 | source = "hashicorp/aws" 7 | version = ">= 4.40" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/complete/variables.tf: -------------------------------------------------------------------------------- 1 | variable "vpc_private_subnets" { 2 | description = "List of CIDR blocks of private subnets" 3 | type = list(string) 4 | default = ["10.10.11.0/24", "10.10.12.0/24", "10.10.13.0/24"] 5 | } 6 | -------------------------------------------------------------------------------- /examples/complete/outputs.tf: -------------------------------------------------------------------------------- 1 | output "ids" { 2 | description = "List of IDs of Customer Gateway" 3 | value = module.cgw.ids 4 | } 5 | 6 | output "customer_gateway" { 7 | description = "Map of Customer Gateway attributes" 8 | value = module.cgw.customer_gateway 9 | } 10 | -------------------------------------------------------------------------------- /outputs.tf: -------------------------------------------------------------------------------- 1 | output "ids" { 2 | description = "List of IDs of Customer Gateway" 3 | value = [for k, v in aws_customer_gateway.this : v.id] 4 | } 5 | 6 | output "customer_gateway" { 7 | description = "Map of Customer Gateway attributes" 8 | value = aws_customer_gateway.this 9 | } 10 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | Please note - the examples provided serve two primary means: 4 | 5 | 1. Show users working examples of the various ways in which the module can be configured and features supported 6 | 2. A means of testing/validating module changes 7 | 8 | Please do not mistake the examples provided as "best practices". It is up to users to consult the AWS service documentation for best practices, usage recommendations, etc. 9 | -------------------------------------------------------------------------------- /main.tf: -------------------------------------------------------------------------------- 1 | resource "aws_customer_gateway" "this" { 2 | for_each = var.create ? var.customer_gateways : {} 3 | 4 | bgp_asn = try(each.value["bgp_asn"], null) 5 | certificate_arn = try(each.value["certificate_arn"], null) 6 | ip_address = try(each.value["ip_address"], null) 7 | device_name = try(each.value["device_name"], null) 8 | type = "ipsec.1" 9 | 10 | tags = merge( 11 | { 12 | Name = format("%s-%s", var.name, each.key) 13 | }, 14 | var.tags 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | # Uses editorconfig to maintain consistent coding styles 3 | 4 | # top-most EditorConfig file 5 | root = true 6 | 7 | # Unix-style newlines with a newline ending every file 8 | [*] 9 | charset = utf-8 10 | end_of_line = lf 11 | indent_size = 2 12 | indent_style = space 13 | insert_final_newline = true 14 | max_line_length = 80 15 | trim_trailing_whitespace = true 16 | 17 | [*.{tf,tfvars}] 18 | indent_size = 2 19 | indent_style = space 20 | 21 | [*.md] 22 | max_line_length = 0 23 | trim_trailing_whitespace = false 24 | 25 | [Makefile] 26 | tab_width = 2 27 | indent_style = tab 28 | 29 | [COMMIT_EDITMSG] 30 | max_line_length = 0 31 | -------------------------------------------------------------------------------- /variables.tf: -------------------------------------------------------------------------------- 1 | variable "create" { 2 | description = "Whether to create Customer Gateway resources" 3 | type = bool 4 | default = true 5 | } 6 | 7 | variable "name" { 8 | description = "Name to be used on all the resources as identifier" 9 | type = string 10 | default = "" 11 | } 12 | 13 | variable "customer_gateways" { 14 | description = "Maps of Customer Gateway's attributes (BGP ASN and Gateway's Internet-routable external IP address)" 15 | type = map(map(any)) 16 | default = {} 17 | } 18 | 19 | variable "tags" { 20 | description = "A mapping of tags to assign to all resources" 21 | type = map(string) 22 | default = {} 23 | } 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Local .terraform directories 2 | **/.terraform/* 3 | 4 | # Terraform lockfile 5 | .terraform.lock.hcl 6 | 7 | # .tfstate files 8 | *.tfstate 9 | *.tfstate.* 10 | 11 | # Crash log files 12 | crash.log 13 | 14 | # Exclude all .tfvars files, which are likely to contain sentitive data, such as 15 | # password, private keys, and other secrets. These should not be part of version 16 | # control as they are data points which are potentially sensitive and subject 17 | # to change depending on the environment. 18 | *.tfvars 19 | 20 | # Ignore override files as they are usually used to override resources locally and so 21 | # are not checked in 22 | override.tf 23 | override.tf.json 24 | *_override.tf 25 | *_override.tf.json 26 | 27 | # Ignore CLI configuration files 28 | .terraformrc 29 | terraform.rc 30 | 31 | # Lambda build artifacts 32 | builds/ 33 | __pycache__/ 34 | *.zip 35 | .tox 36 | 37 | # Local editors/macos files 38 | .DS_Store 39 | .idea 40 | -------------------------------------------------------------------------------- /.github/workflows/lock.yml: -------------------------------------------------------------------------------- 1 | name: 'Lock Threads' 2 | 3 | on: 4 | schedule: 5 | - cron: '50 1 * * *' 6 | 7 | jobs: 8 | lock: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: dessant/lock-threads@v5 12 | with: 13 | github-token: ${{ secrets.GITHUB_TOKEN }} 14 | issue-comment: > 15 | I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues. 16 | If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. 17 | issue-inactive-days: '30' 18 | pr-comment: > 19 | I'm going to lock this pull request because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues. 20 | If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. 21 | pr-inactive-days: '30' 22 | -------------------------------------------------------------------------------- /.releaserc.json: -------------------------------------------------------------------------------- 1 | { 2 | "branches": [ 3 | "main", 4 | "master" 5 | ], 6 | "ci": false, 7 | "plugins": [ 8 | [ 9 | "@semantic-release/commit-analyzer", 10 | { 11 | "preset": "conventionalcommits" 12 | } 13 | ], 14 | [ 15 | "@semantic-release/release-notes-generator", 16 | { 17 | "preset": "conventionalcommits" 18 | } 19 | ], 20 | [ 21 | "@semantic-release/github", 22 | { 23 | "successComment": "This ${issue.pull_request ? 'PR is included' : 'issue has been resolved'} in version ${nextRelease.version} :tada:", 24 | "labels": false, 25 | "releasedLabels": false 26 | } 27 | ], 28 | [ 29 | "@semantic-release/changelog", 30 | { 31 | "changelogFile": "CHANGELOG.md", 32 | "changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file." 33 | } 34 | ], 35 | [ 36 | "@semantic-release/git", 37 | { 38 | "assets": [ 39 | "CHANGELOG.md" 40 | ], 41 | "message": "chore(release): version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" 42 | } 43 | ] 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - main 8 | - master 9 | paths: 10 | - '**/*.tpl' 11 | - '**/*.py' 12 | - '**/*.tf' 13 | - '.github/workflows/release.yml' 14 | 15 | jobs: 16 | release: 17 | name: Release 18 | runs-on: ubuntu-latest 19 | # Skip running release workflow on forks 20 | if: github.repository_owner == 'terraform-aws-modules' 21 | steps: 22 | - name: Checkout 23 | uses: actions/checkout@v5 24 | with: 25 | persist-credentials: false 26 | fetch-depth: 0 27 | 28 | - name: Set correct Node.js version 29 | uses: actions/setup-node@v6 30 | with: 31 | node-version: 24 32 | 33 | - name: Install dependencies 34 | run: | 35 | npm install \ 36 | @semantic-release/changelog@6.0.3 \ 37 | @semantic-release/git@10.0.1 \ 38 | conventional-changelog-conventionalcommits@9.1.0 39 | 40 | - name: Release 41 | uses: cycjimmy/semantic-release-action@v5 42 | with: 43 | semantic_version: 25.0.0 44 | env: 45 | GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }} 46 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/antonbabenko/pre-commit-terraform 3 | rev: v1.103.0 4 | hooks: 5 | - id: terraform_fmt 6 | - id: terraform_docs 7 | args: 8 | - '--args=--lockfile=false' 9 | - id: terraform_tflint 10 | args: 11 | - '--args=--only=terraform_deprecated_interpolation' 12 | - '--args=--only=terraform_deprecated_index' 13 | - '--args=--only=terraform_unused_declarations' 14 | - '--args=--only=terraform_comment_syntax' 15 | - '--args=--only=terraform_documented_outputs' 16 | - '--args=--only=terraform_documented_variables' 17 | - '--args=--only=terraform_typed_variables' 18 | - '--args=--only=terraform_module_pinned_source' 19 | - '--args=--only=terraform_naming_convention' 20 | - '--args=--only=terraform_required_version' 21 | - '--args=--only=terraform_required_providers' 22 | - '--args=--only=terraform_standard_module_structure' 23 | - '--args=--only=terraform_workspace_remote' 24 | - id: terraform_validate 25 | - repo: https://github.com/pre-commit/pre-commit-hooks 26 | rev: v6.0.0 27 | hooks: 28 | - id: check-merge-conflict 29 | - id: end-of-file-fixer 30 | - id: trailing-whitespace 31 | -------------------------------------------------------------------------------- /.github/workflows/stale-actions.yaml: -------------------------------------------------------------------------------- 1 | name: 'Mark or close stale issues and PRs' 2 | on: 3 | schedule: 4 | - cron: '0 0 * * *' 5 | 6 | jobs: 7 | stale: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/stale@v10 11 | with: 12 | repo-token: ${{ secrets.GITHUB_TOKEN }} 13 | # Staling issues and PR's 14 | days-before-stale: 30 15 | stale-issue-label: stale 16 | stale-pr-label: stale 17 | stale-issue-message: | 18 | This issue has been automatically marked as stale because it has been open 30 days 19 | with no activity. Remove stale label or comment or this issue will be closed in 10 days 20 | stale-pr-message: | 21 | This PR has been automatically marked as stale because it has been open 30 days 22 | with no activity. Remove stale label or comment or this PR will be closed in 10 days 23 | # Not stale if have this labels or part of milestone 24 | exempt-issue-labels: bug,wip,on-hold 25 | exempt-pr-labels: bug,wip,on-hold 26 | exempt-all-milestones: true 27 | # Close issue operations 28 | # Label will be automatically removed if the issues are no longer closed nor locked. 29 | days-before-close: 10 30 | delete-branch: true 31 | close-issue-message: This issue was automatically closed because of stale in 10 days 32 | close-pr-message: This PR was automatically closed because of stale in 10 days 33 | -------------------------------------------------------------------------------- /examples/complete/main.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | region = "eu-west-1" 3 | } 4 | 5 | module "cgw" { 6 | source = "../../" 7 | 8 | name = "test-cgw" 9 | 10 | customer_gateways = { 11 | IP1 = { 12 | bgp_asn = 65112 13 | ip_address = "49.33.1.162" 14 | }, 15 | IP2 = { 16 | bgp_asn = 65112 17 | ip_address = "85.38.42.93" 18 | } 19 | } 20 | 21 | tags = { 22 | Test = "maybe" 23 | } 24 | } 25 | 26 | module "vpc" { 27 | source = "terraform-aws-modules/vpc/aws" 28 | version = "~> 5.0" 29 | 30 | name = "complete" 31 | cidr = "10.10.0.0/16" 32 | 33 | azs = ["eu-west-1a", "eu-west-1b", "eu-west-1c"] 34 | private_subnets = var.vpc_private_subnets 35 | 36 | enable_nat_gateway = false 37 | enable_vpn_gateway = true 38 | 39 | tags = { 40 | Owner = "user" 41 | Name = "complete" 42 | } 43 | } 44 | 45 | module "vpn_gateway_1" { 46 | source = "terraform-aws-modules/vpn-gateway/aws" 47 | version = "~> 3.0" 48 | 49 | vpn_gateway_id = module.vpc.vgw_id 50 | customer_gateway_id = module.cgw.ids[0] 51 | 52 | vpc_id = module.vpc.vpc_id 53 | vpc_subnet_route_table_ids = module.vpc.private_route_table_ids 54 | vpc_subnet_route_table_count = length(var.vpc_private_subnets) 55 | } 56 | 57 | module "vpn_gateway_2" { 58 | source = "terraform-aws-modules/vpn-gateway/aws" 59 | version = "~> 3.0" 60 | 61 | vpn_gateway_id = module.vpc.vgw_id 62 | customer_gateway_id = module.cgw.ids[1] 63 | 64 | vpc_id = module.vpc.vpc_id 65 | vpc_subnet_route_table_ids = module.vpc.private_route_table_ids 66 | vpc_subnet_route_table_count = length(var.vpc_private_subnets) 67 | } 68 | 69 | # Disabled CGW 70 | module "disabled_cgw" { 71 | source = "../../" 72 | 73 | create = false 74 | } 75 | -------------------------------------------------------------------------------- /examples/complete/README.md: -------------------------------------------------------------------------------- 1 | # Complete Customer Gateway, VPC and VPN example 2 | 3 | Configuration in this directory creates 2 Customer Gateways, a VPC and 2 VPN connections between CGW and VPC. 4 | 5 | ## Usage 6 | 7 | To run this example you need to execute: 8 | 9 | ```bash 10 | $ terraform init 11 | $ terraform plan 12 | $ terraform apply 13 | ``` 14 | 15 | Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources. 16 | 17 | 18 | ## Requirements 19 | 20 | | Name | Version | 21 | |------|---------| 22 | | [terraform](#requirement\_terraform) | >= 1.0 | 23 | | [aws](#requirement\_aws) | >= 4.40 | 24 | 25 | ## Providers 26 | 27 | No providers. 28 | 29 | ## Modules 30 | 31 | | Name | Source | Version | 32 | |------|--------|---------| 33 | | [cgw](#module\_cgw) | ../../ | n/a | 34 | | [disabled\_cgw](#module\_disabled\_cgw) | ../../ | n/a | 35 | | [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 | 36 | | [vpn\_gateway\_1](#module\_vpn\_gateway\_1) | terraform-aws-modules/vpn-gateway/aws | ~> 3.0 | 37 | | [vpn\_gateway\_2](#module\_vpn\_gateway\_2) | terraform-aws-modules/vpn-gateway/aws | ~> 3.0 | 38 | 39 | ## Resources 40 | 41 | No resources. 42 | 43 | ## Inputs 44 | 45 | | Name | Description | Type | Default | Required | 46 | |------|-------------|------|---------|:--------:| 47 | | [vpc\_private\_subnets](#input\_vpc\_private\_subnets) | List of CIDR blocks of private subnets | `list(string)` |
[
"10.10.11.0/24",
"10.10.12.0/24",
"10.10.13.0/24"
]
| no | 48 | 49 | ## Outputs 50 | 51 | | Name | Description | 52 | |------|-------------| 53 | | [customer\_gateway](#output\_customer\_gateway) | Map of Customer Gateway attributes | 54 | | [ids](#output\_ids) | List of IDs of Customer Gateway | 55 | 56 | -------------------------------------------------------------------------------- /.github/workflows/pr-title.yml: -------------------------------------------------------------------------------- 1 | name: 'Validate PR title' 2 | 3 | on: 4 | pull_request_target: 5 | types: 6 | - opened 7 | - edited 8 | - synchronize 9 | 10 | jobs: 11 | main: 12 | name: Validate PR title 13 | runs-on: ubuntu-latest 14 | steps: 15 | # Please look up the latest version from 16 | # https://github.com/amannn/action-semantic-pull-request/releases 17 | - uses: amannn/action-semantic-pull-request@v6.1.1 18 | env: 19 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 20 | with: 21 | # Configure which types are allowed. 22 | # Default: https://github.com/commitizen/conventional-commit-types 23 | types: | 24 | fix 25 | feat 26 | docs 27 | ci 28 | chore 29 | # Configure that a scope must always be provided. 30 | requireScope: false 31 | # Configure additional validation for the subject based on a regex. 32 | # This example ensures the subject starts with an uppercase character. 33 | subjectPattern: ^[A-Z].+$ 34 | # If `subjectPattern` is configured, you can use this property to override 35 | # the default error message that is shown when the pattern doesn't match. 36 | # The variables `subject` and `title` can be used within the message. 37 | subjectPatternError: | 38 | The subject "{subject}" found in the pull request title "{title}" 39 | didn't match the configured pattern. Please ensure that the subject 40 | starts with an uppercase character. 41 | # For work-in-progress PRs you can typically use draft pull requests 42 | # from Github. However, private repositories on the free plan don't have 43 | # this option and therefore this action allows you to opt-in to using the 44 | # special "[WIP]" prefix to indicate this state. This will avoid the 45 | # validation of the PR title and the pull request checks remain pending. 46 | # Note that a second check will be reported if this is enabled. 47 | wip: true 48 | # When using "Squash and merge" on a PR with only one commit, GitHub 49 | # will suggest using that commit message instead of the PR title for the 50 | # merge commit, and it's easy to commit this by mistake. Enable this option 51 | # to also validate the commit message for one commit PRs. 52 | validateSingleCommit: false 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AWS Customer Gateway Terraform module 2 | 3 | Terraform module which creates AWS Customer Gateway resources on AWS. 4 | 5 | This module has been extracted from the [VPC](https://github.com/terraform-aws-modules/terraform-aws-vpc) module, because sometimes it makes sense to reuse Customer Gateways across multiple VPC resources. Check out other related modules - [VPC](https://github.com/terraform-aws-modules/terraform-aws-vpc), [VPN Gateway](https://github.com/terraform-aws-modules/terraform-aws-vpn-gateway) and [Transit Gateway](https://github.com/terraform-aws-modules/terraform-aws-transit-gateway) for more details. 6 | 7 | ## Usage 8 | 9 | ```hcl 10 | module "cgw" { 11 | source = "terraform-aws-modules/customer-gateway/aws" 12 | version = "~> 1.0" 13 | 14 | name = "test-cgw" 15 | 16 | customer_gateways = { 17 | IP1 = { 18 | bgp_asn = 65112 19 | ip_address = "49.33.1.162" 20 | }, 21 | IP2 = { 22 | bgp_asn = 65112 23 | ip_address = "85.38.42.93" 24 | } 25 | } 26 | 27 | tags = { 28 | Test = "maybe" 29 | } 30 | } 31 | ``` 32 | 33 | ## Examples 34 | 35 | - [Complete example](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/tree/master/examples/complete) creates 2 Customer Gateways, a VPC and creates 2 VPN connections between them. 36 | 37 | ## Conditional creation 38 | 39 | Sometimes you need to have a way to create Customer Gateway conditionally but Terraform does not allow to use `count` inside `module` block, so the solution is to specify argument `create`. 40 | 41 | ```hcl 42 | # This CGW will not be created 43 | module "cgw" { 44 | source = "terraform-aws-modules/customer-gateway/aws" 45 | version = "~> 1.0" 46 | 47 | create = false 48 | # ... omitted 49 | } 50 | ``` 51 | 52 | 53 | ## Requirements 54 | 55 | | Name | Version | 56 | |------|---------| 57 | | [terraform](#requirement\_terraform) | >= 1.0 | 58 | | [aws](#requirement\_aws) | >= 4.40 | 59 | 60 | ## Providers 61 | 62 | | Name | Version | 63 | |------|---------| 64 | | [aws](#provider\_aws) | >= 4.40 | 65 | 66 | ## Modules 67 | 68 | No modules. 69 | 70 | ## Resources 71 | 72 | | Name | Type | 73 | |------|------| 74 | | [aws_customer_gateway.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/customer_gateway) | resource | 75 | 76 | ## Inputs 77 | 78 | | Name | Description | Type | Default | Required | 79 | |------|-------------|------|---------|:--------:| 80 | | [create](#input\_create) | Whether to create Customer Gateway resources | `bool` | `true` | no | 81 | | [customer\_gateways](#input\_customer\_gateways) | Maps of Customer Gateway's attributes (BGP ASN and Gateway's Internet-routable external IP address) | `map(map(any))` | `{}` | no | 82 | | [name](#input\_name) | Name to be used on all the resources as identifier | `string` | `""` | no | 83 | | [tags](#input\_tags) | A mapping of tags to assign to all resources | `map(string)` | `{}` | no | 84 | 85 | ## Outputs 86 | 87 | | Name | Description | 88 | |------|-------------| 89 | | [customer\_gateway](#output\_customer\_gateway) | Map of Customer Gateway attributes | 90 | | [ids](#output\_ids) | List of IDs of Customer Gateway | 91 | 92 | 93 | ## Authors 94 | 95 | Module is maintained by [Anton Babenko](https://github.com/antonbabenko) with help from [these awesome contributors](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/graphs/contributors). 96 | 97 | ## License 98 | 99 | Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/tree/master/LICENSE) for full details. 100 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | ## [3.1.1](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/compare/v3.1.0...v3.1.1) (2025-10-21) 6 | 7 | ### Bug Fixes 8 | 9 | * Update CI workflow versions to latest ([#25](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/25)) ([2714a3e](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/commit/2714a3eec2156053f914d8150ba789704614e9b7)) 10 | 11 | ## [3.1.0](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/compare/v3.0.1...v3.1.0) (2025-03-05) 12 | 13 | 14 | ### Features 15 | 16 | * Adjust optional params for the aws_customer_gateway, add device_name and certificate_arn ([#23](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/23)) ([2f8bb07](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/commit/2f8bb07c8d432b3f5a868901b69c2d895de4c3ca)) 17 | 18 | 19 | ### Bug Fixes 20 | 21 | * Update CI workflow versions to latest ([#24](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/24)) ([5b8693c](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/commit/5b8693c347b9debc97fbb19beecdcda6f61fb697)) 22 | 23 | ## [3.0.1](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/compare/v3.0.0...v3.0.1) (2024-03-07) 24 | 25 | 26 | ### Bug Fixes 27 | 28 | * Update CI workflow versions to remove deprecated runtime warnings ([#22](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/22)) ([11cd7ab](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/commit/11cd7ab0118d1df8c289962f0eae4a45763209a0)) 29 | 30 | ## [3.0.0](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/compare/v2.0.1...v3.0.0) (2022-10-27) 31 | 32 | 33 | ### ⚠ BREAKING CHANGES 34 | 35 | * Update supported Terraform min version to v1.0+ and AWS provider to v4.0+ (#20) 36 | 37 | ### Features 38 | 39 | * Update supported Terraform min version to v1.0+ and AWS provider to v4.0+ ([#20](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/20)) ([eb5d882](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/commit/eb5d8823dcc2c87181bcc0d885619aba10d77058)) 40 | 41 | ### [2.0.1](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/compare/v2.0.0...v2.0.1) (2022-01-10) 42 | 43 | 44 | ### Bug Fixes 45 | 46 | * update CI/CD process to enable auto-release workflow ([#16](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/16)) ([a2e806f](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/commit/a2e806f4bc64fd1af15351e645b02a1dff280ca4)) 47 | 48 | 49 | ## [v2.0.0] - 2021-04-27 50 | 51 | - feat: Shorten outputs (removing this_) ([#14](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/14)) 52 | - chore: update documentation and pin `terraform_docs` version to avoid future changes ([#13](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/13)) 53 | 54 | 55 | 56 | ## [v1.3.0] - 2021-03-17 57 | 58 | - chore: align ci-cd static checks to use individual minimum Terraform versions ([#12](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/12)) 59 | - fix: bump min supported version due to types unsupported on current ([#11](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/11)) 60 | - chore: add ci-cd workflow for pre-commit checks ([#10](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/10)) 61 | 62 | 63 | 64 | ## [v1.2.0] - 2020-11-24 65 | 66 | - fix: Updated supported Terraform versions ([#8](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/8)) 67 | 68 | 69 | 70 | ## [v1.1.0] - 2020-08-14 71 | 72 | - feat: Updated version requirements for AWS provider v3 and Terraform 0.13 73 | - Merge pull request [#6](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/6) from terraform-aws-modules/terraform-provider-githubfile-1584635124957994000 74 | - [ci skip] Create ".chglog/CHANGELOG.tpl.md". 75 | - Merge pull request [#3](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/3) from terraform-aws-modules/terraform-provider-githubfile-1584535944228379000 76 | - Merge pull request [#2](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/2) from terraform-aws-modules/terraform-provider-githubfile-1584535944228361000 77 | - Merge pull request [#5](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/5) from terraform-aws-modules/terraform-provider-githubfile-1584535944227758000 78 | - Merge pull request [#4](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/4) from terraform-aws-modules/terraform-provider-githubfile-1584535944227241000 79 | - Merge pull request [#1](https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/issues/1) from terraform-aws-modules/terraform-provider-githubfile-1584535944227138000 80 | - [ci skip] Create ".pre-commit-config.yaml". 81 | - [ci skip] Create "Makefile". 82 | - [ci skip] Create ".editorconfig". 83 | - [ci skip] Create "LICENSE". 84 | - [ci skip] Create ".gitignore". 85 | 86 | 87 | 88 | ## [v1.0.0] - 2020-01-27 89 | 90 | - Initial commit 91 | - Initial commit 92 | - Initial commit 93 | 94 | 95 | 96 | ## v0.0.1 - 2017-09-26 97 | 98 | - Initial commit 99 | - Initial commit 100 | 101 | 102 | [Unreleased]: https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/compare/v2.0.0...HEAD 103 | [v2.0.0]: https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/compare/v1.3.0...v2.0.0 104 | [v1.3.0]: https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/compare/v1.2.0...v1.3.0 105 | [v1.2.0]: https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/compare/v1.1.0...v1.2.0 106 | [v1.1.0]: https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/compare/v1.0.0...v1.1.0 107 | [v1.0.0]: https://github.com/terraform-aws-modules/terraform-aws-customer-gateway/compare/v0.0.1...v1.0.0 108 | -------------------------------------------------------------------------------- /.github/workflows/pre-commit.yml: -------------------------------------------------------------------------------- 1 | name: Pre-Commit 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - main 7 | - master 8 | 9 | env: 10 | TERRAFORM_DOCS_VERSION: v0.20.0 11 | TFLINT_VERSION: v0.59.1 12 | 13 | jobs: 14 | collectInputs: 15 | name: Collect workflow inputs 16 | runs-on: ubuntu-latest 17 | outputs: 18 | directories: ${{ steps.dirs.outputs.directories }} 19 | steps: 20 | - name: Checkout 21 | uses: actions/checkout@v5 22 | 23 | - name: Get root directories 24 | id: dirs 25 | uses: clowdhaus/terraform-composite-actions/directories@v1.14.0 26 | 27 | preCommitMinVersions: 28 | name: Min TF pre-commit 29 | needs: collectInputs 30 | runs-on: ubuntu-latest 31 | strategy: 32 | matrix: 33 | directory: ${{ fromJson(needs.collectInputs.outputs.directories) }} 34 | steps: 35 | - name: Install rmz 36 | uses: jaxxstorm/action-install-gh-release@v2.1.0 37 | with: 38 | repo: SUPERCILEX/fuc 39 | asset-name: x86_64-unknown-linux-gnu-rmz 40 | rename-to: rmz 41 | chmod: 0755 42 | extension-matching: disable 43 | 44 | # https://github.com/orgs/community/discussions/25678#discussioncomment-5242449 45 | - name: Delete unnecessary files 46 | run: | 47 | formatByteCount() { echo $(numfmt --to=iec-i --suffix=B --padding=7 $1'000'); } 48 | getAvailableSpace() { echo $(df -a $1 | awk 'NR > 1 {avail+=$4} END {print avail}'); } 49 | 50 | BEFORE=$(getAvailableSpace) 51 | 52 | ln -s /opt/hostedtoolcache/SUPERCILEX/x86_64-unknown-linux-gnu-rmz/latest/linux-x64/rmz /usr/local/bin/rmz 53 | rmz -f /opt/hostedtoolcache/CodeQL & 54 | rmz -f /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk & 55 | rmz -f /opt/hostedtoolcache/PyPy & 56 | rmz -f /opt/hostedtoolcache/Ruby & 57 | rmz -f /opt/hostedtoolcache/go & 58 | 59 | wait 60 | 61 | AFTER=$(getAvailableSpace) 62 | SAVED=$((AFTER-BEFORE)) 63 | echo "=> Saved $(formatByteCount $SAVED)" 64 | 65 | - name: Checkout 66 | uses: actions/checkout@v5 67 | 68 | - name: Terraform min/max versions 69 | id: minMax 70 | uses: clowdhaus/terraform-min-max@v2.1.0 71 | with: 72 | directory: ${{ matrix.directory }} 73 | 74 | - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} 75 | # Run only validate pre-commit check on min version supported 76 | if: ${{ matrix.directory != '.' }} 77 | uses: clowdhaus/terraform-composite-actions/pre-commit@v1.14.0 78 | with: 79 | terraform-version: ${{ steps.minMax.outputs.minVersion }} 80 | tflint-version: ${{ env.TFLINT_VERSION }} 81 | args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*' 82 | 83 | - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} 84 | # Run only validate pre-commit check on min version supported 85 | if: ${{ matrix.directory == '.' }} 86 | uses: clowdhaus/terraform-composite-actions/pre-commit@v1.14.0 87 | with: 88 | terraform-version: ${{ steps.minMax.outputs.minVersion }} 89 | tflint-version: ${{ env.TFLINT_VERSION }} 90 | args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)' 91 | 92 | preCommitMaxVersion: 93 | name: Max TF pre-commit 94 | runs-on: ubuntu-latest 95 | needs: collectInputs 96 | steps: 97 | - name: Install rmz 98 | uses: jaxxstorm/action-install-gh-release@v2.1.0 99 | with: 100 | repo: SUPERCILEX/fuc 101 | asset-name: x86_64-unknown-linux-gnu-rmz 102 | rename-to: rmz 103 | chmod: 0755 104 | extension-matching: disable 105 | 106 | # https://github.com/orgs/community/discussions/25678#discussioncomment-5242449 107 | - name: Delete unnecessary files 108 | run: | 109 | formatByteCount() { echo $(numfmt --to=iec-i --suffix=B --padding=7 $1'000'); } 110 | getAvailableSpace() { echo $(df -a $1 | awk 'NR > 1 {avail+=$4} END {print avail}'); } 111 | 112 | BEFORE=$(getAvailableSpace) 113 | 114 | ln -s /opt/hostedtoolcache/SUPERCILEX/x86_64-unknown-linux-gnu-rmz/latest/linux-x64/rmz /usr/local/bin/rmz 115 | rmz -f /opt/hostedtoolcache/CodeQL & 116 | rmz -f /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk & 117 | rmz -f /opt/hostedtoolcache/PyPy & 118 | rmz -f /opt/hostedtoolcache/Ruby & 119 | rmz -f /opt/hostedtoolcache/go & 120 | sudo rmz -f /usr/local/lib/android & 121 | 122 | if [[ ${{ github.repository }} == terraform-aws-modules/terraform-aws-security-group ]]; then 123 | sudo rmz -f /usr/share/dotnet & 124 | sudo rmz -f /usr/local/.ghcup & 125 | sudo apt-get -qq remove -y 'azure-.*' 126 | sudo apt-get -qq remove -y 'cpp-.*' 127 | sudo apt-get -qq remove -y 'dotnet-runtime-.*' 128 | sudo apt-get -qq remove -y 'google-.*' 129 | sudo apt-get -qq remove -y 'libclang-.*' 130 | sudo apt-get -qq remove -y 'libllvm.*' 131 | sudo apt-get -qq remove -y 'llvm-.*' 132 | sudo apt-get -qq remove -y 'mysql-.*' 133 | sudo apt-get -qq remove -y 'postgresql-.*' 134 | sudo apt-get -qq remove -y 'php.*' 135 | sudo apt-get -qq remove -y 'temurin-.*' 136 | sudo apt-get -qq remove -y kubectl firefox mono-devel 137 | sudo apt-get -qq autoremove -y 138 | sudo apt-get -qq clean 139 | fi 140 | 141 | wait 142 | 143 | AFTER=$(getAvailableSpace) 144 | SAVED=$((AFTER-BEFORE)) 145 | echo "=> Saved $(formatByteCount $SAVED)" 146 | 147 | - name: Checkout 148 | uses: actions/checkout@v5 149 | with: 150 | ref: ${{ github.event.pull_request.head.ref }} 151 | repository: ${{github.event.pull_request.head.repo.full_name}} 152 | 153 | - name: Terraform min/max versions 154 | id: minMax 155 | uses: clowdhaus/terraform-min-max@v2.1.0 156 | 157 | - name: Hide template dir 158 | # Special to this repo, we don't want to check this dir 159 | if: ${{ github.repository == 'terraform-aws-modules/terraform-aws-security-group' }} 160 | run: rm -rf modules/_templates 161 | 162 | - name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }} 163 | uses: clowdhaus/terraform-composite-actions/pre-commit@v1.14.0 164 | with: 165 | terraform-version: ${{ steps.minMax.outputs.maxVersion }} 166 | tflint-version: ${{ env.TFLINT_VERSION }} 167 | terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }} 168 | install-hcledit: true 169 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | --------------------------------------------------------------------------------