Exemplo n.º 1
0
def test_dispose_db_cluster():
    client = RDSClient()
    cluster = RDSDBCluster({})
    cluster.region = AWSAccount.get_aws_region()

    cluster.skip_final_snapshot = True
    cluster.id = "cluster-db-test"

    client.dispose_db_cluster(cluster)
Exemplo n.º 2
0
    def get_region_db_clusters(self, region, filters=None, update_tags=True):
        final_result = list()
        if filters is not None:
            filters = {"Filters": filters}

        AWSAccount.set_aws_region(region)
        for response in self.execute(self.client.describe_db_clusters,
                                     "DBClusters",
                                     filters_req=filters):
            obj = RDSDBCluster(response)
            final_result.append(obj)

        if update_tags:
            self.update_tags(final_result)

        return final_result
Exemplo n.º 3
0
def test_provision_cluster_from_snapshot():
    client = RDSClient()
    cluster = RDSDBCluster({})
    cluster.region = AWSAccount.get_aws_region()

    cluster.db_subnet_group_name = "db_subnet-test"
    cluster.db_cluster_parameter_group_name = "cluster-param-group-test"
    cluster.backup_retention_period = 35
    cluster.database_name = "db_test"
    cluster.id = "cluster-db-test"
    cluster.vpc_security_group_ids = [
        mock_values["cluster.vpc_security_group_ids"]
    ]
    cluster.engine = "aurora-mysql"
    cluster.engine_version = "5.7.mysql_aurora.2.09.2"
    cluster.port = 3306

    cluster.master_username = "******"
    cluster.master_user_password = "******"
    cluster.preferred_backup_window = "09:23-09:53"
    cluster.preferred_maintenance_window = "sun:03:30-sun:04:00"
    cluster.storage_encrypted = True
    #cluster.kms_key_id = True
    cluster.engine_mode = "provisioned"

    cluster.deletion_protection = False
    cluster.copy_tags_to_snapshot = True
    cluster.enable_cloudwatch_logs_exports = [
        "audit", "error", "general", "slowquery"
    ]

    cluster.tags = [{
        'Key': 'lvl',
        'Value': "tst"
    }, {
        'Key': 'name',
        'Value': cluster.id
    }]

    client.provision_db_cluster(cluster, snapshot_id="horey-test-snapshot-id")

    assert cluster.arn is not None