Skip to content

[8.19] (backport #9832) fix: ESS stack clean up steps#9854

Merged
pkoutsovasilis merged 1 commit into8.19from
mergify/bp/8.19/pr-9832
Sep 10, 2025
Merged

[8.19] (backport #9832) fix: ESS stack clean up steps#9854
pkoutsovasilis merged 1 commit into8.19from
mergify/bp/8.19/pr-9832

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Sep 10, 2025

What does this PR do?

This PR fixes issues with ESS stack cleanup in CI by:

  • Moving the ASDF_TERRAFORM_VERSION definition to the global pipeline environment so it is available to all steps, ensuring asdf provides the required terraform binary.
  • Passing the ess_region variable explicitly to terraform destroy in both Bash and PowerShell scripts, since it is required to properly clean up FIPS ESS stacks that do not use the default region specified in Terraform files.
  • Ensuring the correct set of Terraform environment variables is consistently provided during ESS stack cleanup.

Why is it important?

Without these changes, ESS stacks are not be cleaned up correctly after CI runs due to missing terraform binaries, unset environment variables, or incorrect region handling. This results in orphaned cloud resources, higher costs, and hitting stack quotas, which can block new CI runs from provisioning fresh environments.

Before this PR link. With this PR link.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Disruptive User Impact

None expected. These changes affect only CI pipelines and cleanup scripts.

How to test this PR locally

Open a draft PR and see that ESS cleanup steps are actually cleaning up the stacks.

Related issues

N/A


This is an automatic backport of pull request #9832 done by Mergify.

* fix: specify terraform env var everywhere

* fix: proper env vars for ESS Stack clean up

* fix: error when terraform fails to destroy ESS stack

* fix: pass ess_region in terraform destroy

(cherry picked from commit 6918b7b)
@mergify mergify bot added the backport label Sep 10, 2025
@mergify mergify bot requested a review from a team as a code owner September 10, 2025 12:18
@mergify mergify bot mentioned this pull request Sep 10, 2025
8 tasks
@elastic-sonarqube
Copy link
Copy Markdown

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@pkoutsovasilis pkoutsovasilis merged commit 3e5daee into 8.19 Sep 10, 2025
21 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

cc @pkoutsovasilis

@pkoutsovasilis pkoutsovasilis deleted the mergify/bp/8.19/pr-9832 branch September 10, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants