mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: Associate spot instances with their instance IDs for auth (#3383)
Fixes #2162.
This commit is contained in:
@@ -310,6 +310,7 @@ func applyAutomaticInstanceID(resource *tfjson.StateResource, agents []*proto.Ag
|
||||
key, isValid := map[string]string{
|
||||
"google_compute_instance": "instance_id",
|
||||
"aws_instance": "id",
|
||||
"aws_spot_instance_request": "spot_instance_id",
|
||||
"azurerm_linux_virtual_machine": "virtual_machine_id",
|
||||
"azurerm_windows_virtual_machine": "virtual_machine_id",
|
||||
}[resource.Type]
|
||||
|
||||
@@ -219,6 +219,10 @@ func TestInstanceIDAssociation(t *testing.T) {
|
||||
Auth: "aws-instance-identity",
|
||||
ResourceType: "aws_instance",
|
||||
InstanceIDKey: "id",
|
||||
}, {
|
||||
Auth: "aws-instance-identity",
|
||||
ResourceType: "aws_spot_instance_request",
|
||||
InstanceIDKey: "spot_instance_id",
|
||||
}, {
|
||||
Auth: "azure-instance-identity",
|
||||
ResourceType: "azurerm_linux_virtual_machine",
|
||||
|
||||
Reference in New Issue
Block a user