Class: Ufo::Stack::Builder::Resources::SecurityGroup::EcsRule

Inherits:
Base
  • Object
show all
Defined in:
lib/ufo/stack/builder/resources/security_group/ecs_rule.rb

Instance Method Summary collapse

Methods inherited from Base

build, #copy_instance_variables, #initialize, #managed_security_group, #managed_security_groups?, #security_groups

Methods included from Ufo::Settings

#cfn, #network, #settings

Constructor Details

This class inherits a constructor from Ufo::Stack::Builder::Base

Instance Method Details

#buildObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ufo/stack/builder/resources/security_group/ecs_rule.rb', line 3

def build
  return unless managed_security_groups?
  return unless @elb_type == "application"

  {
    Type: "AWS::EC2::SecurityGroupIngress",
    Condition: "CreateElbIsTrue",
    Properties: {
      IpProtocol: "tcp",
      FromPort: "0",
      ToPort: "65535",
      SourceSecurityGroupId: {
        "Fn::GetAtt": "ElbSecurityGroup.GroupId"
      },
      GroupId: {
        "Fn::GetAtt": "EcsSecurityGroup.GroupId"
      },
      Description: "application elb access to ecs"
    }
  }
end