Skip to content

Commit

Permalink
Merge pull request #392 from mmojzis/instance_change_type
Browse files Browse the repository at this point in the history
[RFR]EC2Instance change instance type method
  • Loading branch information
mshriver authored Jun 20, 2019
2 parents 70213c9 + aa1786f commit 3fb310d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wrapanapi/systems/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ def restart(self):
self.logger.error("Starting instance '%s' failed or timed out", self.uuid)
return stopped and started

def change_type(self, instance_type):
try:
self.raw.modify_attribute(InstanceType={'Value': instance_type})
return True
except Exception:
return False

class StackStates(object):
ACTIVE = ['CREATE_COMPLETE', 'ROLLBACK_COMPLETE', 'CREATE_FAILED',
Expand Down

0 comments on commit 3fb310d

Please sign in to comment.