Skip to content

Commit

Permalink
Merge pull request #3615 from twz123/add-al2023-to-os-testing-matrix
Browse files Browse the repository at this point in the history
Add Amazon Linux 2023 to OS testing matrix
  • Loading branch information
twz123 authored Oct 20, 2023
2 parents 4dbbd3e + 2d95001 commit f314271
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ostests-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on:
required: true
default: >-
[
"al2023",
"alpine_3_17",
"centos_7", "centos_8", "centos_9",
"debian_10", "debian_11", "debian_12",
Expand Down
1 change: 1 addition & 0 deletions hack/ostests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ terraform apply

### `os`: Operating system stack

* `al2023`: Amazon Linux 2023
* `alpine_3_17`: Alpine Linux 3.17
* `centos_7`: CentOS Linux 7 (Core)
* `centos_8`: CentOS Stream 8
Expand Down
1 change: 1 addition & 0 deletions hack/ostests/modules/os/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ locals {
# Boilerplate to make terraform a little bit dynamic

os = {
al2023 = local.os_al2023
alpine_3_17 = local.os_alpine_3_17
centos_7 = local.os_centos_7
centos_8 = local.os_centos_8
Expand Down
44 changes: 44 additions & 0 deletions hack/ostests/modules/os/os_al2023.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# https://docs.aws.amazon.com/linux/al2023/ug/naming-and-versioning.html

data "aws_ami" "al2023" {
count = var.os == "al2023" ? 1 : 0

owners = ["137112412989"]
name_regex = "^al2023-ami-2023.\\d+.\\d+.\\d+-.*-x86_64"
most_recent = true

filter {
name = "name"
values = ["al2023-ami-2023.*-x86_64"]
}

filter {
name = "architecture"
values = ["x86_64"]
}

filter {
name = "root-device-type"
values = ["ebs"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}
}

locals {
os_al2023 = var.os != "al2023" ? {} : {
node_configs = {
default = {
ami_id = one(data.aws_ami.al2023.*.id)

connection = {
type = "ssh"
username = "ec2-user"
}
}
}
}
}

0 comments on commit f314271

Please sign in to comment.