Skip to content

Use a unique value as ClientToken for each RunInstances request #131

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Jalle19
Copy link

@Jalle19 Jalle19 commented Oct 22, 2024

The purpose of ClientToken is to ensure request idempotency in case the request needs to be retried. This means the value must be unique for all unique RunInstances API calls.

When building a template that references the same source multiple times (or multiple different sources), many calls to RunInstances are made. However, the same auto-generated instance name was used as ClientToken.

This changes ClientToken to be unique regardless of whether the user has supplied a unique instance_name for each source/build.

Fixes #6

Added additional logging for the instance IDs created to ease debugging.

@Jalle19 Jalle19 requested a review from a team as a code owner October 22, 2024 09:59
Copy link

hashicorp-cla-app bot commented Oct 22, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


Sam Stenvall seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA.
If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

@Jalle19 Jalle19 force-pushed the fix-multisource-clienttoken branch from 62dce6c to 8a51d71 Compare October 22, 2024 10:03
The purpose of ClientToken is to ensure request idempotency in case the request needs to be retried. This means the value must be unique for all unique RunInstances API calls.

When building a template that references the same source multiple times (or multiple different sources), many calls to RunInstances are made. However, the same auto-generated instance name was used as "ClientToken".

This changes ClientToken to be unique regardless of whether the user has supplied a unique "instance_name" for each source/build.

Fixes hashicorp#6
@Jalle19 Jalle19 force-pushed the fix-multisource-clienttoken branch from 8a51d71 to 96a98f9 Compare October 22, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tencentcloud-cvm Failed to wait for instance ready: instance(ins-xxxx) not exist
1 participant