File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ async function startEc2Instance(label, githubRegistrationToken) {
2929 SecurityGroupIds : [ config . input . securityGroupId ] ,
3030 IamInstanceProfile : { Name : config . input . iamRoleName } ,
3131 TagSpecifications : config . tagSpecifications ,
32+ KeyName : config . input . keyPairName
3233 } ;
3334
3435 try {
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ class Config {
1313 label : core . getInput ( 'label' ) ,
1414 ec2InstanceId : core . getInput ( 'ec2-instance-id' ) ,
1515 iamRoleName : core . getInput ( 'iam-role-name' ) ,
16+ keyPairName : core . getInput ( 'key-pair-name' )
1617 } ;
1718
1819 const tags = JSON . parse ( core . getInput ( 'aws-resource-tags' ) ) ;
@@ -41,6 +42,10 @@ class Config {
4142 throw new Error ( `The 'github-token' input is not specified` ) ;
4243 }
4344
45+ if ( ! this . input . keyPairName ) {
46+ throw new Error ( `Must specify a key pair name` ) ;
47+ }
48+
4449 if ( this . input . mode === 'start' ) {
4550 if ( ! this . input . ec2ImageId || ! this . input . ec2InstanceType || ! this . input . subnetId || ! this . input . securityGroupId ) {
4651 throw new Error ( `Not all the required inputs are provided for the 'start' mode` ) ;
You can’t perform that action at this time.
0 commit comments