Module: Smash::CloudPowers::AwsResources
Instance Method Summary
collapse
Methods included from Helper
#attr_map!, #create_logger, #env, #errors, #format_error_message, #log_file, #logger, #retry, #task_path, #task_require_path, #to_camel, #to_i_var, #to_pascal, #to_ruby_file_name, #to_snake, #update_message_body
Methods included from Auth
creds
Instance Method Details
#ec2 ⇒ Object
14
15
16
17
18
19
|
# File 'lib/cloud_powers/aws_resources.rb', line 14
def ec2
@ec2 ||= Aws::EC2::Client.new(
region: region,
credentials: Auth.creds
)
end
|
#image(name) ⇒ Object
21
22
23
24
25
|
# File 'lib/cloud_powers/aws_resources.rb', line 21
def image(name)
ec2.describe_images(
filters: [{ name: 'tag:aminame', values: [name.to_s] }]
).images.first
end
|
#kinesis ⇒ Object
27
28
29
30
31
32
|
# File 'lib/cloud_powers/aws_resources.rb', line 27
def kinesis
@kinesis ||= Aws::Kinesis::Client.new(
region: region,
credentials: Auth.creds,
)
end
|
#region ⇒ Object
10
11
12
|
# File 'lib/cloud_powers/aws_resources.rb', line 10
def region
env('Aws Region')
end
|
#s3 ⇒ Object
34
35
36
37
38
39
|
# File 'lib/cloud_powers/aws_resources.rb', line 34
def s3
@s3 ||= Aws::S3::Client.new(
region: region,
credentials: Auth.creds
)
end
|