Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cloudlift/config/environment_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def _create_config(self):
private_subnet_2_cidr = prompt(
"Private Subnet 2 CIDR", default=list(vpc_cidr.subnets(new_prefix=22))[3])
cluster_min_instances = prompt("Min instances in cluster", default=1)
instance_root_volume = prompt("Instance Root Volume Size", default=30)
cluster_max_instances = prompt("Max instances in cluster", default=5)
cluster_instance_type = prompt("Instance type", default='m5.xlarge')
key_name = prompt("SSH key name")
Expand Down Expand Up @@ -152,7 +153,8 @@ def _create_config(self):
"min_instances": cluster_min_instances,
"max_instances": cluster_max_instances,
"instance_type": cluster_instance_type,
"key_name": key_name
"key_name": key_name,
"instance_root_volume": instance_root_volume
},
"environment": {
"notifications_arn": notifications_arn,
Expand Down Expand Up @@ -253,12 +255,14 @@ def _validate_changes(self, configuration):
"max_instances": {"type": "integer"},
"instance_type": {"type": "string"},
"key_name": {"type": "string"},
"instance_root_volume": {"type": "integer"}
},
"required": [
"min_instances",
"max_instances",
"instance_type",
"key_name"
"key_name",
"instance_root_volume"
]
},
"environment": {
Expand Down
19 changes: 18 additions & 1 deletion cloudlift/deployment/cluster_template_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,17 @@ def _add_ec2_auto_scaling(self):
SecurityGroupIds=[GetAtt(self.sg_hosts, 'GroupId')],
InstanceType=Ref('InstanceType'),
ImageId=FindInMap("AWSRegionToAMI", Ref("AWS::Region"), "AMI"),
KeyName=Ref(self.key_pair)
Metadata=lc_metadata,
KeyName=Ref(self.key_pair),
BlockDeviceMappings=[
{
"DeviceName": "/dev/xvda",
"Ebs": {
"VolumeSize": Ref("InstanceRootVolume"),
"VolumeType": "gp3"
}
}
]
)
launch_template = LaunchTemplate(
"LaunchTemplate",
Expand Down Expand Up @@ -657,6 +667,9 @@ def _add_cluster_parameters(self):
Type="String",
Default=self.notifications_arn)
self.template.add_parameter(self.notification_sns_arn)
self.instance_root_volume = Parameter("InstanceRootVolume", Description="Root device volume size in GB's", Type="Number", Default=str(
self.configuration['cluster']['instance_root_volume']))
self.template.add_parameter(self.instance_root_volume)
self.template.add_parameter(Parameter(
"InstanceType", Description='', Type="String", Default=self.configuration['cluster']['instance_type']))

Expand Down Expand Up @@ -771,6 +784,7 @@ def _add_metadata(self):
'MinSize',
'MaxSize',
'InstanceType',
'InstanceRootVolume',
'VPC',
'Subnet1',
'Subnet2',
Expand All @@ -785,6 +799,9 @@ def _add_metadata(self):
'InstanceType': {
'default': 'Type of instance'
},
'InstanceRootVolume': {
'default': 'Root Volume Size'
},
'KeyPair': {
'default': 'Select the key with which you want to login to the ec2 instances'},
'MaxSize': {
Expand Down
2 changes: 1 addition & 1 deletion cloudlift/version/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '1.5.2'
VERSION = '1.5.3'