Skip to content

Conversation

@DaveCTurner
Copy link
Contributor

Adds prefixes to various randomly-generated values to make it easier to
pin down where they're coming from in debugging sessions. Also forces
the STS expiry time to be rendered in UTC.

Adds prefixes to various randomly-generated values to make it easier to
pin down where they're coming from in debugging sessions. Also forces
the STS expiry time to be rendered in UTC.
@DaveCTurner DaveCTurner added >test Issues or PRs that are addressing/adding tests :Distributed Coordination/Discovery-Plugins Anything related to our integration plugins with EC2, GCP and Azure v8.19.0 v9.1.0 labels Mar 27, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Coordination Meta label for Distributed Coordination team label Mar 27, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination)

Copy link
Contributor

@DiannaHohensee DiannaHohensee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some suggestions, lgtm 👍

}

private String generateAndGet() {
final var newRegion = "test-region-" + ESTestCase.randomIdentifier();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could prefix something additional like "random-test-region-" or "dynamic-test-region-", if you want to make this a little more identifiable/unique that it comes from this class -- as opposed to a random test file generating its own test region where we'll likely to use the same prefix.

return;
}
final var accessKey = randomIdentifier();
// ATIA for a test key, similar to AKIA and ASIA used in real AWS credentials
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So ATIA is not typical for AWS credentials, so this is more visible? Add something saying ATIA deliberately differs for identifiability?

Or just prefix 'test' or 'access-key-sts' -- ACCESS_KEY_STS_<>. There are no requirements for the access key, right? We just want to be able to read what the random string represents, IIUC.

sessionToken,
randomSecretKey(),
ZonedDateTime.now().plusDays(1L).format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ")),
ZonedDateTime.now(Clock.systemUTC()).plusDays(1L).format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ")),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@DaveCTurner DaveCTurner added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) auto-backport Automatically create backport pull requests when merged labels Mar 27, 2025
@DaveCTurner
Copy link
Contributor Author

Thanks yeah applied some changes. Doesn't really matter what the prefixes are as long as you can search for them.

@elasticsearchmachine elasticsearchmachine merged commit 2d4fb76 into elastic:main Mar 28, 2025
17 checks passed
@DaveCTurner DaveCTurner deleted the 2025/03/27/aws-randomIdentifier-improvements branch March 28, 2025 07:33
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Mar 28, 2025
Adds prefixes to various randomly-generated values to make it easier to
pin down where they're coming from in debugging sessions. Also forces
the STS expiry time to be rendered in UTC.
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

omricohenn pushed a commit to omricohenn/elasticsearch that referenced this pull request Mar 28, 2025
Adds prefixes to various randomly-generated values to make it easier to
pin down where they're coming from in debugging sessions. Also forces
the STS expiry time to be rendered in UTC.
elasticsearchmachine pushed a commit that referenced this pull request Mar 31, 2025
Adds prefixes to various randomly-generated values to make it easier to
pin down where they're coming from in debugging sessions. Also forces
the STS expiry time to be rendered in UTC.

Co-authored-by: Rene Groeschke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Distributed Coordination/Discovery-Plugins Anything related to our integration plugins with EC2, GCP and Azure Team:Distributed Coordination Meta label for Distributed Coordination team >test Issues or PRs that are addressing/adding tests v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants