Class: Putpaws::Provision::AwsClients
- Inherits:
-
Object
- Object
- Putpaws::Provision::AwsClients
- Defined in:
- lib/putpaws/provision/aws_clients.rb
Overview
Lazy client factory. Clients can be injected for testing.
Instance Attribute Summary collapse
-
#region ⇒ Object
readonly
Returns the value of attribute region.
Instance Method Summary collapse
- #codebuild ⇒ Object
- #ec2 ⇒ Object
- #ecs ⇒ Object
- #iam ⇒ Object
-
#initialize(region:, ec2: nil, ecs: nil, logs: nil, codebuild: nil, ssm: nil, iam: nil) ⇒ AwsClients
constructor
A new instance of AwsClients.
- #logs ⇒ Object
- #ssm ⇒ Object
Constructor Details
#initialize(region:, ec2: nil, ecs: nil, logs: nil, codebuild: nil, ssm: nil, iam: nil) ⇒ AwsClients
Returns a new instance of AwsClients.
6 7 8 9 10 11 12 13 14 |
# File 'lib/putpaws/provision/aws_clients.rb', line 6 def initialize(region:, ec2: nil, ecs: nil, logs: nil, codebuild: nil, ssm: nil, iam: nil) @region = region @ec2 = ec2 @ecs = ecs @logs = logs @codebuild = codebuild @ssm = ssm @iam = iam end |
Instance Attribute Details
#region ⇒ Object (readonly)
Returns the value of attribute region.
5 6 7 |
# File 'lib/putpaws/provision/aws_clients.rb', line 5 def region @region end |
Instance Method Details
#codebuild ⇒ Object
44 45 46 47 48 49 |
# File 'lib/putpaws/provision/aws_clients.rb', line 44 def codebuild @codebuild ||= begin require 'aws-sdk-codebuild' Aws::CodeBuild::Client.new(region: region) end end |
#ec2 ⇒ Object
23 24 25 26 27 28 |
# File 'lib/putpaws/provision/aws_clients.rb', line 23 def ec2 @ec2 ||= begin require 'aws-sdk-ec2' Aws::EC2::Client.new(region: region) end end |
#ecs ⇒ Object
30 31 32 33 34 35 |
# File 'lib/putpaws/provision/aws_clients.rb', line 30 def ecs @ecs ||= begin require 'aws-sdk-ecs' Aws::ECS::Client.new(region: region) end end |
#iam ⇒ Object
16 17 18 19 20 21 |
# File 'lib/putpaws/provision/aws_clients.rb', line 16 def iam @iam ||= begin require 'aws-sdk-iam' Aws::IAM::Client.new(region: region) end end |
#logs ⇒ Object
37 38 39 40 41 42 |
# File 'lib/putpaws/provision/aws_clients.rb', line 37 def logs @logs ||= begin require 'aws-sdk-cloudwatchlogs' Aws::CloudWatchLogs::Client.new(region: region) end end |
#ssm ⇒ Object
51 52 53 54 55 56 |
# File 'lib/putpaws/provision/aws_clients.rb', line 51 def ssm @ssm ||= begin require 'aws-sdk-ssm' Aws::SSM::Client.new(region: region) end end |