Class: Convection::Model::Template::Resource::EC2SecurityGroup

Inherits:
Convection::Model::Template::Resource show all
Includes:
DSL::Template::Resource::EC2SecurityGroup, Mixin::Taggable
Defined in:
lib/convection/model/template/resource/aws_ec2_security_group.rb

Overview

AWS::EC2::SecurityGroup

Examples:

ec2_security_group 'SuperSecretSecurityGroup' do
  description 'This is a super secure group that nobody should know about.'
  vpc 'vpc-deadb33f'
end

See Also:

Defined Under Namespace

Classes: Rule

Instance Attribute Summary collapse

Attributes inherited from Convection::Model::Template::Resource

#exist, #name, #parent, #properties, #resource_attributes, #template

Instance Method Summary collapse

Methods included from Mixin::Taggable

#immutable_metadata, #render_tags, #tag, #tags

Methods included from DSL::Template::Resource::EC2SecurityGroup

#egress_rule, #ingress_rule

Methods inherited from Convection::Model::Template::Resource

#as_attribute, attach_method, #deletion_policy, #depends_on, properties, #property, property, #reference, type, #type, #with_output

Methods included from Mixin::Conditional

#condition, #render_condition

Methods included from DSL::Template::Resource

attach_resource

Methods included from DSL::Helpers

#camel_case, included, method_name, #screaming_snake_case, #snake_case

Methods included from DSL::IntrinsicFunctions

#base64, #find_in_map, #fn_and, #fn_equals, #fn_if, #fn_not, #fn_or, #fn_ref, #get_att, #get_azs, #join, #select

Constructor Details

#initialize(*args) ⇒ EC2SecurityGroup

Returns a new instance of EC2SecurityGroup



105
106
107
108
109
110
# File 'lib/convection/model/template/resource/aws_ec2_security_group.rb', line 105

def initialize(*args)
  super

  @security_group_ingress = []
  @security_group_egress = []
end

Instance Attribute Details

#security_group_egressObject (readonly)

Returns the value of attribute security_group_egress



54
55
56
# File 'lib/convection/model/template/resource/aws_ec2_security_group.rb', line 54

def security_group_egress
  @security_group_egress
end

#security_group_ingressObject (readonly)

Returns the value of attribute security_group_ingress



53
54
55
# File 'lib/convection/model/template/resource/aws_ec2_security_group.rb', line 53

def security_group_ingress
  @security_group_ingress
end

Instance Method Details

#descriptionObject #description(value) ⇒ Object

Overloads:

  • #descriptionObject

    Returns the value of the 'GroupDescription' CloudFormation property.

  • #description(value) ⇒ Object

    Sets the 'GroupDescription' CloudFormation property.

    Parameters:

    • value

      the value to set the 'GroupDescription' CloudFormation property to.



102
# File 'lib/convection/model/template/resource/aws_ec2_security_group.rb', line 102

property :description, 'GroupDescription'

#render(*args) ⇒ Object



112
113
114
115
116
117
118
# File 'lib/convection/model/template/resource/aws_ec2_security_group.rb', line 112

def render(*args)
  super.tap do |resource|
    resource['Properties']['SecurityGroupIngress'] = security_group_ingress.map(&:render)
    resource['Properties']['SecurityGroupEgress'] = security_group_egress.map(&:render)
    render_tags(resource)
  end
end

#vpcObject #vpc(value) ⇒ Object

Overloads:

  • #vpcObject

    Returns the value of the 'VpcId' CloudFormation property.

  • #vpc(value) ⇒ Object

    Sets the 'VpcId' CloudFormation property.

    Parameters:

    • value

      the value to set the 'VpcId' CloudFormation property to.



103
# File 'lib/convection/model/template/resource/aws_ec2_security_group.rb', line 103

property :vpc, 'VpcId'