Commit Graph

62 Commits

Author SHA1 Message Date
Bert Blommers
1a8ddc0f2b
Techdebt: Replace string-format with f-strings (for tests dirs) () 2022-11-17 21:41:08 -01:00
Bert Blommers
3d913f8f15
MultiAccount support () 2022-08-13 09:49:43 +00:00
Bert Blommers
29d01c35bc
Update Black + formatting () 2022-03-10 13:39:59 -01:00
mgshirali
60e26e5892
These changes address issue 4834. () 2022-02-07 14:10:12 -01:00
Bert Blommers
aa70ee254d
Remove deprecated decorators + boto dependency () 2022-01-18 14:18:57 -01:00
Bert Blommers
82588b2638
Redshift - Pause/Resume clusters () 2021-12-15 19:00:19 -01:00
Sanjay Srivatsa
878f150141
Add support for NodeType & NumberOfNodes update during redshift cluster restore from snapshot ()
Fixes 
2021-12-14 17:51:53 -08:00
Bert Blommers
14a69c7524
Techdebt: Enable pylint rules () 2021-10-18 19:44:29 +00:00
nom3ad
f50d80ede6
fix: invalid escape sequence DeprecationWarning () 2021-10-18 09:21:18 +00:00
Bert Blommers
e9a4100324
Rewrite deprecated CloudFormation tests () 2021-10-04 13:47:40 +00:00
Bert Blommers
953be7682b
Rewrite deprecated Redshift tests () 2021-09-23 13:29:11 +00:00
Bert Blommers
7acdfe4feb
Introduce Pylint to check for duplicate test method names () 2021-08-21 16:33:15 +01:00
usmangani1
433e4c0733
Fix:Add functionality authorize-cluster-security-group-ingress ()
* Fix:Add functionality  authorize-cluster-security-group-ingress

* Added tests

* Added more test cases
2021-03-10 08:46:13 +00:00
John Flores
791bc77f3a
Add KmsKeyId to Redshift Cluster ()
* Add KmsKeyId to Redshift Cluster

Add the KmsKeyId property when creating a cluster so that it is also
returned when querying the describe_clusters endpoint.

* Run black on updated files

* Add unit test for Redshift KmsKeyId

* Re-run black with correct version
2021-02-08 18:52:47 +00:00
Andrea Amorosi
5a41866f71
Added redshift.get_cluster_credentials ()
* Added redshift.get_cluster_credentials

* Marked endpoint in list

* Removed f string from tests

* Python 2.7 compat changes

* Fixed parameter retrieval

* Formatting

* Removed try/catch in favor of if

* Changed to existing random_string util

Co-authored-by: Andrea Amorosi <aamorosi@amazon.es>
2021-01-25 13:19:50 +00:00
Brian Pandola
dcd034045b
Fix: ClusterType, NumberOfNodes not validated when modifying Redshift cluster ()
By definition, `single-node` clusters can only consist of 1 node. Likewise,
`multi-node` clusters must have 2 or more nodes.

* Ensure `ClusterType` parameter is either `multi-node` or `single-node`.
* Ensure proper validation of `NumberOfNodes` parameter based on `ClusterType`
  parameter.
* Fix existing test case that incorrectly allowed a `multi-node` cluster to
  consist of 1 node.
* Add dedicated test for resizing a cluster from `single-node` to `multi-node`
  and back again.

Behavior and error messages have been verified against a real AWS backend.
2020-12-04 13:22:19 +00:00
Brian Pandola
5a2cbf1eca Fix: Duplicate test name causing loss of coverage
A test added in  copied the name of an existing test, preventing it
from being run.  This commit renames the second test, allowing both to
be picked up by the test runner.
2020-11-24 03:29:52 -08:00
Brian Pandola
cf7869d0e2 Add check for UnknownSnapshotCopyRegionFault error 2020-11-24 03:29:52 -08:00
Brian Pandola
b4d7d183ab Add additional detail to ClientError assertions
We check the message now to ensure we've raised the *correct* ClientError
2020-11-24 03:29:52 -08:00
Brian Pandola
49c6e65603 Fix: DeleteCluster behavior with SkipFinalClusterSnapshot
Original code was trying to raise a ClientError directly.  Change to
appropriate Redshift exception class.

* Fix test assertion for `boto`.
* Add test coverage for `boto3`.
2020-11-24 03:29:52 -08:00
Brian Pandola
555be78f6e Fix: redshift:DescribeClusterSnapshots should not raise ClusterNotFoundError
Real AWS backend returns an empty array instead of raising an error.
2020-11-24 03:29:52 -08:00
Brian Pandola
161cb46886 Add coverage for ContentType=JSON server requests
The `boto` library explicitly requests JSON responses from Redshift endpoints
2020-11-24 03:29:52 -08:00
Brian Pandola
4245497a97
Fix: redshift:EnableSnapshotCopy raises incorrect Exception ()
The previous code was trying to raise a botocore ClientError directly, which
was actually generating a secondary AttributeError because the arguments passed
to ClientError() were incorrect.

This replaces the ClientError() call with a proper moto exception class for
Redshift and fixes the test assertions appropriately.

Supersedes 
2020-11-21 10:35:46 +00:00
Matěj Cepl
77dc60ea97 Port test suite from nose to pytest.
This just eliminates all errors on the tests collection. Elimination of
failures is left to the next commit.
2020-11-10 08:23:44 +01:00
Brian Pandola
55f207050e Add Redshift.ClusterAlreadyExists Error
Closes 
2020-05-06 14:28:40 -07:00
Fabio Dias
743dd46399 black linting 2019-12-16 21:25:20 -05:00
Fabio Dias
fd9ac4b9a5 ACCOUNT_ID moved to moto.core, MOTO_ACCOUNT_ID env var override 2019-12-16 21:05:29 -05:00
Fabio Dias
b83a750630 Added references to moto.iam.models.ACCOUNT_ID instead of hardcoded id 2019-12-16 19:56:11 -05:00
Asher Foa
96e5b1993d Run black on moto & test directories. 2019-10-31 10:36:05 -07:00
rocky4570
ff27e021bc add enhanced vpc routing option to redshift moto
EnhancedVpcRouting is only available when mock_redshift not mock_redshift_deprecated
2019-09-01 00:34:18 +10:00
Iiro Sulopuisto
8cca33dc42 Test redshift cluster creation time more thoroughly 2019-07-30 14:14:14 +03:00
David
868d0107bf Autoscaling instance azs ()
* Add instance AZ support in autoscaling

* Resolve py36-py27 format string error in test_autoscaling
2019-05-25 11:18:16 +01:00
Dan Chan
2a5f7e15a7 Updating redshift.describe_cluster_snapshots to return multiple snapshots for cluster_identifier () 2019-05-23 09:01:47 +01:00
redspart
1fd71fd45a Updated delete_cluster() for redshift ()
* Updated the deprecated decorator to allow the "SkipFinalClusterSnapshot" option that aws supports.

* FIxed logical mistake on the delete_cluster

* Removed an unused exception I put in
2019-05-20 23:56:23 +01:00
Brian Pandola
c6f5e816cc Add ClusterCreateTime to Redshift response
Fixes 
2018-08-20 18:48:13 -07:00
Brian Pandola
e1d9c2878f Add support for Redshift.Waiter.ClusterRestored
* Add `restored_from_snapshot` boolean to Cluster metadata.
* Return `RestoreStatus` from describe_db_clusters if cluster was restored from a snapshot.

Fixes 
2018-04-24 17:30:17 -07:00
Steve Pulec
4997694fd6
Merge pull request from andharris/iam-roles
add iam roles to redshift
2018-03-07 09:28:26 -05:00
Steve Pulec
8a0cf49b7d
Merge branch 'master' into redshift-copy-grants 2018-03-06 22:11:34 -05:00
andrew
7d3af65f22 fix errors 2018-02-23 14:42:49 -05:00
andrew
6ab416724a WIP: add iam roles to redshift 2018-02-22 14:58:19 -05:00
captainkerk
e514b98747 redshift: add copy grant functionality 2018-01-28 22:58:28 +00:00
captainkerk
7130dd5239 rework to follow spec for encrypted/unencrypted clusters 2018-01-28 04:16:21 +00:00
captainkerk
ed06658271 address spacing issues 2018-01-28 04:16:21 +00:00
captainkerk
d8b124fbf4 added: enable/disable/modify redshift snapshot copy methods 2018-01-28 04:16:21 +00:00
Terry Cain
bd8c1e4567
adding owner id to amis v2 ()
* Adding owner-id/OwnerId to the AMI classes to allow the value to be specified to test filtering images based on owner.

* Added default AMIs and filtering by owner-id

* Fixed some tests

* Fixed more random tests

* Updated MANIFEST

* .
2017-11-12 11:18:25 +00:00
Brian Pandola
ab595279ad Fix boto/boto3 multi-param discrepancies
boto uses the param.member.N syntax, but boto3 replaces the generic
.member with a more specific identifier.

Example:
boto: ClusterSecurityGroups.member.N
boto3: ClusterSecurityGroups.ClusterSecurityGroupName.N

This commit addresses this issue for the ClusterSecurityGroups, SubnetIds,
and VpcSecurityGroupIds parameters.
2017-09-30 21:51:05 -07:00
Brian Pandola
5bb6b98f6d Implement Redshift Taggable Resources ()
- Implement create_tags, describe_tags, and delete_tags endpoints
- Clusters, Parameter Groups, Security Groups, Snapshots, and Subnet Groups can all be tagged
- Test Suite updated
- Minor clean-up of restore_from_cluster_snapshot endpoint
- Miscellaneous typo fixes
2017-09-27 17:18:28 -07:00
Brian Pandola
0a03a7237e Redshift Updates
- Implement create_cluster_snapshot endpoint
- Implement describe_cluster_snapshots endpoint
- Implement delete_cluster_snapshot endpoint
- Implement restore_from_cluster_snapshot endpoint
- Implement limited support for describe_tags endpoint
- Correctly serialize errors to json (for boto) or xml (for boto3)
- Simulate cluster spin up by returning initial status as 'creating' and subsequent statuses as 'available'
- Fix issue with modify_cluster endpoint where cluster values get set to None when omitted from request
- Add 'Endpoint' key to describe_clusters response syntax
2017-08-09 18:43:21 -07:00
Jack Danger
5011cd28b6 Allow boto3 redshift cluster subnet group creation
Boto3 deviates from the AWS docs in the way subnets are described when
creating a Redshift cluster subnet group.

This entry in botocore nests the SubnetIds under SubnetIdentifier tags:
https://github.com/boto/botocore/blob/develop/botocore/data/redshift/2012-12-01/service-2.json#L5423-L5429
referenced here:
https://github.com/boto/botocore/blob/develop/botocore/data/redshift/2012-12-01/service-2.json#L2296

And the AWS docs do not nest them that way:
https://docs.aws.amazon.com/redshift/latest/APIReference/API_CreateClusterSubnetGroup.html

Fixes 
2017-08-02 11:48:12 -07:00
Steve Pulec
6666351757 Fix redshift server to default to xml. 2017-03-15 22:05:11 -04:00