module AwsPocketknife

Constants

AWS_PROFILE
AWS_REGION
VERSION

Public Class Methods

asg_client() click to toggle source
# File lib/aws_pocketknife.rb, line 57
def asg_client
  @asg_client ||= Aws::AutoScaling::Client.new(get_client_options)
end
cf_client() click to toggle source
# File lib/aws_pocketknife.rb, line 41
def cf_client
  @cloud_formation_client ||= Aws::CloudFormation::Client.new(get_client_options)
end
cloudwatch_logs_client() click to toggle source
# File lib/aws_pocketknife.rb, line 37
def cloudwatch_logs_client
  @cloudwatch_logs_client ||= Aws::CloudWatchLogs::Client.new(get_client_options)
end
ec2_client() click to toggle source
# File lib/aws_pocketknife.rb, line 73
def ec2_client
  @ec2_client ||= Aws::EC2::Client.new(get_client_options)
end
ecs_client() click to toggle source
# File lib/aws_pocketknife.rb, line 77
def ecs_client
  @ecs_client ||= Aws::ECS::Client.new(get_client_options)
end
elastic_beanstalk_client() click to toggle source
# File lib/aws_pocketknife.rb, line 61
def elastic_beanstalk_client
  @elastic_beanstalk_client ||= Aws::ElasticBeanstalk::Client.new(get_client_options)
end
elb_client() click to toggle source
# File lib/aws_pocketknife.rb, line 49
def elb_client
  @elb_client ||= Aws::ElasticLoadBalancing::Client.new(get_client_options)
end
elb_clientV2() click to toggle source
# File lib/aws_pocketknife.rb, line 53
def elb_clientV2
  @elb_clientV2 ||= Aws::ElasticLoadBalancingV2::Client.new(get_client_options)
end
iam_client() click to toggle source
# File lib/aws_pocketknife.rb, line 65
def iam_client
  @iam_client ||= Aws::IAM::Client.new(get_client_options)
end
rds_client() click to toggle source
# File lib/aws_pocketknife.rb, line 69
def rds_client
  @rds_client ||= Aws::RDS::Client.new(get_client_options)
end
route53_client() click to toggle source
# File lib/aws_pocketknife.rb, line 81
def route53_client
  @route53_client ||= Aws::Route53::Client.new(get_client_options)
end
s3_client() click to toggle source
# File lib/aws_pocketknife.rb, line 45
def s3_client
  @s3_client ||= Aws::S3::Client.new(get_client_options)
end

Private Class Methods

get_client_options() click to toggle source
# File lib/aws_pocketknife.rb, line 87
def get_client_options
  if AWS_PROFILE.nil?
    return { retry_limit: 5, region: AWS_REGION }
  else
    credentials = Aws::SharedCredentials.new(profile_name: AWS_PROFILE)
    return { retry_limit: 5, region: AWS_REGION, credentials: credentials }
  end
end