VPC Settings
You can configure network settings with config.vpc
. Example:
.ufo/config.rb
Ufo.configure do |config|
config.vpc.id = "vpc-111"
config.vpc.subnets.ecs = ["subnet-111", "subnet-222"] # at least 2 required
config.vpc.subnets.elb = ["subnet-111", "subnet-222"] # at least 2 required
# Optional existing security group ids to add in addition to the ones created by ufo.
config.vpc.security_groups.ecs = ["sg-111"]
config.vpc.security_groups.elb = ["sg-111"]
end
Stack Output Helper
If you have built a VPC with CloudFormation and it has outputs with the network information, you can use the stack_output
helper method to grab the information. Example:
.ufo/config.rb
Ufo.configure do |config|
config.vpc.id = stack_output("vpc-:ENV.Vpc")
config.vpc.subnets.ecs = stack_output("vpc-:ENV.PrivateSubnets").split(',')
config.vpc.subnets.elb = stack_output("vpc-:ENV.PublicSubnets").split(',')
end
Reference
The table below covers each setting. Each option is configured in .ufo/config.rb
with config.OPTION
. The config.
portion is not shown for conciseness. IE: logger.level
vs config.logger.level
.
Name | Default | Description |
---|---|---|
vpc.id | nil | Used to create ecs and elb security groups in the CloudFormation template. |
vpc.subnets.ecs | nil | The subnets the ECS Container Instances are on. So this is where you want your containers to run. |
vpc.subnets.elb | nil | Subnets used by the ELB load balancer. Defaults to same subnets as ECS subnets when not set. |
vpc.security_groups.ecs | nil | Additional security groups to associate with the ECS tasks. |
vpc.security_groups.elb | nil | Additional security groups to associate with the ELB. |