Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ford-at-aws committed Feb 14, 2024
1 parent 4cb23bf commit ddfed6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions ruby/example_code/iam/scenario_users.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'aws-sdk-iam'
require 'aws-sdk-s3'
require 'logger'
require 'securerandom'
require 'json'
require "aws-sdk-iam"
require "aws-sdk-s3"
require "logger"
require "securerandom"
require "json"

# Demonstrates how to create an IAM user, assume a role, and perform actions with AWS services.
class IAMUserAndRoleManager
Expand Down Expand Up @@ -44,11 +44,11 @@ def create_access_key(user_name)
# @return [Aws::IAM::Types::Role] The created IAM role.
def create_role(role_name, user_arn)
assume_role_policy_document = {
Version: '2012-10-17',
Version: "2012-10-17",
Statement: [{
Effect: 'Allow',
Effect: "Allow",
Principal: { AWS: user_arn },
Action: 'sts:AssumeRole'
Action: "sts:AssumeRole"
}]
}.to_json

Expand All @@ -66,7 +66,7 @@ def create_role(role_name, user_arn)
# @param role_name [String] The name of the role to attach the policy to.
# @param policy_document [Hash] The policy document.
def attach_policy_to_role(role_name, policy_document)
policy_arn = 'arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess'
policy_arn = "arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess"
@iam_client.attach_role_policy(
role_name: role_name,
policy_arn: policy_arn
Expand Down
8 changes: 4 additions & 4 deletions ruby/example_code/iam/spec/scenario_users_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require_relative '../scenario_users'
require 'aws-sdk-iam'
require 'securerandom'
require_relative "../scenario_users"
require "aws-sdk-iam"
require "securerandom"

describe IAMUserAndRoleManager do
let(:iam_client) { Aws::IAM::Client.new }
Expand All @@ -23,7 +23,7 @@
end
end

it 'creates and manages an IAM user and role' do
it "creates and manages an IAM user and role" do
user = user_and_role_manager.create_user(user_name)
expect(user.user_name).to eq(user_name)

Expand Down

0 comments on commit ddfed6a

Please sign in to comment.