Class: Terracop::Cop::Aws::FaultIntolerant
- Defined in:
- lib/terracop/cop/aws/fault_intolerant.rb
Overview
This cop checks for Autoscaling Groups that can only launch instances in a specific Availability Zone. This creates an availability risk, as if that AZ is lost, the ASG will not be able to launch instances anywhere else.
Constant Summary collapse
- MSG =
'This Autoscaling Group can launch instances in only one AZ ' \ '(%<az>s). This setup would not tolerate the loss of that AZ.'
Instance Attribute Summary
Attributes inherited from Base
#attributes, #index, #name, #offenses, #type
Instance Method Summary collapse
Methods inherited from Base
config, cop_name, #human_name, #initialize, #offense, run
Constructor Details
This class inherits a constructor from Terracop::Cop::Base
Instance Method Details
#check ⇒ Object
32 33 34 35 36 |
# File 'lib/terracop/cop/aws/fault_intolerant.rb', line 32 def check return unless attributes['availability_zones'].count < 2 offense(format(MSG, az: attributes['availability_zones'][0])) end |