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 +4 -4
- data/CHANGELOG.md +8 -1
- data/README.md +24 -0
- data/lib/aws_su/version.rb +1 -1
- data/lib/aws_su.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4251a967b1cec67a91d2174a88aef103fcc36133
|
4
|
+
data.tar.gz: 3e963fbc25fcadb2f6838a65c3929f7d73dcbedd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
data/lib/aws_su/version.rb
CHANGED
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
|
|