@@ -143746,8 +143746,8 @@ async function startEc2Instance(labels, githubRegistrationToken) {
143746
143746
const input = {
143747
143747
MinCount: 1,
143748
143748
MaxCount: 1,
143749
- ImageId: config.input.ec2ImageId ,
143750
- InstanceType: config.input.ec2InstanceType ,
143749
+ ImageId: config.input.imageId ,
143750
+ InstanceType: config.input.instanceType ,
143751
143751
InstanceMarketOptions: config.input.spotInstance ? { MarketType: 'spot' } : undefined,
143752
143752
EbsOptimized: true,
143753
143753
BlockDeviceMappings: [
@@ -143772,48 +143772,48 @@ async function startEc2Instance(labels, githubRegistrationToken) {
143772
143772
try {
143773
143773
const command = new RunInstancesCommand(input);
143774
143774
const response = await client.send(command);
143775
- const ec2InstanceId = response.Instances[0].InstanceId;
143776
- core.info(`AWS EC2 instance ${ec2InstanceId } has started`);
143777
- return ec2InstanceId ;
143775
+ const instanceId = response.Instances[0].InstanceId;
143776
+ core.info(`AWS EC2 instance ${instanceId } has started`);
143777
+ return instanceId ;
143778
143778
} catch (error) {
143779
143779
core.error('AWS EC2 instance launch error');
143780
143780
throw error;
143781
143781
}
143782
143782
}
143783
143783
143784
- async function waitForInstanceRunning(ec2InstanceId ) {
143784
+ async function waitForInstanceRunning(instanceId ) {
143785
143785
// https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ec2/Variable/waitUntilInstanceRunning
143786
143786
const params = {
143787
143787
client: client,
143788
143788
maxWaitTime: 60 * 5,
143789
143789
};
143790
143790
const input = {
143791
- InstanceIds: [ec2InstanceId ],
143791
+ InstanceIds: [instanceId ],
143792
143792
};
143793
143793
143794
143794
try {
143795
143795
await waitUntilInstanceRunning(params, input);
143796
- core.info(`AWS EC2 instance ${ec2InstanceId } is up and running`);
143796
+ core.info(`AWS EC2 instance ${instanceId } is up and running`);
143797
143797
return;
143798
143798
} catch (error) {
143799
- core.error(`AWS EC2 instance ${ec2InstanceId } initialization error`);
143799
+ core.error(`AWS EC2 instance ${instanceId } initialization error`);
143800
143800
throw error;
143801
143801
}
143802
143802
}
143803
143803
143804
143804
async function terminateEc2Instance() {
143805
143805
// https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ec2/command/TerminateInstancesCommand
143806
143806
const input = {
143807
- InstanceIds: [config.input.ec2InstanceId ],
143807
+ InstanceIds: [config.input.instanceId ],
143808
143808
};
143809
143809
143810
143810
try {
143811
143811
const command = new TerminateInstancesCommand(input);
143812
143812
await client.send(command);
143813
- core.info(`AWS EC2 instance ${config.input.ec2InstanceId } has terminated`);
143813
+ core.info(`AWS EC2 instance ${config.input.instanceId } has terminated`);
143814
143814
return;
143815
143815
} catch (error) {
143816
- core.error(`AWS EC2 instance ${config.input.ec2InstanceId } termination error`);
143816
+ core.error(`AWS EC2 instance ${config.input.instanceId } termination error`);
143817
143817
throw error;
143818
143818
}
143819
143819
}
@@ -143838,12 +143838,12 @@ class Config {
143838
143838
this.input = {
143839
143839
mode: core.getInput('mode'),
143840
143840
githubToken: core.getInput('github-token'),
143841
- ec2ImageId : core.getInput('ec2- image-id'),
143842
- ec2InstanceType : core.getInput('ec2- instance-type'),
143841
+ imageId : core.getInput('image-id'),
143842
+ instanceType : core.getInput('instance-type'),
143843
143843
subnetId: core.getInput('subnet-id'),
143844
143844
securityGroupId: core.getInput('security-group-id'),
143845
143845
labels: core.getInput('labels'),
143846
- ec2InstanceId : core.getInput('ec2- instance-id'),
143846
+ instanceId : core.getInput('instance-id'),
143847
143847
iamRoleName: core.getInput('iam-role-name'),
143848
143848
spotInstance: core.getBooleanInput('spot-instance'),
143849
143849
rootVolumeDevice: core.getInput('root-volume-device'),
@@ -143886,11 +143886,11 @@ class Config {
143886
143886
}
143887
143887
143888
143888
if (this.input.mode === 'start') {
143889
- if (!this.input.ec2ImageId || !this.input.ec2InstanceType || !this.input.subnetId || !this.input.securityGroupId) {
143889
+ if (!this.input.imageId || !this.input.instanceType || !this.input.subnetId || !this.input.securityGroupId) {
143890
143890
throw new Error(`Not all the required inputs are provided for the 'start' mode`);
143891
143891
}
143892
143892
} else if (this.input.mode === 'stop') {
143893
- if (!this.input.labels || !this.input.ec2InstanceId ) {
143893
+ if (!this.input.labels || !this.input.instanceId ) {
143894
143894
throw new Error(`Not all the required inputs are provided for the 'stop' mode`);
143895
143895
}
143896
143896
} else {
@@ -145979,7 +145979,7 @@ const gh = __nccwpck_require__(6989);
145979
145979
145980
145980
function setOutput(labels, instanceId, runnerName) {
145981
145981
core.setOutput('labels', labels);
145982
- core.setOutput('ec2- instance-id', instanceId);
145982
+ core.setOutput('instance-id', instanceId);
145983
145983
core.setOutput('runner-name', runnerName);
145984
145984
}
145985
145985
0 commit comments