New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New AWS module to manage RDS Clusters #19782

Open
wants to merge 8 commits into
base: devel
from

Conversation

Projects
None yet
10 participants
@naslanidis
Contributor

naslanidis commented Jan 2, 2017

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

rds_cluster

ANSIBLE VERSION
ansible 2.2.0 (devel e396d5d508) last updated 2016/08/24 12:13:10 (GMT +1000)
  lib/ansible/modules/core: (detached HEAD 368ca738fa) last updated 2016/08/24 12:13:21 (GMT +1000)
  lib/ansible/modules/extras: (detached HEAD 0749ce6faa) last updated 2016/08/24 12:13:30 (GMT +1000)
SUMMARY

This module manages the creation, modification, deletion, snapshot and restore of RDS Clusters for Aurora instances in AWS.

TASK [print new Aurora RDS cluster] ********************************************
ok: [localhost] => {
    "msg": {
        "changed": true, 
        "rds": {
            "DBClusters": [
                {
                    "AllocatedStorage": 1, 
                    "AvailabilityZones": [
                        "ap-southeast-2a", 
                        "ap-southeast-2b", 
                        "ap-southeast-2c"
                    ], 
                    "BackupRetentionPeriod": 10, 
                    "DBClusterIdentifier": "test-aurora-cluster", 
                    "DBClusterMembers": [], 
                    "DBClusterParameterGroup": "test-aurora-param-group", 
                    "DBSubnetGroup": "aag-vpc-99-sbg-rds-green", 
                    "DbClusterResourceId": "cluster-TQILXHYILLHWNEPZLLHWNEC5Q", 
                    "EarliestRestorableTime": "2016-08-28T23:24:54.858000+00:00", 
                    "Endpoint": "test-aurora-cluster.cluster-c41234a2bug.ap-southeast-2.rds.amazonaws.com", 
                    "Engine": "aurora", 
                    "EngineVersion": "5.6.10a", 
                    "HostedZoneId": "Z32T0VXXXEXS0V", 
                    "KmsKeyId": "arn:aws:kms:ap-southeast-2:486509402765:key/1b184ef4-1234-5678-a0f0-d5970a9f8e21", 
                    "LatestRestorableTime": "2016-08-28T23:24:54.858000+00:00", 
                    "MasterUsername": "testuser", 
                    "Port": 3306, 
                    "PreferredBackupWindow": "15:35-16:05", 
                    "PreferredMaintenanceWindow": "sun:18:34-sun:19:04", 
                    "Status": "available", 
                    "StorageEncrypted": true, 
                    "VpcSecurityGroups": [
                        {
                            "Status": "active", 
                            "VpcSecurityGroupId": "sg-d111c7b6"
                        }
                    ]
                }
            ], 
            "ResponseMetadata": {
                "HTTPStatusCode": 200, 
                "RequestId": "ab1de429-6d76-11e6-9d17-df1f331e0454"
            }
        }
    }
}
@naslanidis

This comment has been minimized.

Contributor

naslanidis commented Jan 2, 2017

@willthames

This comment has been minimized.

Contributor

willthames commented Jan 5, 2017

Removed my duplicate comment - it would likely be better for this to be the canonical reference so that @naslanidis can manage his own PR. I'll add the duplicate note to the other one.

short_description: Manages RDS Clusters for Aurora instances
description:
-Manages the creation, modification, deletion, snapshot and restore of RDS Clusters for Aurora instances in AWS
version_added: "2.2"

This comment has been minimized.

@ryansb

ryansb Jan 10, 2017

Contributor

Needs to be bumped to 2.3

- absent to remove resource
required: true
default: None
choices: [ 'create', 'delete', 'modify', 'snapshot', 'restore' ]

This comment has been minimized.

@ryansb

ryansb Jan 10, 2017

Contributor

Instead of command this module should use state= and present/absent. Having a command= like this means playbooks won't be idempotent. Also the docs don't match the choices specified.

'apply_immediately': 'ApplyImmediately',
'snapshot_identifer': 'SnapshotIdentifier'}
for (k, v) in camel_params.iteritems():

This comment has been minimized.

@ryansb

ryansb Jan 10, 2017

Contributor

Should be for k, v in camel_params.items() as .iteritems isn't universal.

tag_array = []
if module.params.get('tags'):
for tag, value in module.params.get('tags').iteritems():

This comment has been minimized.

@ryansb

ryansb Jan 10, 2017

Contributor

Should be for tag, value in module.params.get('tags').items() as .iteritems isn't universal.

@mattclay

This comment has been minimized.

Member

mattclay commented Feb 1, 2017

CI failure due to:

2017-02-01 18:53:00 iteritems has been removed in python3.  Alternatives:
2017-02-01 18:53:00     for KEY, VALUE in DICT.items():
2017-02-01 18:53:00     from ansible.module_utils.six import iteritems ; for KEY, VALUE in iteritems(DICT):
2017-02-01 18:53:00     from ansible.compat.six import iteritems ; for KEY, VALUE in iteritems(DICT):
2017-02-01 18:53:00 ./lib/ansible/modules/cloud/amazon/rds_cluster.py:    for (k, v) in camel_params.iteritems():
2017-02-01 18:53:00 ./lib/ansible/modules/cloud/amazon/rds_cluster.py:        for tag, value in module.params.get('tags').iteritems():

@mattclay mattclay added the ci_verified label Feb 1, 2017

@ansibot ansibot added the stale_ci label Apr 11, 2017

@msmith93

This comment has been minimized.

msmith93 commented Jun 14, 2017

Is this PR currently being worked on? This would be useful for our deployments

@steaksauce-

This comment has been minimized.

Contributor

steaksauce- commented Feb 17, 2018

I think we can say this PR is dead. The contributor @naslanidis doesn't appear to have been active on GitHub for quite sometime. If it is a matter of making the changes that @ryansb requested, let's go ahead and make the changes. However, it has been sitting here long enough that some other changes may need to be made.

@bansalKeshav

This comment has been minimized.

bansalKeshav commented Jun 12, 2018

Is someone is contributing to some similar module?
@ryansb @naslanidis
As I am looking for something similar and found this as the base, So looking to update it.

@willthames

This comment has been minimized.

Contributor

willthames commented Jun 12, 2018

@bansalKeshav feel free to update. I'd suggest having a look at #30746 too, which has the more recent, but as yet unmerged, rds_instance module as a reasonable point of reference - it applies some of the principles around state management that @ryansb mentions.

The AWS module guidelines are the other thing to bear in mind.

Once you have a new PR ready, let us know here and we'll close this one off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment