Skip to content

Commit 06e9078

Browse files
authored
feat: Search for Windows or Linux AMIs only if they are needed (terraform-aws-modules#1371)
1 parent a2761ad commit 06e9078

File tree

13 files changed

+35
-22
lines changed

13 files changed

+35
-22
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
316316
| <a name="output_workers_asg_arns"></a> [workers\_asg\_arns](#output\_workers\_asg\_arns) | IDs of the autoscaling groups containing workers. |
317317
| <a name="output_workers_asg_names"></a> [workers\_asg\_names](#output\_workers\_asg\_names) | Names of the autoscaling groups containing workers. |
318318
| <a name="output_workers_default_ami_id"></a> [workers\_default\_ami\_id](#output\_workers\_default\_ami\_id) | ID of the default worker group AMI |
319+
| <a name="output_workers_default_ami_id_windows"></a> [workers\_default\_ami\_id\_windows](#output\_workers\_default\_ami\_id\_windows) | ID of the default Windows worker group AMI |
319320
| <a name="output_workers_launch_template_arns"></a> [workers\_launch\_template\_arns](#output\_workers\_launch\_template\_arns) | ARNs of the worker launch templates. |
320321
| <a name="output_workers_launch_template_ids"></a> [workers\_launch\_template\_ids](#output\_workers\_launch\_template\_ids) | IDs of the worker launch templates. |
321322
| <a name="output_workers_launch_template_latest_versions"></a> [workers\_launch\_template\_latest\_versions](#output\_workers\_launch\_template\_latest\_versions) | Latest versions of the worker launch templates. |

data.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ data "aws_iam_policy_document" "workers_assume_role_policy" {
1414
}
1515

1616
data "aws_ami" "eks_worker" {
17+
count = local.worker_has_linux_ami ? 1 : 0
18+
1719
filter {
1820
name = "name"
1921
values = [local.worker_ami_name_filter]
@@ -25,6 +27,8 @@ data "aws_ami" "eks_worker" {
2527
}
2628

2729
data "aws_ami" "eks_worker_windows" {
30+
count = local.worker_has_windows_ami ? 1 : 0
31+
2832
filter {
2933
name = "name"
3034
values = [local.worker_ami_name_filter_windows]

examples/basic/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ module "vpc" {
103103
module "eks" {
104104
source = "../.."
105105
cluster_name = local.cluster_name
106-
cluster_version = "1.17"
106+
cluster_version = "1.20"
107107
subnets = module.vpc.private_subnets
108108

109109
tags = {

examples/fargate/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module "vpc" {
6060
module "eks" {
6161
source = "../.."
6262
cluster_name = local.cluster_name
63-
cluster_version = "1.17"
63+
cluster_version = "1.20"
6464
subnets = module.vpc.private_subnets
6565

6666
tags = {

examples/instance_refresh/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ resource "aws_autoscaling_lifecycle_hook" "aws_node_termination_handler" {
228228
module "eks" {
229229
source = "../.."
230230
cluster_name = local.cluster_name
231-
cluster_version = "1.19"
231+
cluster_version = "1.20"
232232
subnets = module.vpc.public_subnets
233233
vpc_id = module.vpc.vpc_id
234234
enable_irsa = true

examples/irsa/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module "vpc" {
3939
module "eks" {
4040
source = "../.."
4141
cluster_name = local.cluster_name
42-
cluster_version = "1.17"
42+
cluster_version = "1.20"
4343
subnets = module.vpc.public_subnets
4444
vpc_id = module.vpc.vpc_id
4545
enable_irsa = true

examples/launch_templates/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module "vpc" {
4343
module "eks" {
4444
source = "../.."
4545
cluster_name = local.cluster_name
46-
cluster_version = "1.17"
46+
cluster_version = "1.20"
4747
subnets = module.vpc.public_subnets
4848
vpc_id = module.vpc.vpc_id
4949

examples/launch_templates_with_managed_node_groups/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module "vpc" {
5050
module "eks" {
5151
source = "../.."
5252
cluster_name = local.cluster_name
53-
cluster_version = "1.17"
53+
cluster_version = "1.20"
5454
subnets = module.vpc.private_subnets
5555
vpc_id = module.vpc.vpc_id
5656

examples/managed_node_groups/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module "vpc" {
5656
module "eks" {
5757
source = "../.."
5858
cluster_name = local.cluster_name
59-
cluster_version = "1.17"
59+
cluster_version = "1.20"
6060
subnets = module.vpc.private_subnets
6161

6262
tags = {

examples/secrets_encryption/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module "vpc" {
6060
module "eks" {
6161
source = "../.."
6262
cluster_name = local.cluster_name
63-
cluster_version = "1.17"
63+
cluster_version = "1.20"
6464
subnets = module.vpc.private_subnets
6565

6666
cluster_encryption_config = [

0 commit comments

Comments
 (0)