mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
d9221bb925
Add has MFA enabled member Add "has console password" member Signed-off-by: sfreeman <Steffanie.Freeman@d2l.com>
31 lines
581 B
Ruby
31 lines
581 B
Ruby
# author: Christoph Hartmann
|
|
|
|
class AWSConnection
|
|
def initialize
|
|
require 'aws-sdk'
|
|
opts = {
|
|
region: ENV['AWS_DEFAULT_REGION'],
|
|
credentials: Aws::Credentials.new(
|
|
ENV['AWS_ACCESS_KEY_ID'],
|
|
ENV['AWS_SECRET_ACCESS_KEY'],
|
|
),
|
|
}
|
|
Aws.config.update(opts)
|
|
end
|
|
|
|
def ec2_resource
|
|
@ec2_resource ||= Aws::EC2::Resource.new
|
|
end
|
|
|
|
def ec2_client
|
|
@ec2_client ||= Aws::EC2::Client.new
|
|
end
|
|
|
|
def iam_resource
|
|
@iam_resource ||= Aws::IAM::Resource.new
|
|
end
|
|
|
|
def iam_client
|
|
@iam_client ||= Aws::IAM::Client.new
|
|
end
|
|
end
|