Class: CfRdsSecurityGroup
- Inherits:
-
Object
- Object
- CfRdsSecurityGroup
show all
- Includes:
- CfBase
- Defined in:
- lib/cf_factory/rds/cf_rds_security_group.rb
Instance Method Summary
collapse
Methods included from CfBase
#generate, #generate_ref, #get_deletion_policy, #get_name, #hash_to_string, #retrieve_attribute, #set_meta_data, #set_quotes, #set_tags
Constructor Details
#initialize(name, description, vpc = nil) ⇒ CfRdsSecurityGroup
Returns a new instance of CfRdsSecurityGroup.
7
8
9
10
11
12
|
# File 'lib/cf_factory/rds/cf_rds_security_group.rb', line 7
def initialize(name, description, vpc = nil)
@name = name
@description = description
@vpc = vpc
@rules = []
end
|
Instance Method Details
#add_rule(ingress_rule) ⇒ Object
29
30
31
|
# File 'lib/cf_factory/rds/cf_rds_security_group.rb', line 29
def add_rule(ingress_rule)
@rules << ingress_rule
end
|
#get_cf_attributes ⇒ Object
18
19
20
|
# File 'lib/cf_factory/rds/cf_rds_security_group.rb', line 18
def get_cf_attributes
{}
end
|
#get_cf_properties ⇒ Object
22
23
24
25
26
27
|
# File 'lib/cf_factory/rds/cf_rds_security_group.rb', line 22
def get_cf_properties
rules_array = CfHelper.generate_inner_array(@rules)
result = {"GroupDescription" => @description, "DBSecurityGroupIngress" => rules_array}
result["EC2VpcId"] = @vpc.generate_ref unless @vpc.nil?
result
end
|
#get_cf_type ⇒ Object
14
15
16
|
# File 'lib/cf_factory/rds/cf_rds_security_group.rb', line 14
def get_cf_type
"AWS::RDS::DBSecurityGroup"
end
|