mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #28561 from Oro/fix-boto-rds-create
Issue #28527 boto_rds.create does not work
This commit is contained in:
commit
fed4c6f482
1 changed files with 4 additions and 10 deletions
|
@ -171,7 +171,7 @@ def subnet_group_exists(name, tags=None, region=None, key=None, keyid=None,
|
|||
return False
|
||||
|
||||
|
||||
def create(name, allocated_storage, storage_type, db_instance_class, engine,
|
||||
def create(name, allocated_storage, db_instance_class, engine,
|
||||
master_username, master_user_password, db_name=None,
|
||||
db_security_groups=None, vpc_security_group_ids=None,
|
||||
availability_zone=None, db_subnet_group_name=None,
|
||||
|
@ -187,21 +187,15 @@ def create(name, allocated_storage, storage_type, db_instance_class, engine,
|
|||
|
||||
CLI example to create an RDS::
|
||||
|
||||
salt myminion boto_rds.create myrds 10 db.t2.micro MySQL sqlusr sqlpass
|
||||
salt myminion boto_rds.create myrds 10 db.t2.micro MySQL sqlusr sqlpassw
|
||||
'''
|
||||
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
|
||||
|
||||
if __salt__['boto_rds.exists'](name, tags, region, key, keyid, profile):
|
||||
return True
|
||||
|
||||
a_s = ['standard', 'gp2', 'io1']
|
||||
if not allocated_storage:
|
||||
raise SaltInvocationError('allocated_storage is required')
|
||||
if not storage_type:
|
||||
raise SaltInvocationError('storage_type is required')
|
||||
if storage_type not in a_s:
|
||||
raise SaltInvocationError('storage_type must be one of: '
|
||||
'{0}'.format(", ".join(str(e) for e in a_s)))
|
||||
if not db_instance_class:
|
||||
raise SaltInvocationError('db_instance_class is required')
|
||||
if not engine:
|
||||
|
@ -231,7 +225,7 @@ def create(name, allocated_storage, storage_type, db_instance_class, engine,
|
|||
preferred_backup_window, port, multi_az,
|
||||
engine_version,
|
||||
auto_minor_version_upgrade,
|
||||
license_model, storage_type, iops,
|
||||
license_model, iops,
|
||||
option_group_name, character_set_name,
|
||||
publicly_accessible, tags)
|
||||
if not rds:
|
||||
|
@ -253,7 +247,7 @@ def create(name, allocated_storage, storage_type, db_instance_class, engine,
|
|||
|
||||
except boto.exception.BotoServerError as e:
|
||||
log.debug(e)
|
||||
msg = 'Failed to create RDS {0}'.format(name)
|
||||
msg = 'Failed to create RDS {0}, reason: {1}'.format(name, e.body)
|
||||
log.error(msg)
|
||||
return False
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue