예제 #1
0
def parse_args(args=sys.argv[1:]):

    stack_names = all_stack_names()
    rds = boto.rds2.connect_to_region('us-east-1')
    dbs = [db['DBInstanceIdentifier']
           for db in rds.describe_db_instances()['DescribeDBInstancesResponse']['DescribeDBInstancesResult']['DBInstances']]

    parser = ArgumentParser(description=description, formatter_class=RawTextHelpFormatter)
    parser.add_argument('-s', '--stack-name', choices=stack_names,
                        default=None,
                        help='Stack name for where you want this RDS instance launched')
    parser.add_argument('-t', '--type', choices=RDS_SIZES,
                        default='db.m1.small', help='RDS size to create instances of')
    parser.add_argument('-d', '--db-source', choices=dbs,
                        default=u'stage-edx', help="source db to clone")
    parser.add_argument('-p', '--password',
                        help="password for the new database", metavar="NEW PASSWORD")
    parser.add_argument('-r', '--region', default='us-east-1',
                        help="region to connect to")
    parser.add_argument('--dns',
                        help="dns entry for the new rds instance")
    parser.add_argument('--clean-wwc', action="store_true",
                        default=False,
                        help="clean the wwc db after launching it into the vpc, removing sensitive data")
    parser.add_argument('--clean-prod-grader', action="store_true",
                        default=False,
                        help="clean the prod_grader db after launching it into the vpc, removing sensitive data")
    parser.add_argument('--dump', action="store_true",
                        default=False,
                        help="create a sql dump after launching it into the vpc")
    parser.add_argument('--secret-var-file',
                        help="using a secret var file run ansible against the host to update db users")

    return parser.parse_args(args)
예제 #2
0
def parse_args(args=sys.argv[1:]):

    stack_names = all_stack_names()
    rds = boto.rds2.connect_to_region('us-east-1')
    dbs = [db['DBInstanceIdentifier']
           for db in rds.describe_db_instances()['DescribeDBInstancesResponse']['DescribeDBInstancesResult']['DBInstances']]

    parser = ArgumentParser(description=description, formatter_class=RawTextHelpFormatter)
    parser.add_argument('--vpc', default=None, action="store_true",
                        help='this is for a vpc')
    parser.add_argument('--security-group', default=None,
                        help='security group name that should be assigned to the new RDS instance (vpc only!)')
    parser.add_argument('--subnet', default=None,
                        help='subnet that should be used for the RDS instance (vpc only!)')
    parser.add_argument('-t', '--type', choices=RDS_SIZES,
                        default='db.m1.small', help='RDS size to create instances of')
    parser.add_argument('-d', '--db-source', choices=dbs,
                        default=u'stage-edx', help="source db to clone")
    parser.add_argument('-p', '--password',
                        help="password for the new database", metavar="NEW PASSWORD")
    parser.add_argument('-r', '--region', default='us-east-1',
                        help="region to connect to")
    parser.add_argument('--dns',
                        help="dns entry for the new rds instance")
    parser.add_argument('--clean-wwc', action="store_true",
                        default=False,
                        help="clean the wwc db after launching it into the vpc, removing sensitive data")
    parser.add_argument('--clean-prod-grader', action="store_true",
                        default=False,
                        help="clean the prod_grader db after launching it into the vpc, removing sensitive data")
    parser.add_argument('--dump', action="store_true",
                        default=False,
                        help="create a sql dump after launching it into the vpc")
    parser.add_argument('-s', '--secret-var-files', action="append", required=True,
                        help="use one or more secret var files to run ansible against the host to update db users")
    parser.add_argument('-o', '--dest-option-group', default="default:mysql-5-6",
                        help="the option group for the new rds.")

    return parser.parse_args(args)
예제 #3
0
def parse_args(args=sys.argv[1:]):

    stack_names = all_stack_names()
    rds = boto.rds2.connect_to_region('us-east-1')
    dbs = [
        db['DBInstanceIdentifier']
        for db in rds.describe_db_instances()['DescribeDBInstancesResponse']
        ['DescribeDBInstancesResult']['DBInstances']
    ]

    parser = ArgumentParser(description=description,
                            formatter_class=RawTextHelpFormatter)
    parser.add_argument(
        '-s',
        '--stack-name',
        choices=stack_names,
        default=None,
        help='Stack name for where you want this RDS instance launched')
    parser.add_argument('-t',
                        '--type',
                        choices=RDS_SIZES,
                        default='db.m1.small',
                        help='RDS size to create instances of')
    parser.add_argument('-d',
                        '--db-source',
                        choices=dbs,
                        default=u'stage-edx',
                        help="source db to clone")
    parser.add_argument('-p',
                        '--password',
                        help="password for the new database",
                        metavar="NEW PASSWORD")
    parser.add_argument('-r',
                        '--region',
                        default='us-east-1',
                        help="region to connect to")
    parser.add_argument('--dns', help="dns entry for the new rds instance")
    parser.add_argument(
        '--clean-wwc',
        action="store_true",
        default=False,
        help=
        "clean the wwc db after launching it into the vpc, removing sensitive data"
    )
    parser.add_argument(
        '--clean-prod-grader',
        action="store_true",
        default=False,
        help=
        "clean the prod_grader db after launching it into the vpc, removing sensitive data"
    )
    parser.add_argument(
        '--dump',
        action="store_true",
        default=False,
        help="create a sql dump after launching it into the vpc")
    parser.add_argument(
        '--secret-var-file',
        help=
        "using a secret var file run ansible against the host to update db users"
    )

    return parser.parse_args(args)
예제 #4
0
def parse_args(args=sys.argv[1:]):

    stack_names = all_stack_names()
    rds = boto.rds2.connect_to_region('us-east-1')
    dbs = [
        db['DBInstanceIdentifier']
        for db in rds.describe_db_instances()['DescribeDBInstancesResponse']
        ['DescribeDBInstancesResult']['DBInstances']
    ]

    parser = ArgumentParser(description=description,
                            formatter_class=RawTextHelpFormatter)
    parser.add_argument('--vpc',
                        default=None,
                        action="store_true",
                        help='this is for a vpc')
    parser.add_argument(
        '--security-group',
        default=None,
        help=
        'security group name that should be assigned to the new RDS instance (vpc only!)'
    )
    parser.add_argument(
        '--subnet',
        default=None,
        help='subnet that should be used for the RDS instance (vpc only!)')
    parser.add_argument('-t',
                        '--type',
                        choices=RDS_SIZES,
                        default='db.m1.small',
                        help='RDS size to create instances of')
    parser.add_argument('-d',
                        '--db-source',
                        choices=dbs,
                        default=u'stage-edx',
                        help="source db to clone")
    parser.add_argument('-p',
                        '--password',
                        help="password for the new database",
                        metavar="NEW PASSWORD")
    parser.add_argument('-r',
                        '--region',
                        default='us-east-1',
                        help="region to connect to")
    parser.add_argument('--dns', help="dns entry for the new rds instance")
    parser.add_argument(
        '--clean-wwc',
        action="store_true",
        default=False,
        help=
        "clean the wwc db after launching it into the vpc, removing sensitive data"
    )
    parser.add_argument(
        '--clean-prod-grader',
        action="store_true",
        default=False,
        help=
        "clean the prod_grader db after launching it into the vpc, removing sensitive data"
    )
    parser.add_argument(
        '--dump',
        action="store_true",
        default=False,
        help="create a sql dump after launching it into the vpc")
    parser.add_argument(
        '-s',
        '--secret-var-files',
        action="append",
        required=True,
        help=
        "use one or more secret var files to run ansible against the host to update db users"
    )
    parser.add_argument('-o',
                        '--dest-option-group',
                        default="default:mysql-5-6",
                        help="the option group for the new rds.")

    return parser.parse_args(args)