Class: EcsDeployCli::DSL::Cluster::VPC
- Inherits:
-
Object
- Object
- EcsDeployCli::DSL::Cluster::VPC
show all
- Includes:
- AutoOptions
- Defined in:
- lib/ecs_deploy_cli/dsl/cluster.rb
Instance Method Summary
collapse
#_options, #method_missing
Constructor Details
#initialize(id) ⇒ VPC
Returns a new instance of VPC.
39
40
41
|
# File 'lib/ecs_deploy_cli/dsl/cluster.rb', line 39
def initialize(id)
_options[:id] = id
end
|
Instance Method Details
#as_definition ⇒ Object
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/ecs_deploy_cli/dsl/cluster.rb', line 51
def as_definition
validate! if _options[:id]
{
cidr: '10.0.0.0/16',
subnet1: '10.0.0.0/24',
subnet2: '10.0.1.0/24',
subnet3: '10.0.2.0/24'
}.merge(_options)
end
|
#availability_zones(*values) ⇒ Object
43
44
45
|
# File 'lib/ecs_deploy_cli/dsl/cluster.rb', line 43
def availability_zones(*values)
_options[:availability_zones] = values.join(',')
end
|
#subnet_ids(*values) ⇒ Object
47
48
49
|
# File 'lib/ecs_deploy_cli/dsl/cluster.rb', line 47
def subnet_ids(*values)
_options[:subnet_ids] = values.join(',')
end
|
#validate! ⇒ Object
62
63
64
65
66
|
# File 'lib/ecs_deploy_cli/dsl/cluster.rb', line 62
def validate!
[
:subnet1, :subnet_ids, :availability_zones
].each { |key| raise "Missing required parameter #{key}" unless _options[key] }
end
|