diff --git a/.github/spot-runner-action/dist/index.js b/.github/spot-runner-action/dist/index.js index 37aa0ce13a3..c1c60815239 100644 --- a/.github/spot-runner-action/dist/index.js +++ b/.github/spot-runner-action/dist/index.js @@ -245,7 +245,7 @@ class Ec2Instance { const client = yield this.getEc2Client(); // NOTE: This should be deterministic or we will create a launch template each time const userData = yield new userdata_1.UserData(this.config).getUserData(); - const ec2InstanceTypeHash = this.getHashOfStringArray(this.config.ec2InstanceType.concat([userData]).concat([JSON.stringify(this.tags)])); + const ec2InstanceTypeHash = this.getHashOfStringArray(this.config.ec2InstanceType.concat([userData, JSON.stringify(this.tags), this.config.ec2KeyName])); const launchTemplateName = "aztec-packages-spot-" + this.config.ec2AmiId + "-" + ec2InstanceTypeHash; const launchTemplateParams = { LaunchTemplateName: launchTemplateName, @@ -258,6 +258,7 @@ class Ec2Instance { MemoryMiB: { Min: 0 }, AllowedInstanceTypes: this.config.ec2InstanceType, }, + KeyName: this.config.ec2KeyName, UserData: userData, TagSpecifications: [ { diff --git a/.github/spot-runner-action/src/ec2.ts b/.github/spot-runner-action/src/ec2.ts index 195aa3fa919..413d02ad4fb 100644 --- a/.github/spot-runner-action/src/ec2.ts +++ b/.github/spot-runner-action/src/ec2.ts @@ -161,7 +161,7 @@ export class Ec2Instance { // NOTE: This should be deterministic or we will create a launch template each time const userData = await new UserData(this.config).getUserData(); const ec2InstanceTypeHash = this.getHashOfStringArray( - this.config.ec2InstanceType.concat([userData]).concat([JSON.stringify(this.tags)]) + this.config.ec2InstanceType.concat([userData, JSON.stringify(this.tags), this.config.ec2KeyName]) ); const launchTemplateName = "aztec-packages-spot-" + this.config.ec2AmiId + "-" + ec2InstanceTypeHash; @@ -177,6 +177,7 @@ export class Ec2Instance { MemoryMiB: { Min: 0 }, AllowedInstanceTypes: this.config.ec2InstanceType, }, + KeyName: this.config.ec2KeyName, UserData: userData, TagSpecifications: [ {