-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update e2e infra provision to expect providers #24694
base: main
Are you sure you want to change the base?
Changes from all commits
dc29bdb
77148be
04f13c0
4aa5cbb
7f28533
2bb1257
aba27a0
ad6235e
c75ffbe
8e153b8
d7be4ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ Thumbs.db | |
.idea | ||
.fleet | ||
|
||
|
||
# Folders | ||
_obj | ||
_test | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,30 +5,14 @@ provider "aws" { | |||||
region = var.region | ||||||
} | ||||||
|
||||||
data "aws_caller_identity" "current" { | ||||||
} | ||||||
|
||||||
resource "random_pet" "e2e" { | ||||||
} | ||||||
|
||||||
resource "random_password" "windows_admin_password" { | ||||||
length = 20 | ||||||
special = true | ||||||
override_special = "_%@" | ||||||
} | ||||||
module "provision-infra" { | ||||||
source = "./provision-infra" | ||||||
|
||||||
locals { | ||||||
random_name = "${var.name}-${random_pet.e2e.id}" | ||||||
} | ||||||
|
||||||
# Generates keys to use for provisioning and access | ||||||
module "keys" { | ||||||
name = local.random_name | ||||||
path = "${path.root}/keys" | ||||||
source = "mitchellh/dynamic-keys/aws" | ||||||
version = "v2.0.0" | ||||||
} | ||||||
|
||||||
data "aws_kms_alias" "e2e" { | ||||||
name = "alias/${var.aws_kms_alias}" | ||||||
} | ||||||
server_count = var.client_count_linux | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
client_count_linux = var.client_count_linux | ||||||
client_count_windows_2016_amd64 = var.client_count_windows_2016_amd64 | ||||||
nomad_local_binary = var.nomad_local_binary | ||||||
nomad_license = var.nomad_license | ||||||
consul_license = var.consul_license | ||||||
nomad_region = var.nomad_region | ||||||
} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing trailing EOL. There's a few of these in this PR. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2,7 +2,8 @@ | |||||
# SPDX-License-Identifier: BUSL-1.1 | ||||||
|
||||||
locals { | ||||||
ami_prefix = "nomad-e2e-v3" | ||||||
ami_prefix = "nomad-e2e-v3" | ||||||
ubuntu_instance_name = "ubuntu-jammy-${var.instance_architecture}" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the image (AMI), not the instance, right?
Suggested change
|
||||||
} | ||||||
|
||||||
resource "aws_instance" "server" { | ||||||
|
@@ -22,18 +23,18 @@ resource "aws_instance" "server" { | |||||
} | ||||||
} | ||||||
|
||||||
resource "aws_instance" "client_ubuntu_jammy_amd64" { | ||||||
ami = data.aws_ami.ubuntu_jammy_amd64.image_id | ||||||
resource "aws_instance" "client_ubuntu_jammy" { | ||||||
ami = data.aws_ami.ubuntu_jammy.image_id | ||||||
instance_type = var.instance_type | ||||||
key_name = module.keys.key_name | ||||||
vpc_security_group_ids = [aws_security_group.clients.id] # see also the secondary ENI | ||||||
count = var.client_count_ubuntu_jammy_amd64 | ||||||
count = var.client_count_linux | ||||||
iam_instance_profile = data.aws_iam_instance_profile.nomad_e2e_cluster.name | ||||||
availability_zone = var.availability_zone | ||||||
|
||||||
# Instance tags | ||||||
tags = { | ||||||
Name = "${local.random_name}-client-ubuntu-jammy-amd64-${count.index}" | ||||||
Name = "${local.random_name}-client-ubuntu-jammy-${count.index}" | ||||||
ConsulAutoJoin = "auto-join-${local.random_name}" | ||||||
User = data.aws_caller_identity.current.arn | ||||||
} | ||||||
|
@@ -106,6 +107,26 @@ data "aws_ami" "ubuntu_jammy_amd64" { | |||||
} | ||||||
} | ||||||
|
||||||
data "aws_ami" "ubuntu_jammy" { | ||||||
most_recent = true | ||||||
owners = ["self"] | ||||||
|
||||||
filter { | ||||||
name = "name" | ||||||
values = ["${local.ami_prefix}-${local.ubuntu_instance_name}-*"] | ||||||
} | ||||||
|
||||||
filter { | ||||||
name = "tag:OS" | ||||||
values = ["Ubuntu"] | ||||||
} | ||||||
|
||||||
filter { | ||||||
name = "tag:BuilderSha" | ||||||
values = [data.external.packer_sha.result["sha"]] | ||||||
} | ||||||
} | ||||||
|
||||||
data "aws_ami" "windows_2016_amd64" { | ||||||
count = var.client_count_windows_2016_amd64 > 0 ? 1 : 0 | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable originally included the specific distro and architecture so that we could spin up different hosts in the same test run (although we never got around to doing so). It's not obvious to me how we're planning on feeding in the architecture/platform if not by this variable.
(Or, if we're planning on adding architecture/platform variables later, shouldn't we make the same change to the windows_2026_amd64` var?)