diff --git a/README.md b/README.md
index 0ea992c..0b36ef9 100644
--- a/README.md
+++ b/README.md
@@ -142,6 +142,7 @@ Available targets:
| [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by the `delimiter`
and treated as a single ID element. | `list(string)` | `[]` | no |
| [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. | `any` |
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
}
| no |
| [customer\_gateway\_bgp\_asn](#input\_customer\_gateway\_bgp\_asn) | The Customer Gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN) | `number` | `65000` | no |
+| [customer\_gateway\_device\_name](#input\_customer\_gateway\_device\_name) | The Device Name of the Customer Gateway | `string` | `null` | no |
| [customer\_gateway\_ip\_address](#input\_customer\_gateway\_ip\_address) | The IP address of the Customer Gateway's Internet-routable external interface. Set to `null` to not create the Customer Gateway | `string` | `null` | no |
| [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
| [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.
Map of maps. Keys are names of descriptors. Values are maps of the form
`{
format = string
labels = list(string)
}`
(Type is `any` so the map values can later be enhanced to provide additional options.)
`format` is a Terraform format string to be passed to the `format()` function.
`labels` is a list of labels, in order, to pass to `format()` function.
Label values will be normalized before being passed to `format()` so they will be
identical to how they appear in `id`.
Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
diff --git a/docs/terraform.md b/docs/terraform.md
index d0ad0ad..e27dcc2 100644
--- a/docs/terraform.md
+++ b/docs/terraform.md
@@ -41,6 +41,7 @@
| [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by the `delimiter`
and treated as a single ID element. | `list(string)` | `[]` | no |
| [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | {
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
}
| no |
| [customer\_gateway\_bgp\_asn](#input\_customer\_gateway\_bgp\_asn) | The Customer Gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN) | `number` | `65000` | no |
+| [customer\_gateway\_device\_name](#input\_customer\_gateway\_device\_name) | The Device Name of the Customer Gateway | `string` | `null` | no |
| [customer\_gateway\_ip\_address](#input\_customer\_gateway\_ip\_address) | The IP address of the Customer Gateway's Internet-routable external interface. Set to `null` to not create the Customer Gateway | `string` | `null` | no |
| [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
| [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.
Map of maps. Keys are names of descriptors. Values are maps of the form
`{
format = string
labels = list(string)
}`
(Type is `any` so the map values can later be enhanced to provide additional options.)
`format` is a Terraform format string to be passed to the `format()` function.
`labels` is a list of labels, in order, to pass to `format()` function.
Label values will be normalized before being passed to `format()` so they will be
identical to how they appear in `id`.
Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
diff --git a/main.tf b/main.tf
index e793d5c..2327ac4 100644
--- a/main.tf
+++ b/main.tf
@@ -21,7 +21,7 @@ resource "aws_vpn_gateway" "default" {
# https://www.terraform.io/docs/providers/aws/r/customer_gateway.html
resource "aws_customer_gateway" "default" {
count = local.enabled && var.customer_gateway_ip_address != null ? 1 : 0
- device_name = module.this.id
+ device_name = var.customer_gateway_device_name == "" ? module.this.id : var.customer_gateway_device_name
bgp_asn = var.customer_gateway_bgp_asn <= 2147483647 ? var.customer_gateway_bgp_asn : null
bgp_asn_extended = var.customer_gateway_bgp_asn > 2147483647 ? var.customer_gateway_bgp_asn : null
ip_address = var.customer_gateway_ip_address
diff --git a/variables.tf b/variables.tf
index eff44dd..602a3a6 100644
--- a/variables.tf
+++ b/variables.tf
@@ -11,6 +11,12 @@ variable "vpn_gateway_amazon_side_asn" {
nullable = false
}
+variable "customer_gateway_device_name" {
+ type = string
+ description = "The Device Name of the Customer Gateway"
+ default = ""
+}
+
variable "customer_gateway_bgp_asn" {
type = number
description = "The Customer Gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN)"