diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7bc5f23..a2039d7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: check-added-large-files args: ['--maxkb=500'] @@ -17,7 +17,7 @@ repos: args: ['--allow-missing-credentials'] - id: trailing-whitespace - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.81.0 + rev: v1.100.0 hooks: - id: terraform_fmt - id: terraform_docs diff --git a/CHANGELOG.md b/CHANGELOG.md index 97fb90e..702f3eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,18 @@ All notable changes to this project will be documented in this file. + +## [2.6.1] - 2023-08-07 + +- Fixes README example to use public_subnets ([#25](https://github.com/umotif-public/terraform-aws-bastion/issues/25)) + + + +## [2.6.0] - 2023-07-19 + +- Added new ebs features ([#24](https://github.com/umotif-public/terraform-aws-bastion/issues/24)) + + ## [2.5.0] - 2023-07-17 @@ -155,7 +167,9 @@ All notable changes to this project will be documented in this file. - Initial commit -[Unreleased]: https://github.com/umotif-public/terraform-aws-bastion/compare/2.5.0...HEAD +[Unreleased]: https://github.com/umotif-public/terraform-aws-bastion/compare/2.6.1...HEAD +[2.6.1]: https://github.com/umotif-public/terraform-aws-bastion/compare/2.6.0...2.6.1 +[2.6.0]: https://github.com/umotif-public/terraform-aws-bastion/compare/2.5.0...2.6.0 [2.5.0]: https://github.com/umotif-public/terraform-aws-bastion/compare/2.4.3...2.5.0 [2.4.3]: https://github.com/umotif-public/terraform-aws-bastion/compare/2.4.2...2.4.3 [2.4.2]: https://github.com/umotif-public/terraform-aws-bastion/compare/2.4.1...2.4.2 diff --git a/README.md b/README.md index 1a5e9cd..9bb5e09 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ module "bastion" { Module managed by [uMotif](https://github.com/umotif-public). - + ## Requirements | Name | Version | @@ -93,17 +93,17 @@ No modules. | [asg\_scale\_up\_max\_size](#input\_asg\_scale\_up\_max\_size) | Auto Scalling Group value for maximum capacity of bastion hosts. Scale up action. | `number` | `1` | no | | [asg\_scale\_up\_min\_size](#input\_asg\_scale\_up\_min\_size) | Auto Scalling Group value for minimum capacity of bastion hosts. Scale up action. | `number` | `1` | no | | [asg\_scale\_up\_recurrence](#input\_asg\_scale\_up\_recurrence) | The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format. Scale up action. | `string` | `"0 9 * * MON-FRI"` | no | -| [bastion\_instance\_types](#input\_bastion\_instance\_types) | Bastion instance types used for spot instances. | `list(string)` |
[
"t4g.nano",
"t4g.micro",
"t4g.small"
]
| no | -| [block\_device\_mappings](#input\_block\_device\_mappings) | Specify volumes to attach to the instance besides the volumes specified by the AMI |
list(object({
device_name = string
no_device = optional(string)
virtual_name = optional(string)
ebs = optional(object({
delete_on_termination = optional(bool, true)
encrypted = optional(bool, true)
iops = optional(number)
kms_key_id = optional(string)
snapshot_id = optional(string)
volume_size = optional(number)
volume_type = optional(string)
throughput = optional(number)
}))
}))
| `[]` | no | +| [bastion\_instance\_types](#input\_bastion\_instance\_types) | Bastion instance types used for spot instances. | `list(string)` |
[
"t4g.nano",
"t4g.micro",
"t4g.small"
]
| no | +| [block\_device\_mappings](#input\_block\_device\_mappings) | Specify volumes to attach to the instance besides the volumes specified by the AMI |
list(object({
device_name = string
no_device = optional(string)
virtual_name = optional(string)
ebs = optional(object({
delete_on_termination = optional(bool, true)
encrypted = optional(bool, true)
iops = optional(number)
kms_key_id = optional(string)
snapshot_id = optional(string)
volume_size = optional(number)
volume_type = optional(string)
throughput = optional(number)
}))
}))
| `[]` | no | | [desired\_capacity](#input\_desired\_capacity) | Auto Scalling Group value for desired capacity of bastion hosts. | `number` | `1` | no | | [ebs\_optimized](#input\_ebs\_optimized) | If true, the launched EC2 instance will be EBS-optimized | `bool` | `null` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of CIDR ranges to allow outbound traffic at security group level. Defaults to 0.0.0.0/0 | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to allow outbound traffic at security group level. Defaults to ::/0 | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of CIDR ranges to allow outbound traffic at security group level. Defaults to 0.0.0.0/0 | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to allow outbound traffic at security group level. Defaults to ::/0 | `list(string)` |
[
"::/0"
]
| no | | [enable\_asg\_scale\_down](#input\_enable\_asg\_scale\_down) | n/a | `bool` | `false` | no | | [enable\_asg\_scale\_up](#input\_enable\_asg\_scale\_up) | n/a | `bool` | `false` | no | | [hosted\_zone\_id](#input\_hosted\_zone\_id) | Hosted zone id where A record will be added for bastion host/s. | `string` | `""` | no | -| [ingress\_cidr\_blocks](#input\_ingress\_cidr\_blocks) | List of CIDR ranges to allow ssh access at security group level. Defaults to 0.0.0.0/0 | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [ingress\_ipv6\_cidr\_blocks](#input\_ingress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to allow ssh access at security group level. Defaults to ::/0 | `list(string)` |
[
"::/0"
]
| no | +| [ingress\_cidr\_blocks](#input\_ingress\_cidr\_blocks) | List of CIDR ranges to allow ssh access at security group level. Defaults to 0.0.0.0/0 | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [ingress\_ipv6\_cidr\_blocks](#input\_ingress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to allow ssh access at security group level. Defaults to ::/0 | `list(string)` |
[
"::/0"
]
| no | | [max\_size](#input\_max\_size) | Auto Scalling Group value for maximum capacity of bastion hosts. | `number` | `1` | no | | [min\_size](#input\_min\_size) | Auto Scalling Group value for minimum capacity of bastion hosts. | `number` | `1` | no | | [name\_prefix](#input\_name\_prefix) | A prefix used for naming resources. | `string` | n/a | yes | @@ -111,9 +111,9 @@ No modules. | [public\_subnets](#input\_public\_subnets) | Classless Inter-Domain Routing ranges for public subnets. | `list(string)` | n/a | yes | | [ssh\_key\_name](#input\_ssh\_key\_name) | SSH key used to connect to the bastion host | `string` | n/a | yes | | [ssh\_port](#input\_ssh\_port) | SSH port used to access a bastion host. | `number` | `22` | no | -| [tag\_specifications](#input\_tag\_specifications) | The tags to apply to the resources during launch. You can tag instances, volumes, elastic GPUs and spot instance requests. | `list(string)` |
[
"instance",
"volume",
"network-interface",
"spot-instances-request"
]
| no | -| [tags](#input\_tags) | Default tags attached to all resources. | `map(string)` |
{
"ServiceType": "ceng-eks"
}
| no | -| [termination\_policies](#input\_termination\_policies) | A list of policies to decide how the instances in the auto scale group should be terminated. The allowed values are OldestInstance, NewestInstance, OldestLaunchConfiguration, ClosestToNextInstanceHour, OldestLaunchTemplate, AllocationStrategy. | `list(string)` |
[
"OldestInstance"
]
| no | +| [tag\_specifications](#input\_tag\_specifications) | The tags to apply to the resources during launch. You can tag instances, volumes, elastic GPUs and spot instance requests. | `list(string)` |
[
"instance",
"volume",
"network-interface",
"spot-instances-request"
]
| no | +| [tags](#input\_tags) | Default tags attached to all resources. | `map(string)` |
{
"ServiceType": "ceng-eks"
}
| no | +| [termination\_policies](#input\_termination\_policies) | A list of policies to decide how the instances in the auto scale group should be terminated. The allowed values are OldestInstance, NewestInstance, OldestLaunchConfiguration, ClosestToNextInstanceHour, OldestLaunchTemplate, AllocationStrategy. | `list(string)` |
[
"OldestInstance"
]
| no | | [time\_zone](#input\_time\_zone) | Used for ASG Scale Up/Down. Valid values are the canonical names of the IANA time zones (such as Etc/GMT+9 or London/Europe) | `string` | `"Etc/UTC"` | no | | [userdata\_file\_content](#input\_userdata\_file\_content) | The user data to provide when launching the instance. | `string` | `""` | no | | [vpc\_id](#input\_vpc\_id) | VPC ID where bastion hosts and security groups will be created. | `string` | n/a | yes | @@ -130,7 +130,7 @@ No modules. | [launch\_template\_arn](#output\_launch\_template\_arn) | The ARN of the bastion's launch template. | | [launch\_template\_id](#output\_launch\_template\_id) | The ID of the bastion's launch template. | | [security\_group\_id](#output\_security\_group\_id) | The ID of the bastion's security group. | - + ## License diff --git a/examples/core/main.tf b/examples/core/main.tf index 010a78f..f4f1455 100644 --- a/examples/core/main.tf +++ b/examples/core/main.tf @@ -33,9 +33,17 @@ module "bastion" { enable_asg_scale_down = true enable_asg_scale_up = true - delete_on_termination = true - volume_size = 10 - encrypted = true + block_device_mappings = [ + { + device_name = "/dev/xvda" + ebs = { + delete_on_termination = true + volume_size = 10 + encrypted = true + volume_type = "gp3" + } + } + ] userdata_file_content = templatefile("./custom-userdata.sh", {}) # if you want to use default one, simply remove this line diff --git a/examples/core/versions.tf b/examples/core/versions.tf index 39a09b8..94f9deb 100644 --- a/examples/core/versions.tf +++ b/examples/core/versions.tf @@ -1,10 +1,10 @@ terraform { - required_version = ">= 1.3.0" + required_version = ">= 1.12.0" required_providers { aws = { source = "hashicorp/aws" - version = "~> 5" + version = "~> 6" } } }