Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add Support to Configure EBS Disk Size #200

Open
FaisalPathboxAI opened this issue Oct 16, 2024 · 2 comments
Open

[Feature Request] Add Support to Configure EBS Disk Size #200

FaisalPathboxAI opened this issue Oct 16, 2024 · 2 comments

Comments

@FaisalPathboxAI
Copy link

Based on AWS SDK for Javascript, EBS disk size can be configured using BlockDeviceMappings parameter. I'm only interested to setup the BlockDeviceMappings.Ebs.VolumeSize field. I was thinking if we can add an optional parameter ebs-volume-size with integer type which will be passed to BlockDeviceMappings.Ebs.VolumeSize that will be really helpful.

@FaisalPathboxAI FaisalPathboxAI changed the title Unable to Configure EBS Disk Size [Feature Request] Configure EBS Disk Size Oct 17, 2024
@FaisalPathboxAI FaisalPathboxAI changed the title [Feature Request] Configure EBS Disk Size [Feature Request] Add Support to Configure EBS Disk Size Oct 17, 2024
@Preen
Copy link
Collaborator

Preen commented Oct 30, 2024

Its in progress: #189

@stecullum
Copy link

I need this.. my plan was

    ImageId: config.input.ec2ImageId,
    InstanceType: config.input.ec2InstanceType,
    MinCount: 1,
    MaxCount: 1,
    UserData: Buffer.from(userData.join('\n')).toString('base64'),
    SubnetId: config.input.subnetId,
    SecurityGroupIds: [config.input.securityGroupId],
    IamInstanceProfile: { Name: config.input.iamRoleName, Arn: config.input.iamRoleArn },
    TagSpecifications: config.tagSpecifications,

    // Define the root volume size
    BlockDeviceMappings: [
      {
        DeviceName: "/dev/xvda", // Default root volume device name
        Ebs: {
          VolumeSize: config.input.volumeSize || 8, // Set the volume size, default to 8 GiB if not specified
          VolumeType: "gp2", // General Purpose SSD (you can choose gp3 or other types as needed)
          DeleteOnTermination: true, // Optionally delete volume on instance termination
        },
      },
    ],
  };

  try {
    const result = await ec2.runInstances(params).promise();
    const ec2InstanceId = result.Instances[0].InstanceId;
    core.info(`AWS EC2 instance ${ec2InstanceId} is started`);
    return ec2InstanceId;
  } catch (error) {
    core.error('AWS EC2 instance starting error');
    throw error;
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants