Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Commit

Permalink
Changes based on PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
petems committed May 6, 2015
1 parent 2aef727 commit f208cf2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/puppet/provider/rds_db_parameter_group/v2.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative '../../../puppet_z/puppetlabs/aws.rb'
require_relative '../../../puppet_x/puppetlabs/aws.rb'

Puppet::Type.type(:rds_db_parameter_group).provide(:v2, :parent => PuppetX::Puppetlabs::Aws) do
confine feature: :aws
Expand All @@ -24,7 +24,7 @@ def self.db_parameter_group_to_hash(region, db_parameter_group)
:ensure => :present,
:name => db_parameter_group.db_parameter_group_name,
:description => db_parameter_group.description,
:db_parameter_group_family => db_parameter_group.db_parameter_group_family,
:family => db_parameter_group.db_parameter_group_family,
:region => region,
}
end
Expand Down
6 changes: 3 additions & 3 deletions lib/puppet/provider/rds_db_securitygroup/v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def self.db_security_group_to_hash(region, db_security_group)
:ensure => :present,
:region => region,
:name => db_security_group.db_security_group_name,
:db_security_group_description => db_security_group.db_security_group_description,
:description => db_security_group.db_security_group_description,
:owner_id => db_security_group.owner_id,
:ec2_security_groups => ec2_security_group_to_array_of_hashes(db_security_group.ec2_security_groups),
:ec2_securitygroup => ec2_security_group_to_array_of_hashes(db_security_group.ec2_security_groups),
:ip_ranges => ip_ranges_to_array_of_hashes(db_security_group.ip_ranges),
}
end
Expand All @@ -52,7 +52,7 @@ def create
Puppet.info("Creating DB Security Group #{name}")
config = {
:db_security_group_name => resource[:name],
:db_security_group_description => resource[:db_security_group_description],
:db_security_group_description => resource[:description],
}

rds_client(resource[:region]).create_db_security_group(config)
Expand Down
6 changes: 3 additions & 3 deletions lib/puppet/type/rds_db_parameter_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
desc 'the description of a DB parameter group'
end

newproperty(:db_parameter_group_family) do
desc 'the name of the DB parameter group family that this DB parameter group is compatible with.'
newproperty(:family) do
desc 'the name of the DB family that this DB parameter group is compatible with (eg. mysql5.1)'
end

newproperty(:region) do
desc 'the region in which to create the db_parametergroup'
desc 'the region in which to create the db_parameter_group'
validate do |value|
fail 'region should not contain spaces' if value =~ /\s/
end
Expand Down
9 changes: 5 additions & 4 deletions lib/puppet/type/rds_db_securitygroup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@
desc 'the name of the DB Security Group (also known as the db_security_group_name)'
end

newparam(:db_security_group_description) do
newparam(:description) do
desc 'the description of a DB Security group'
validate do |value|
fail 'db_security_group_description should not be blank' if value == ''
fail 'description should not be blank' if value == ''
end
end

newproperty(:owner_id) do
desc 'the ID of the owner of this DB Security Group'
end

newproperty(:ec2_security_groups, :array_matching => :all) do
desc 'the EC2 Security Groups assigned to this RDS DB security group'
autorequire(:ec2_securitygroup) do
groups = self[:security_groups]
groups.is_a?(Array) ? groups : [groups]
end

newproperty(:region) do
Expand Down

0 comments on commit f208cf2

Please sign in to comment.