Error Overwriting AWS Key Pair #16206
Labels
enhancement
Requests to existing resources that expand the functionality or scope.
service/ec2
Issues and PRs that pertain to the ec2 service.
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
I have an ssm parameter, with a public key. From within a module I import the public key from the parameter as a key pair.
Debug Output
If I taint this artefact and then re-run apply
Expected Behaviour
I would expect it to either overwrite the key, delete any existing keys first or compare the two values to confirm the duplication. If the key pair is a duplicate I would expect the apply command to ignore the key and continue.
Actual Behaviour
The following error is thrown:
I can work around this by deleting the key, or untainting that particular artefact. However, it would be neat if there was a way to prevent this error.
Important Factoids
I checked the docs, I was hoping to find an argument similar to:
on_failure = continue
Could this be added?
References
Kind of related to:
Thanks,
The text was updated successfully, but these errors were encountered: