-
Notifications
You must be signed in to change notification settings - Fork 37
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
Apply fails on duplicate key pair #52
Comments
The identity.db is solely for mapping internal activity ID's to their external counterpart. It's not intended as a generic shared storage. An important objective with its design is to prevent that lyra is storing "state". We don't want lyra to maintain a copy of the real world, but rather map to it. In this particular case, I would consider it the providers responsibility to ensure that the |
Tagging @markfuller |
This would mean that the provider is instructed to do a create but in fact does an update (note from Kenaz's debug output that it is the handler's Create that is called in this scenario) @kenazk see #69. Pending resolution of that issue, you could:
(2 and 3 are as-per discussions to-date on this) |
Perhaps I've misunderstood the problem. Is the case here that the public-key actually is the same as the external_id? |
I hate that "Close and comment" button 👎 |
The |
@markfuller so am I correct to assume that what happens is that during the second apply, the artefact is found but since there's no way to retrieve the |
Kenaz's To Reproduce steps involve applying a manifest (to create the resource), deleting the identity db and then reapplying the manifest (to simulate a scenario where we have an unmanaged resource). So that is why the create is being invoked. The reason it is failing is that there is a uniqueness constraint in AWS on the |
"to simulate a scenario where we have an unmanaged resource" In that case I suggest we close this issue because deleting the identity.db doesn't simulate that at all. |
The main issue is "how does Lyra interact with resources it finds in the real world?" When it's being asked to create something that already exists, should it:
My take is it should do 2. |
I agree that it should do 2. |
FWIW, the TF AWS bridge provider handles this case, by deleting and recreating the pair every time. |
The "native" AWS provider referenced here no longer exists and testing running apply repeatedly with the following manifest works just fine, so I'm closing this ticket.
|
Describe the bug
When running
apply
, if keypair has previously been created (either through Lyra or not), apply fails with the following:To Reproduce
Steps to reproduce the behavior:
lyra apply attach --debug
identity.db
lyra apply attach --debug
Expected behavior
I expect Lyra to record keypair into identity.db and continue forward with execution given the resource already exists as specified.
Logs
If applicable, add the full terminal output (try adding the
--debug
flag for more verbosity) to help explain your problem.Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: