Connection module for Amazon RDS
New in version 2015.8.0.
This module accepts explicit rds credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html
If IAM roles are not used you need to specify them either in a pillar or in the minion's config file:
rds.keyid: GKTADJGHEIQSXMKKRBJ08H
rds.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
A region may also be specified in the configuration:
rds.region: us-east-1
If a region is not specified, the default is us-east-1.
It's also possible to specify key, keyid and region via a profile, either as a passed in dict, or as a string to pull from pillars or minion config:
myprofile:
keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
region: us-east-1
boto3
Create an RDS Instance
CLI example to create an RDS Instance:
salt myminion boto_rds.create myrds 10 db.t2.micro MySQL sqlusr sqlpassw
Create an RDS option group
CLI example to create an RDS option group:
salt myminion boto_rds.create_option_group my-opt-group mysql 5.6 "group description"
Create an RDS parameter group
CLI example to create an RDS parameter group:
salt myminion boto_rds.create_parameter_group my-param-group mysql5.6 "group description"
Create an RDS read replica
CLI example to create an RDS read replica:
salt myminion boto_rds.create_read_replica replicaname source_name
Create an RDS subnet group
CLI example to create an RDS subnet group:
salt myminion boto_rds.create_subnet_group my-subnet-group "group description" '[subnet-12345678, subnet-87654321]' region=us-east-1
Delete an RDS instance.
CLI Example:
salt myminion boto_rds.delete myrds skip_final_snapshot=True region=us-east-1
Delete an RDS option group.
CLI Example:
salt myminion boto_rds.delete_option_group my-opt-group region=us-east-1
Delete an RDS parameter group.
CLI Example:
salt myminion boto_rds.delete_parameter_group my-param-group region=us-east-1
Delete an RDS subnet group.
CLI Example:
salt myminion boto_rds.delete_subnet_group my-subnet-group region=us-east-1
Return RDS instance details.
CLI Example:
salt myminion boto_rds.describe myrds
Return a detailed listing of some, or all, DB Instances visible in the current scope. Arbitrary subelements or subsections of the returned dataset can be selected by passing in a valid JMSEPath filter as well.
CLI Example:
salt myminion boto_rds.describe_db_instances jmespath='DBInstances[*].DBInstanceIdentifier'
Return a detailed listing of some, or all, DB Subnet Groups visible in the current scope. Arbitrary subelements or subsections of the returned dataset can be selected by passing in a valid JMSEPath filter as well.
CLI Example:
salt myminion boto_rds.describe_db_subnet_groups
Returns a list of DBParameterGroup descriptions. CLI example to description of parameter group:
salt myminion boto_rds.describe_parameter_group parametergroupname region=us-east-1
Returns a list of DBParameterGroup parameters. CLI example to description of parameters
salt myminion boto_rds.describe_parameters parametergroupname region=us-east-1
Check to see if an RDS exists.
CLI Example:
salt myminion boto_rds.exists myrds region=us-east-1
Return the endpoint of an RDS instance.
CLI Example:
salt myminion boto_rds.get_endpoint myrds
Modify settings for a DB instance. CLI example to description of parameters
salt myminion boto_rds.modify_db_instance db_instance_identifier region=us-east-1
Check to see if an RDS option group exists.
CLI Example:
salt myminion boto_rds.option_group_exists myoptiongr region=us-east-1
Check to see if an RDS parameter group exists.
CLI Example:
salt myminion boto_rds.parameter_group_exists myparametergroup region=us-east-1
Check to see if an RDS subnet group exists.
CLI Example:
salt myminion boto_rds.subnet_group_exists my-param-group region=us-east-1
Update an RDS parameter group.
CLI Example:
salt myminion boto_rds.update_parameter_group my-param-group parameters='{"back_log":1, "binlog_cache_size":4096}' region=us-east-1