Module: Enscalator::Helpers::Wrappers
- Included in:
- Enscalator::Helpers
- Defined in:
- lib/enscalator/helpers/wrappers.rb
Overview
Helpers that wrap some
Instance Method Summary collapse
-
#cfn_client(region) ⇒ Aws::CloudFormation::Client
Cloudformation client.
-
#cfn_resource(client) ⇒ Aws::CloudFormation::Resource
Cloudformation resource.
-
#ec2_client(region) ⇒ Aws::EC2::Client
EC2 client.
-
#route53_client(region) ⇒ Aws::Route53::Client
Route 53 client.
Instance Method Details
#cfn_client(region) ⇒ Aws::CloudFormation::Client
Cloudformation client
10 11 12 13 14 15 |
# File 'lib/enscalator/helpers/wrappers.rb', line 10 def cfn_client(region) fail ArgumentError, 'Unable to proceed without region' if region.blank? && !Aws.config.key?(:region) opts = {} opts[:region] = region unless Aws.config.key?(:region) Aws::CloudFormation::Client.new(opts) end |
#cfn_resource(client) ⇒ Aws::CloudFormation::Resource
Cloudformation resource
48 49 50 51 52 |
# File 'lib/enscalator/helpers/wrappers.rb', line 48 def cfn_resource(client) fail ArgumentError, 'must be instance of Aws::CloudFormation::Client' unless client.instance_of?(Aws::CloudFormation::Client) Aws::CloudFormation::Resource.new(client: client) end |
#ec2_client(region) ⇒ Aws::EC2::Client
EC2 client
22 23 24 25 26 27 28 |
# File 'lib/enscalator/helpers/wrappers.rb', line 22 def ec2_client(region) fail ArgumentError, 'Unable to proceed without region' if region.blank? && !Aws.config.key?(:region) opts = {} opts[:region] = region unless Aws.config.key?(:region) # noinspection RubyArgCount Aws::EC2::Client.new(opts) end |
#route53_client(region) ⇒ Aws::Route53::Client
Route 53 client
35 36 37 38 39 40 41 |
# File 'lib/enscalator/helpers/wrappers.rb', line 35 def route53_client(region) fail ArgumentError, 'Unable to proceed without region' if region.blank? && !Aws.config.key?(:region) opts = {} opts[:region] = region unless Aws.config.key?(:region) # noinspection RubyArgCount Aws::Route53::Client.new(opts) end |