-
-
Notifications
You must be signed in to change notification settings - Fork 192
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 #347 from inokappa/add_generate_db_parameter_group
Add DB Parameter Group and DB Cluster Parameter Group Generator
- Loading branch information
Showing
7 changed files
with
90 additions
and
28 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
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
23 changes: 23 additions & 0 deletions
23
lib/awspec/generator/spec/rds_db_cluster_parameter_group.rb
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,23 @@ | ||
module Awspec::Generator | ||
module Spec | ||
class RdsDbClusterParameterGroup | ||
include Awspec::Helper::Finder | ||
def generate_by_paramater_group(paramater_group) | ||
@paramater_group = paramater_group | ||
res = select_all_rds_db_cluster_parameters(@paramater_group) | ||
ERB.new(db_cluster_parameter_group_template, nil, '-').result(binding).gsub(/^\n/, '') | ||
end | ||
|
||
def db_cluster_parameter_group_template | ||
template = <<-'EOF' | ||
describe rds_db_cluster_parameter_group('<%= @paramater_group %>') do | ||
<% res.each do |key, value| %> | ||
its('<%= key %>') { should eq '<%= value %>' } | ||
<% end %> | ||
end | ||
EOF | ||
template | ||
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,23 @@ | ||
module Awspec::Generator | ||
module Spec | ||
class RdsDbParameterGroup | ||
include Awspec::Helper::Finder | ||
def generate_by_paramater_group(paramater_group) | ||
@paramater_group = paramater_group | ||
res = select_all_rds_db_parameters(@paramater_group) | ||
ERB.new(db_paramater_group_template, nil, '-').result(binding).gsub(/^\n/, '') | ||
end | ||
|
||
def db_paramater_group_template | ||
template = <<-'EOF' | ||
describe rds_db_parameter_group('<%= @paramater_group %>') do | ||
<% res.each do |key, value| %> | ||
its('<%= key %>') { should eq '<%= value %>' } | ||
<% end %> | ||
end | ||
EOF | ||
template | ||
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
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