Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions assets/terraform-modules/aws/flatcar-linux/kubernetes/ami.tf
Original file line number Diff line number Diff line change
@@ -1,37 +1,11 @@
locals {
# Pick a Container Linux derivative
ami_id = "${element(concat(data.aws_ami.flatcar.*.image_id, data.aws_ami.coreos.*.image_id, list("")), 0)}"
ami_id = data.aws_ami.flatcar.*.image_id

flavor = var.os_name
channel = var.os_channel
ver = var.os_version == "current" ? "" : var.os_version
}

data "aws_ami" "coreos" {
count = "${local.flavor == "coreos" ? 1 : 0}"

most_recent = true
owners = ["595879546273"]

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

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

filter {
name = "name"
values = ["CoreOS-${local.channel}-${local.ver}*"]
}
}

data "aws_ami" "flatcar" {
count = "${local.flavor == "flatcar" ? 1 : 0}"

most_recent = true
owners = ["075585003325"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ variable "controller_type" {
description = "EC2 instance type for controllers"
}

variable "os_name" {
type = string
default = "flatcar"
description = "Name of Operating System (coreos or flatcar)"
}

variable "os_channel" {
type = string
default = "stable"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,11 @@
locals {
# Pick a Container Linux derivative
ami_id = "${element(concat(data.aws_ami.flatcar.*.image_id, data.aws_ami.coreos.*.image_id, list("")), 0)}"
ami_id = data.aws_ami.flatcar.*.image_id

flavor = var.os_name
channel = var.os_channel
ver = var.os_version == "current" ? "" : var.os_version
}

data "aws_ami" "coreos" {
count = "${local.flavor == "coreos" ? 1 : 0}"

most_recent = true
owners = ["595879546273"]

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

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

filter {
name = "name"
values = ["CoreOS-${local.channel}-${local.ver}*"]
}
}

data "aws_ami" "flatcar" {
count = "${local.flavor == "flatcar" ? 1 : 0}"

most_recent = true
owners = ["075585003325"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ variable "taints" {
description = "Map of custom taints for worker nodes."
}

variable "os_name" {
type = string
default = "flatcar"
description = "Name of Operating System (coreos or flatcar)"
}

variable "os_channel" {
type = string
default = "stable"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ terraform {

required_providers {
ct = {
source = "poseidon/ct"
source = "poseidon/ct"
version = "0.7.1"
}
azurerm = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {

required_providers {
ct = {
source = "poseidon/ct"
source = "poseidon/ct"
version = "0.7.1"
}
azurerm = {
Expand Down
12 changes: 6 additions & 6 deletions pkg/assets/generated_assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.