Class: Ufo::Cfn::Stack::Builder::Resources::SecurityGroup::Ecs
- Inherits:
-
Base
- Object
- Ufo::CLI::Base
- Base
- Base
- Base
- Ufo::Cfn::Stack::Builder::Resources::SecurityGroup::Ecs
- Defined in:
- lib/ufo/cfn/stack/builder/resources/security_group/ecs.rb
Instance Attribute Summary
Attributes inherited from Base
Attributes inherited from Ufo::CLI::Base
Instance Method Summary collapse
Methods inherited from Base
build, #initialize, #manage_ecs_security_group?, #managed_security_group, #security_groups
Methods included from Ufo::Concerns
Methods included from Ufo::Concerns::Names
Methods included from AwsServices
#acm, #applicationautoscaling, #aws_options, #cfn, #cloudwatchlogs, #ec2, #ecr, #ecs, #elb, #s3, #ssm_client, #waf_client
Methods included from AwsServices::Concerns
#find_stack, #find_stack_resources, #stack_resources, #status, #task_definition_arns
Methods inherited from Ufo::CLI::Base
Methods included from Utils::Sure
Methods included from Utils::Pretty
#pretty_home, #pretty_path, #pretty_time
Methods included from Utils::Logging
Constructor Details
This class inherits a constructor from Ufo::Cfn::Stack::Builder::Base
Instance Method Details
#build ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/ufo/cfn/stack/builder/resources/security_group/ecs.rb', line 3 def build return unless manage_ecs_security_group? return unless vars[:container][:network_mode].to_s == 'awsvpc' { Type: "AWS::EC2::SecurityGroup", Properties: properties } end |
#properties ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/ufo/cfn/stack/builder/resources/security_group/ecs.rb', line 13 def properties props = { GroupDescription: "Allow http to client host", VpcId: {Ref: "Vpc"}, SecurityGroupEgress: [ { IpProtocol: "-1", CidrIp: "0.0.0.0/0", Description: "outbound traffic" } ], Tags: [ { Key: "Name", Value: @stack_name, } ] } if vars[:elb_type] == "network" props[:SecurityGroupIngress] = { IpProtocol: "tcp", FromPort: vars[:container][:port], ToPort: vars[:container][:port], CidrIp: "0.0.0.0/0", Description: "docker ephemeral port range for network elb", } end props end |