From 31ae694aab4dc6e5a82b12f97f0412b50ecc4178 Mon Sep 17 00:00:00 2001 From: Marcy Date: Mon, 7 Jul 2014 20:09:47 +0900 Subject: [PATCH] Add db_paramater_group method --- lib/awspec/type/rds/instance.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/awspec/type/rds/instance.rb b/lib/awspec/type/rds/instance.rb index 7cc2ce6..830249f 100644 --- a/lib/awspec/type/rds/instance.rb +++ b/lib/awspec/type/rds/instance.rb @@ -5,7 +5,7 @@ module Awspec module Type module RDS class Instance < Base - + def initialize(name) super @@ -54,7 +54,16 @@ def vpc_security_group(name) raise NameError, "VPC Security Group [#{name}] is not exists or not attached." end + def db_paramater_group(name) + @instance[:db_parameter_groups].each do |pg| + if pg[:db_parameter_group_name] == name then + return pg + end + end + raise NameError, "DB Parameter Group [#{name}] is not exists or not attached." + end + end end end -end \ No newline at end of file +end