-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #566 from alpineriveredge/add-type-db-cluster
Add RDS DB Cluster & Global Cluster
- Loading branch information
Showing
29 changed files
with
964 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
### first | ||
|
||
```ruby | ||
describe rds_db_cluster('my-rds-db-cluster') do | ||
its(:db_cluster_parameter_group) { should eq 'default.aurora-mysql5.7' } | ||
its(:engine) { should eq 'aurora-mysql' } | ||
its(:engine_version) { should eq '5.7.mysql_aurora.2.10.2' } | ||
its(:database_name) { should eq 'example_db' } | ||
its(:storage_encrypted) { should eq false } | ||
its(:deletion_protection) { should eq false } | ||
end | ||
``` | ||
|
||
### exist | ||
|
||
```ruby | ||
describe rds_db_cluster('my-rds-db-cluster') do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
### be_available, be_creating, be_deleting | ||
|
||
```ruby | ||
describe rds_db_cluster('my-rds-db-cluster') do | ||
it { should be_available } | ||
end | ||
``` | ||
|
||
### have_cluster_member | ||
|
||
```ruby | ||
describe rds_db_cluster('my-rds-db-cluster') do | ||
it { should have_cluster_member('my-rds-db-cluster-instance-1') } | ||
it { should have_cluster_member('my-rds-db-cluster-instance-1').is_writer(true) } | ||
it { should have_cluster_member('my-rds-db-cluster-instance-2').is_writer(false) } | ||
end | ||
``` | ||
|
||
### have_security_group | ||
|
||
```ruby | ||
describe rds_db_cluster('my-rds-db-cluster') do | ||
it { should have_security_group('sg-5a6b7cd8') } | ||
it { should have_security_group('my-db-sg') } | ||
end | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
### exist | ||
|
||
```ruby | ||
describe rds_db_subnet_group('my-rds-db-subnet-group') do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
### belong_to_subnet | ||
|
||
```ruby | ||
describe rds_db_subnet_group('my-rds-db-subnet-group') do | ||
it { should belong_to_subnet('subnet-1234a567') } | ||
it { should belong_to_subnet('db-subnet-a') } | ||
end | ||
``` | ||
|
||
### belong_to_vpc | ||
|
||
```ruby | ||
describe rds_db_subnet_group('my-rds-db-subnet-group') do | ||
it { should belong_to_vpc('vpc-ab123cde') } | ||
it { should belong_to_vpc('my-vpc') } | ||
end | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
### first | ||
|
||
```ruby | ||
describe rds_global_cluster('my-rds-global-cluster') do | ||
its(:engine) { should eq 'aurora-mysql' } | ||
its(:engine_version) { should eq '5.7.mysql_aurora.2.10.2' } | ||
its(:database_name) { should eq 'example_db' } | ||
its(:storage_encrypted) { should eq false } | ||
its(:deletion_protection) { should eq false } | ||
end | ||
``` | ||
|
||
### exist | ||
|
||
```ruby | ||
describe rds_global_cluster('my-rds-global-cluster') do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
### be_available, be_creating, be_deleting | ||
|
||
```ruby | ||
describe rds_global_cluster('my-rds-global-cluster') do | ||
it { should be_available } | ||
end | ||
``` | ||
|
||
### have_cluster_member | ||
|
||
```ruby | ||
describe rds_global_cluster('my-rds-global-cluster') do | ||
it { should have_cluster_member('arn:aws:rds:ap-northeast-1:123456789012:cluster:my-primary-cluster') } | ||
it { should have_cluster_member('arn:aws:rds:ap-northeast-1:123456789012:cluster:my-primary-cluster').is_writer(true) } | ||
it { should have_cluster_member('arn:aws:rds:ap-northeast-3:123456789012:cluster:my-secondary-cluster').is_writer(false) } | ||
end | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Awspec::Generator | ||
module Doc | ||
module Type | ||
class RdsDbCluster < Base | ||
def initialize | ||
super | ||
@type_name = 'RdsDbCluster' | ||
@type = Awspec::Type::RdsDbCluster.new('my-rds-db-cluster') | ||
@ret = @type.resource_via_client | ||
@matchers = [ | ||
Awspec::Type::RdsDbCluster::STATES.map { |state| "be_#{state.tr('-', '_')}" }.join(', ') | ||
] | ||
@ignore_matchers = Awspec::Type::RdsDbCluster::STATES.map { |state| "be_#{state.tr('-', '_')}" } | ||
@describes = [] | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
module Awspec::Generator | ||
module Doc | ||
module Type | ||
class RdsDbSubnetGroup < Base | ||
def initialize | ||
super | ||
@type_name = 'RdsDbSubnetGroup' | ||
@type = Awspec::Type::RdsDbSubnetGroup.new('my-rds-db-subnet-group') | ||
@ret = @type.resource_via_client | ||
@matchers = %w[belong_to_vpc belong_to_subnet] | ||
@ignore_matchers = [] | ||
@describes = %w[vpc_id] | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Awspec::Generator | ||
module Doc | ||
module Type | ||
class RdsGlobalCluster < Base | ||
def initialize | ||
super | ||
@type_name = 'RdsGlobalCluster' | ||
@type = Awspec::Type::RdsGlobalCluster.new('my-rds-global-cluster') | ||
@ret = @type.resource_via_client | ||
@matchers = [ | ||
Awspec::Type::RdsGlobalCluster::STATES.map { |state| "be_#{state.tr('-', '_')}" }.join(', ') | ||
] | ||
@ignore_matchers = Awspec::Type::RdsGlobalCluster::STATES.map { |state| "be_#{state.tr('-', '_')}" } | ||
@describes = [] | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.