aws_su 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ced5b07379bc4a4e9f0f3d316e575886367f0cca
4
- data.tar.gz: 14ab789e98f42ad0790d43d1d72020c65514db48
3
+ metadata.gz: 4251a967b1cec67a91d2174a88aef103fcc36133
4
+ data.tar.gz: 3e963fbc25fcadb2f6838a65c3929f7d73dcbedd
5
5
  SHA512:
6
- metadata.gz: c2eeaa96c2b04eb60d6ed82d5d7b76c4f9c0cc1d5d24aa881754f4581d5bd142ac8321f3e0a905ec4fc35d49b6c2c7820a255806fc04cebe043b6ced7dbabd58
7
- data.tar.gz: 10253e4ab496fc1924807d6f22b32d6c271b7c634a671a1813b929e6c433066040c8b9afd5e99348109df32abd36f783b7db43dc1c7266306f72a203b280e93c
6
+ metadata.gz: c29d2d8ec07fef7f365373339b8041343af3366049a742647b9333b7833ff1770b0529c01f43285da89c061fd10d1f35ef79ee43662f3ea21f12340c3a2f25a2
7
+ data.tar.gz: 40120ea2e514988b2c155d909e25be4f778b335142ce6efe7fb4ec46f82d81bcea798556c01d1d8038abe1a8c1184f0ade997a0bc3e478b1b0213a9960122492
data/CHANGELOG.md CHANGED
@@ -15,4 +15,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
15
  - Required ruby version in gemspec
16
16
  - Housekeeping now that gem is on both github and rubygems
17
17
  - Changed authenticate() method to accept options hash
18
- - Added detailed header to AwsSu module
18
+ - Added detailed header to AwsSu module
19
+
20
+ ## [0.1.2] - 02-12-2018
21
+ ### Changed
22
+ - Order of precedence for setting region
23
+ 1. As optional argument to authenticate()
24
+ 2. Active profile in ~/.aws/config
25
+ 3. First profile in ~/.aws/config
data/README.md CHANGED
@@ -75,6 +75,30 @@ Clients currently supported are:
75
75
  - iam_client
76
76
  - sqs_client
77
77
 
78
+ After you use the authenticator, running the AWS CLI from the command line is possible via the
79
+ assumed role if you add this function to your ~/.bashrc or ~/bash_profile file:
80
+
81
+ ```
82
+ function awssu() {
83
+ while read line
84
+ do
85
+ export "${line}"
86
+ done < ~/.awssudo
87
+ export AWS_DEFAULT_REGION="${1:-eu-west-2}" # Change to your default region
88
+ }
89
+ ```
90
+
91
+ If you have a valid session still available then you can enter:
92
+
93
+ ```bash
94
+ awssu eu-west-1
95
+ ```
96
+
97
+ The region is optional and will default to eu-west-2 unless you change the default in the function.
98
+
99
+ This will call the function which will export the contents of the environment variables
100
+ and then you can run the CLI without further authentication.
101
+
78
102
  ## Development
79
103
 
80
104
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AwsSu
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
data/lib/aws_su.rb CHANGED
@@ -61,6 +61,8 @@ module AwsSu
61
61
  @token_ttl = calculate_session_expiry(@duration)
62
62
 
63
63
  region = AWSConfig.profiles.first[1][:region]
64
+ region = AWSConfig.profiles[@profile][:region] unless
65
+ AWSConfig.profiles[@profile][:region].nil?
64
66
  @region = options[:region].nil? ? region : options[:region]
65
67
  raise('Unable to determine region') if @region.nil?
66
68
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws_su
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bradley Atkins