Skip to content

Commit 6c79a2d

Browse files
committed
feat: Bump versions, add missing arguments and variable type definitions
1 parent 8dc85b9 commit 6c79a2d

File tree

12 files changed

+590
-155
lines changed

12 files changed

+590
-155
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.96.2
3+
rev: v1.99.4
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_docs

README.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ module "batch" {
2424
security_group_ids = ["sg-f1d03a88"]
2525
subnets = ["subnet-30ef7b3c", "subnet-1ecda77b", "subnet-ca09ddbc"]
2626
27-
# Note - any tag changes here will force compute environment replacement
28-
# which can lead to job queue conflicts. Only specify tags that will be static
29-
# for the lifetime of the compute environment
3027
tags = {
3128
# This will set the name on the Ec2 instances launched by this compute environment
3229
Name = "example"
@@ -51,9 +48,6 @@ module "batch" {
5148
security_group_ids = ["sg-f1d03a88"]
5249
subnets = ["subnet-30ef7b3c", "subnet-1ecda77b", "subnet-ca09ddbc"]
5350
54-
# Note - any tag changes here will force compute environment replacement
55-
# which can lead to job queue conflicts. Only specify tags that will be static
56-
# for the lifetime of the compute environment
5751
tags = {
5852
# This will set the name on the Ec2 instances launched by this compute environment
5953
Name = "example-spot"
@@ -70,7 +64,14 @@ module "batch" {
7064
state = "ENABLED"
7165
priority = 1
7266
73-
compute_environments = ["b_ec2_spot"]
67+
compute_environment_order = {
68+
0 = {
69+
compute_environment_key = "b_ec2_spot"
70+
}
71+
1 = {
72+
compute_environment_key = "a_ec2"
73+
}
74+
}
7475
7576
tags = {
7677
JobQueue = "Low priority job queue"
@@ -82,6 +83,12 @@ module "batch" {
8283
state = "ENABLED"
8384
priority = 99
8485
86+
compute_environment_order = {
87+
0 = {
88+
compute_environment_key = "a_ec2"
89+
}
90+
}
91+
8592
fair_share_policy = {
8693
compute_reservation = 1
8794
share_decay_seconds = 3600
@@ -163,14 +170,14 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
163170

164171
| Name | Version |
165172
|------|---------|
166-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
167-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.78 |
173+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.10 |
174+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.0 |
168175

169176
## Providers
170177

171178
| Name | Version |
172179
|------|---------|
173-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.78 |
180+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.0 |
174181

175182
## Modules
176183

@@ -200,10 +207,9 @@ No modules.
200207

201208
| Name | Description | Type | Default | Required |
202209
|------|-------------|------|---------|:--------:|
203-
| <a name="input_compute_environments"></a> [compute\_environments](#input\_compute\_environments) | Map of compute environment definitions to create | `any` | `{}` | no |
210+
| <a name="input_compute_environments"></a> [compute\_environments](#input\_compute\_environments) | Map of compute environment definitions to create | <pre>map(object({<br/> name = optional(string)<br/> name_prefix = optional(string)<br/> compute_resources = optional(object({<br/> allocation_strategy = optional(string)<br/> bid_percentage = optional(number)<br/> desired_vcpus = optional(number)<br/> ec2_configuration = optional(list(object({<br/> image_id_override = optional(string)<br/> image_type = optional(string)<br/> })))<br/> ec2_key_pair = optional(string)<br/> instance_role = optional(string)<br/> instance_types = optional(list(string))<br/> launch_template = optional(object({<br/> launch_template_id = optional(string)<br/> launch_template_name = optional(string)<br/> version = optional(string)<br/> }))<br/> max_vcpus = number<br/> min_vcpus = optional(number)<br/> placement_group = optional(string)<br/> security_group_ids = optional(list(string))<br/> spot_iam_fleet_role = optional(string)<br/> subnets = list(string)<br/> tags = optional(map(string), {})<br/> type = string<br/> }))<br/> eks_configuration = optional(object({<br/> eks_cluster_arn = string<br/> kubernetes_namespace = string<br/> }))<br/> service_role = optional(string)<br/> state = optional(string)<br/> tags = optional(map(string), {})<br/> type = optional(string, "MANAGED")<br/> update_policy = optional(object({<br/> job_execution_timeout_minutes = number<br/> terminate_jobs_on_update = optional(bool, false)<br/> }))<br/> }))</pre> | `null` | no |
204211
| <a name="input_create"></a> [create](#input\_create) | Controls if resources should be created (affects nearly all resources) | `bool` | `true` | no |
205212
| <a name="input_create_instance_iam_role"></a> [create\_instance\_iam\_role](#input\_create\_instance\_iam\_role) | Determines whether a an IAM role is created or to use an existing IAM role | `bool` | `true` | no |
206-
| <a name="input_create_job_definitions"></a> [create\_job\_definitions](#input\_create\_job\_definitions) | Determines whether to create the job definitions defined | `bool` | `true` | no |
207213
| <a name="input_create_job_queues"></a> [create\_job\_queues](#input\_create\_job\_queues) | Determines whether to create job queues | `bool` | `true` | no |
208214
| <a name="input_create_service_iam_role"></a> [create\_service\_iam\_role](#input\_create\_service\_iam\_role) | Determines whether a an IAM role is created or to use an existing IAM role | `bool` | `true` | no |
209215
| <a name="input_create_spot_fleet_iam_role"></a> [create\_spot\_fleet\_iam\_role](#input\_create\_spot\_fleet\_iam\_role) | Determines whether a an IAM role is created or to use an existing IAM role | `bool` | `false` | no |
@@ -214,8 +220,8 @@ No modules.
214220
| <a name="input_instance_iam_role_permissions_boundary"></a> [instance\_iam\_role\_permissions\_boundary](#input\_instance\_iam\_role\_permissions\_boundary) | ARN of the policy that is used to set the permissions boundary for the IAM role | `string` | `null` | no |
215221
| <a name="input_instance_iam_role_tags"></a> [instance\_iam\_role\_tags](#input\_instance\_iam\_role\_tags) | A map of additional tags to add to the IAM role created | `map(string)` | `{}` | no |
216222
| <a name="input_instance_iam_role_use_name_prefix"></a> [instance\_iam\_role\_use\_name\_prefix](#input\_instance\_iam\_role\_use\_name\_prefix) | Determines whether the IAM role name (`instance_iam_role_name`) is used as a prefix | `string` | `true` | no |
217-
| <a name="input_job_definitions"></a> [job\_definitions](#input\_job\_definitions) | Map of job definitions to create | `any` | `{}` | no |
218-
| <a name="input_job_queues"></a> [job\_queues](#input\_job\_queues) | Map of job queue and scheduling policy defintions to create | `any` | `{}` | no |
223+
| <a name="input_job_definitions"></a> [job\_definitions](#input\_job\_definitions) | Map of job definitions to create | <pre>map(object({<br/> container_properties = optional(string)<br/> deregister_on_new_revision = optional(bool)<br/> ecs_properties = optional(string)<br/> eks_properties = optional(object({<br/> pod_properties = object({<br/> containers = map(object({<br/> args = optional(list(string))<br/> command = optional(list(string))<br/> env = optional(map(string))<br/> image = string<br/> image_pull_policy = optional(string)<br/> name = optional(string) # Will fall back to use map key as container name<br/> resources = object({<br/> limits = optional(map(string))<br/> requests = optional(map(string))<br/> })<br/> security_context = optional(object({<br/> privileged = optional(bool)<br/> read_only_root_file_system = optional(bool)<br/> run_as_group = optional(number)<br/> run_as_non_root = optional(bool)<br/> run_as_user = optional(number)<br/> }))<br/> volume_mounts = optional(map(object({<br/> mount_path = string<br/> name = optional(string) # Will fall back to use map key as volume mount name<br/> read_only = optional(bool)<br/> })))<br/> }))<br/> })<br/> dns_policy = optional(string)<br/> host_network = optional(bool)<br/> image_pull_secrets = optional(list(object({<br/> name = string<br/> })))<br/> init_containers = optional(map(object({<br/> args = optional(list(string))<br/> command = optional(list(string))<br/> env = optional(map(string))<br/> image = string<br/> image_pull_policy = optional(string)<br/> name = optional(string) # Will fall back to use map key as init container name<br/> resources = object({<br/> limits = optional(map(string))<br/> requests = optional(map(string))<br/> })<br/> security_context = optional(object({<br/> privileged = optional(bool)<br/> read_only_root_file_system = optional(bool)<br/> run_as_group = optional(number)<br/> run_as_non_root = optional(bool)<br/> run_as_user = optional(number)<br/> }))<br/> volume_mounts = optional(map(object({<br/> mount_path = string<br/> name = optional(string) # Will fall back to use map key as volume mount name<br/> read_only = optional(bool)<br/> })))<br/> })))<br/> metadata = optional(object({<br/> labels = optional(map(string))<br/> }))<br/> service_account_name = optional(string)<br/> share_process_namespace = optional(bool)<br/> volumes = optional(map(object({<br/> empty_dir = optional(object({<br/> medium = optional(string)<br/> size_limit = optional(string)<br/> }))<br/> host_path = optional(object({<br/> path = string<br/> }))<br/> name = optional(string) # Will fall back to use map key as volume name<br/> secret = optional(object({<br/> optional = optional(bool)<br/> secret_name = string<br/> }))<br/> })))<br/> }))<br/> name = optional(string) # Will fall back to use map key as job definition name<br/> node_properties = optional(string)<br/> parameters = optional(map(string))<br/> platform_capabilities = optional(list(string))<br/> propagate_tags = optional(bool)<br/> retry_strategy = optional(object({<br/> attempts = optional(number)<br/> evaluate_on_exit = optional(map(object({<br/> action = string<br/> on_exit_code = optional(string)<br/> on_reason = optional(string)<br/> on_status_reason = optional(string)<br/> })))<br/> }))<br/> scheduling_priority = optional(number)<br/> tags = optional(map(string), {})<br/> timeout = optional(object({<br/> attempt_duration_seconds = optional(number)<br/> }))<br/> type = optional(string, "container")<br/> }))</pre> | `null` | no |
224+
| <a name="input_job_queues"></a> [job\_queues](#input\_job\_queues) | Map of job queue and scheduling policy defintions to create | <pre>map(object({<br/> compute_environment_order = map(object({<br/> compute_environment_key = string<br/> order = optional(number) # Will fall back to use map key as order<br/> }))<br/> job_state_time_limit_action = optional(map(object({<br/> action = optional(string, "CANCEL")<br/> max_time_seconds = number<br/> reason = optional(string)<br/> state = optional(string, "RUNNABLE")<br/> })))<br/> name = optional(string) # Will fall back to use map key as queue name<br/> priority = number<br/> scheduling_policy_arn = optional(string)<br/> state = optional(string, "ENABLED")<br/> tags = optional(map(string), {})<br/> timeouts = optional(object({<br/> create = optional(string, "10m")<br/> update = optional(string, "10m")<br/> delete = optional(string, "10m")<br/> }))<br/><br/> # Scheduling policy<br/> create_scheduling_policy = optional(bool, true)<br/> fair_share_policy = optional(object({<br/> compute_reservation = optional(number)<br/> share_decay_seconds = optional(number)<br/> share_distribution = optional(list(object({<br/> share_identifier = string<br/> weight_factor = optional(number)<br/> })))<br/> }))<br/> }))</pre> | `null` | no |
219225
| <a name="input_service_iam_role_additional_policies"></a> [service\_iam\_role\_additional\_policies](#input\_service\_iam\_role\_additional\_policies) | Additional policies to be added to the IAM role | `map(string)` | `{}` | no |
220226
| <a name="input_service_iam_role_description"></a> [service\_iam\_role\_description](#input\_service\_iam\_role\_description) | Batch service IAM role description | `string` | `null` | no |
221227
| <a name="input_service_iam_role_name"></a> [service\_iam\_role\_name](#input\_service\_iam\_role\_name) | Batch service IAM role name | `string` | `null` | no |

examples/ec2/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ Note that this example may create resources which will incur monetary charges on
2424

2525
| Name | Version |
2626
|------|---------|
27-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
28-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.78 |
27+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.10 |
28+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.0 |
2929

3030
## Providers
3131

3232
| Name | Version |
3333
|------|---------|
34-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.78 |
34+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.0 |
3535

3636
## Modules
3737

3838
| Name | Source | Version |
3939
|------|--------|---------|
4040
| <a name="module_batch"></a> [batch](#module\_batch) | ../.. | n/a |
4141
| <a name="module_batch_disabled"></a> [batch\_disabled](#module\_batch\_disabled) | ../.. | n/a |
42-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |
43-
| <a name="module_vpc_endpoints"></a> [vpc\_endpoints](#module\_vpc\_endpoints) | terraform-aws-modules/vpc/aws//modules/vpc-endpoints | ~> 5.0 |
42+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 6.0 |
43+
| <a name="module_vpc_endpoints"></a> [vpc\_endpoints](#module\_vpc\_endpoints) | terraform-aws-modules/vpc/aws//modules/vpc-endpoints | ~> 6.0 |
4444

4545
## Resources
4646

examples/ec2/main.tf

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,14 @@ module "batch" {
121121
state = "ENABLED"
122122
priority = 1
123123

124-
compute_environments = ["b_ec2_spot"]
124+
compute_environment_order = {
125+
0 = {
126+
compute_environment_key = "b_ec2_spot"
127+
}
128+
1 = {
129+
compute_environment_key = "a_ec2"
130+
}
131+
}
125132

126133
tags = {
127134
JobQueue = "Low priority job queue"
@@ -133,6 +140,12 @@ module "batch" {
133140
state = "ENABLED"
134141
priority = 99
135142

143+
compute_environment_order = {
144+
0 = {
145+
compute_environment_key = "a_ec2"
146+
}
147+
}
148+
136149
fair_share_policy = {
137150
compute_reservation = 1
138151
share_decay_seconds = 3600
@@ -204,7 +217,7 @@ module "batch" {
204217

205218
module "vpc" {
206219
source = "terraform-aws-modules/vpc/aws"
207-
version = "~> 5.0"
220+
version = "~> 6.0"
208221

209222
name = local.name
210223
cidr = local.vpc_cidr
@@ -221,7 +234,7 @@ module "vpc" {
221234

222235
module "vpc_endpoints" {
223236
source = "terraform-aws-modules/vpc/aws//modules/vpc-endpoints"
224-
version = "~> 5.0"
237+
version = "~> 6.0"
225238

226239
vpc_id = module.vpc.vpc_id
227240

examples/ec2/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 1.3"
2+
required_version = ">= 1.10"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.78"
7+
version = ">= 6.0"
88
}
99
}
1010
}

examples/fargate/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ Note that this example may create resources which will incur monetary charges on
2424

2525
| Name | Version |
2626
|------|---------|
27-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
28-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.78 |
27+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.10 |
28+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.0 |
2929

3030
## Providers
3131

3232
| Name | Version |
3333
|------|---------|
34-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.78 |
34+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.0 |
3535

3636
## Modules
3737

3838
| Name | Source | Version |
3939
|------|--------|---------|
4040
| <a name="module_batch"></a> [batch](#module\_batch) | ../.. | n/a |
4141
| <a name="module_batch_disabled"></a> [batch\_disabled](#module\_batch\_disabled) | ../.. | n/a |
42-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |
43-
| <a name="module_vpc_endpoints"></a> [vpc\_endpoints](#module\_vpc\_endpoints) | terraform-aws-modules/vpc/aws//modules/vpc-endpoints | ~> 5.0 |
42+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 6.0 |
43+
| <a name="module_vpc_endpoints"></a> [vpc\_endpoints](#module\_vpc\_endpoints) | terraform-aws-modules/vpc/aws//modules/vpc-endpoints | ~> 6.0 |
4444

4545
## Resources
4646

examples/fargate/main.tf

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ module "batch" {
9090
state = "ENABLED"
9191
priority = 1
9292

93+
compute_environment_order = {
94+
0 = {
95+
compute_environment_key = "b_fargate_spot"
96+
}
97+
1 = {
98+
compute_environment_key = "a_fargate"
99+
}
100+
}
101+
93102
tags = {
94103
JobQueue = "Low priority job queue"
95104
}
@@ -100,6 +109,12 @@ module "batch" {
100109
state = "ENABLED"
101110
priority = 99
102111

112+
compute_environment_order = {
113+
0 = {
114+
compute_environment_key = "a_fargate"
115+
}
116+
}
117+
103118
fair_share_policy = {
104119
compute_reservation = 1
105120
share_decay_seconds = 3600
@@ -176,7 +191,7 @@ module "batch" {
176191

177192
module "vpc" {
178193
source = "terraform-aws-modules/vpc/aws"
179-
version = "~> 5.0"
194+
version = "~> 6.0"
180195

181196
name = local.name
182197
cidr = local.vpc_cidr
@@ -193,7 +208,7 @@ module "vpc" {
193208

194209
module "vpc_endpoints" {
195210
source = "terraform-aws-modules/vpc/aws//modules/vpc-endpoints"
196-
version = "~> 5.0"
211+
version = "~> 6.0"
197212

198213
vpc_id = module.vpc.vpc_id
199214

examples/fargate/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 1.3"
2+
required_version = ">= 1.10"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.78"
7+
version = ">= 6.0"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)