Skip to content

Commit cad67fc

Browse files
Redirect FIPS cloud e2e tests to FRH-Staging (#5245)
* Redirect FIPS cloud e2e tests to FHR-Staging Redirect FIPS cloud e2e tests to use FHR-Staging. Use bk plugins instead of hooks for setting the EC_API key. Add region and deployment template vars to cloude2e terraform. * Remove unused var
1 parent acbb06a commit cad67fc

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

.buildkite/hooks/pre-command

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ set -euo pipefail
44

55
source .buildkite/scripts/common.sh
66

7-
EC_KEY_SECRET_PATH="kv/ci-shared/platform-ingest/platform-ingest-ec-prod"
87
CI_DRA_ROLE_PATH="kv/ci-shared/release/dra-role"
98
JOB_GCS_BUCKET="fleet-server-ci-internal"
109
GITHUB_REPO_TOKEN=$VAULT_GITHUB_TOKEN
@@ -44,15 +43,6 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "fleet-server-package-mbp" ]]; then
4443
check_if_file_exist_in_repo "infra" "${_branch}" #TODO should be changed to "main" for rollback...
4544
fi
4645

47-
# TODO: use a builkite plugin to handle this
48-
if [[ "$BUILDKITE_PIPELINE_SLUG" == "fleet-server" ]]; then
49-
if [[ "$BUILDKITE_STEP_KEY" == "cloud-e2e-test" || "$BUILDKITE_STEP_KEY" == "cloud-e2e-fips-test" ]]; then
50-
export EC_API_KEY_SECRET=$(retry 5 vault kv get -field apiKey "${EC_KEY_SECRET_PATH}")
51-
# Environment variables required by the Elastic Cloud service deployer
52-
export EC_API_KEY=${EC_API_KEY_SECRET}
53-
fi
54-
fi
55-
5646
# TODO: use a builkite plugin to handle this
5747
if [[ "$BUILDKITE_PIPELINE_SLUG" == "fleet-server-package-mbp" ]]; then
5848
if [[ "$BUILDKITE_STEP_KEY" == "dra-snapshot" || "$BUILDKITE_STEP_KEY" == "dra-staging" ]]; then

.buildkite/pipeline.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ steps:
208208
provider: "gcp"
209209
plugins:
210210
- *docker_elastic_login_plugin
211+
- elastic/vault-secrets#v0.1.0:
212+
path: "kv/ci-shared/platform-ingest/platform-ingest-ec-prod"
213+
field: "apiKey"
214+
env_var: "EC_API_KEY"
211215
depends_on:
212216
- step: "unit-test"
213217
allow_failure: false
@@ -231,11 +235,18 @@ steps:
231235
PLATFORMS: "linux/amd64"
232236
TF_VAR_pull_request: "${BUILDKITE_PULL_REQUEST}"
233237
FIPS: "true"
238+
EC_ENDPOINT: "https://api.staging.elastic-gov.com"
239+
TF_VAR_ess_region: "us-gov-east-1"
240+
TF_VAR_deployment_template_id: "aws-general-purpose"
234241
command: ".buildkite/scripts/cloud_e2e_test.sh"
235242
agents:
236243
provider: "gcp"
237244
plugins:
238245
- *docker_elastic_login_plugin
246+
- elastic/vault-secrets#v0.1.0:
247+
path: "kv/ci-shared/platform-ingest/platform-ingest-ec-staging-gov"
248+
field: "apiKey"
249+
env_var: "EC_API_KEY"
239250
depends_on:
240251
- step: "unit-test"
241252
allow_failure: false

dev-tools/cloud/terraform/main.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ variable "ess_region" {
3434
description = "The ESS region to use"
3535
}
3636

37+
variable "deployment_template_id" {
38+
type = string
39+
default = "gcp-general-purpose"
40+
description = "The ess deployment template to use"
41+
}
42+
3743
locals {
3844
// strip hash found in ELASTICSEARCH_VERSION in integration/.env to get stack_version
3945
dra_match = regex("ELASTICSEARCH_VERSION=([0-9]+\\.[0-9]+\\.[0-9]+)(?:-[[:alpha:]]+-)?-?(SNAPSHOT)?", file("${path.module}/../../integration/.env"))
@@ -49,8 +55,9 @@ data "ec_stack" "latest" {
4955
resource "ec_deployment" "deployment" {
5056
name = format("fleet server PR-%s-%s", var.pull_request, var.git_commit)
5157
region = var.ess_region
58+
deployment_template_id = var.deployment_template_id
5259
version = data.ec_stack.latest.version
53-
deployment_template_id = "gcp-general-purpose"
60+
5461

5562
tags = {
5663
"source_repo" = "elastic/fleet-server"

0 commit comments

Comments
 (0)