Class: DrawCloud::RDSSecurityGroup
- Defined in:
- lib/draw_cloud/rds_security_group.rb
Instance Attribute Summary collapse
-
#allows ⇒ Object
Returns the value of attribute allows.
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
Attributes inherited from Base
#as_groups, #as_launch_configurations, #deletion_policy, #depends_on, #ec2_instances, #elastic_ips, #gateways, #iam_access_keys, #iam_policies, #iam_users, #mappings, #metadata, #network_acls, #network_interfaces, #outputs, #parameters, #parent, #rdses, #resources, #route_tables, #security_groups, #sns_topics, #subnets, #vpcs, #wait_handles
Instance Method Summary collapse
- #allow_in(designator) ⇒ Object
-
#initialize(name, description, options = {}, &block) ⇒ RDSSecurityGroup
constructor
A new instance of RDSSecurityGroup.
- #load_into_config(config) ⇒ Object
- #resource_name ⇒ Object
- #to_h ⇒ Object
Methods inherited from Base
#[], #accessor, #add_standard_properties, #create_as_group, #create_as_launch_configuration, #create_ec2_instance, #create_ec2_instance_template, #create_elastic_ip, #create_iam_access_key, #create_iam_policy, #create_iam_user, #create_mapping, #create_network_acl, #create_network_interface, #create_output, #create_parameter, #create_rds, #create_route_table, #create_security_group, #create_service, #create_sns_topic, #create_subnet, #create_vpc, #create_wait_handle, #ref
Methods included from Locations
Methods included from Utilities
#desplice, #fnbase64, #fngetatt, #fnjoin, #hash_to_tag_array, #region, #resource_style, #splice, #stack_name
Constructor Details
#initialize(name, description, options = {}, &block) ⇒ RDSSecurityGroup
Returns a new instance of RDSSecurityGroup.
22 23 24 25 26 27 |
# File 'lib/draw_cloud/rds_security_group.rb', line 22 def initialize(name, description, ={}, &block) @name = name @description = description @allows = [] super(, &block) end |
Instance Attribute Details
#allows ⇒ Object
Returns the value of attribute allows.
21 22 23 |
# File 'lib/draw_cloud/rds_security_group.rb', line 21 def allows @allows end |
#description ⇒ Object
Returns the value of attribute description.
21 22 23 |
# File 'lib/draw_cloud/rds_security_group.rb', line 21 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
21 22 23 |
# File 'lib/draw_cloud/rds_security_group.rb', line 21 def name @name end |
Instance Method Details
#allow_in(designator) ⇒ Object
29 30 31 |
# File 'lib/draw_cloud/rds_security_group.rb', line 29 def allow_in(designator) allows << designator end |
#load_into_config(config) ⇒ Object
33 34 35 36 |
# File 'lib/draw_cloud/rds_security_group.rb', line 33 def load_into_config(config) config.cf_add_resource resource_name, self super(config) end |
#resource_name ⇒ Object
38 39 40 |
# File 'lib/draw_cloud/rds_security_group.rb', line 38 def resource_name DrawCloud.resource_name(rds) + DrawCloud.resource_name(name) + "SG" end |
#to_h ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/draw_cloud/rds_security_group.rb', line 42 def to_h h = { "Type" => "AWS::RDS::DBSecurityGroup", "Properties" => { "GroupDescription" => description, "DBSecurityGroupIngress" => [], } } h["Properties"]["EC2VpcId"] = DrawCloud.ref(vpc) if vpc h["Properties"]["DBSecurityGroupIngress"] << { "CIDRIP" => "0.0.0.0/0" } h end |