Class: Aws::RailsProvisioner::Vpc
- Inherits:
-
Object
- Object
- Aws::RailsProvisioner::Vpc
- Defined in:
- lib/aws-rails-provisioner/vpc.rb
Defined Under Namespace
Classes: Subnet
Constant Summary collapse
- SUBNETS_DEFAULTS =
{ application: { cidr_mask: 24, type: 'private' }, ingress: { cidr_mask: 24, type: 'public' }, database: { cidr_mask: 28, type: 'isolated' } }
Instance Attribute Summary collapse
- #cidr ⇒ String readonly
- #enable_dns ⇒ Boolean readonly
- #max_azs ⇒ Integer readonly
- #nat_gateway_subnets ⇒ Aws::RailsProvisioner::SubnetSelection | nil readonly
- #nat_gateways ⇒ Integer readonly
- #subnets ⇒ Array|nil readonly
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Vpc
constructor
Configuration value under :vpc.
Constructor Details
#initialize(options = {}) ⇒ Vpc
Configuration value under :vpc
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/aws-rails-provisioner/vpc.rb', line 60 def initialize( = {}) @max_azs = [:max_azs] || 3 @cidr = [:cidr] || '10.0.0.0/21' subnets_config = [:subnets] || SUBNETS_DEFAULTS @subnets = subnets_config.map do |name, config| Subnet.new( cidr_mask: config[:cidr_mask], subnet_name: name, type: config[:type] ) end @enable_dns = [:enable_dns].nil? ? true : !![:enable_dns] @nat_gateways = [:nat_gateways] || @max_azs @nat_gateway_subnets = Aws::RailsProvisioner::SubnetSelection.new([:nat_gateway_subnets]) if [:nat_gateway_subnets] end |
Instance Attribute Details
#cidr ⇒ String (readonly)
86 87 88 |
# File 'lib/aws-rails-provisioner/vpc.rb', line 86 def cidr @cidr end |
#enable_dns ⇒ Boolean (readonly)
89 90 91 |
# File 'lib/aws-rails-provisioner/vpc.rb', line 89 def enable_dns @enable_dns end |
#max_azs ⇒ Integer (readonly)
77 78 79 |
# File 'lib/aws-rails-provisioner/vpc.rb', line 77 def max_azs @max_azs end |
#nat_gateway_subnets ⇒ Aws::RailsProvisioner::SubnetSelection | nil (readonly)
83 84 85 |
# File 'lib/aws-rails-provisioner/vpc.rb', line 83 def nat_gateway_subnets @nat_gateway_subnets end |
#nat_gateways ⇒ Integer (readonly)
80 81 82 |
# File 'lib/aws-rails-provisioner/vpc.rb', line 80 def nat_gateways @nat_gateways end |
#subnets ⇒ Array|nil (readonly)
92 93 94 |
# File 'lib/aws-rails-provisioner/vpc.rb', line 92 def subnets @subnets end |