#2810 - EC2 - Explicitly set ebs_optimized to False if not specified

This commit is contained in:
Bert Blommers 2020-03-24 09:24:38 +00:00
parent 66b26cd7b0
commit 11526ced18
2 changed files with 7 additions and 1 deletions

View File

@ -52,7 +52,7 @@ class InstanceResponse(BaseResponse):
private_ip = self._get_param("PrivateIpAddress")
associate_public_ip = self._get_param("AssociatePublicIpAddress")
key_name = self._get_param("KeyName")
ebs_optimized = self._get_param("EbsOptimized")
ebs_optimized = self._get_param("EbsOptimized") or False
instance_initiated_shutdown_behavior = self._get_param(
"InstanceInitiatedShutdownBehavior"
)

View File

@ -1319,6 +1319,12 @@ def test_create_instance_ebs_optimized():
instance.load()
instance.ebs_optimized.should.be(False)
instance = ec2_resource.create_instances(
ImageId="ami-12345678", MaxCount=1, MinCount=1,
)[0]
instance.load()
instance.ebs_optimized.should.be(False)
@mock_ec2
def test_run_multiple_instances_in_same_command():