aws_account_number 0.2.0 → 0.3.0

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: 08d5121334ece06fd427d6182ad73b48b782669c
4
- data.tar.gz: 3c8249f1e23b17a3d5b362e75e2a375d96f19030
3
+ metadata.gz: 77215ee6455664b43383cdbff6283bfb3c2b9dee
4
+ data.tar.gz: e30f96bec9d55f6b73a4ff4368ecd2fcc05fb76d
5
5
  SHA512:
6
- metadata.gz: b7212b5bb556609e475195e094b33bd7c6b8063a7ea6d7fab87753571b3ccaf35fab6c6e9a3f88f1c7333c3953429cad1ae105eacd254498dcd9584533aa903b
7
- data.tar.gz: f4994b48d172e69625d69baa785ba5821bff27d56f3f8bde64500a45e4c3153789781040198d85bb90a19da1080c365006a3e4c8e5dabf501162d1012c622f5b
6
+ metadata.gz: e4bc6da94c0549263463b11c01b91fdb05548bfe41776cf3c4f65ee72220cccc5fc2c016154ed290dd7d7ffbc23ff902e5a732a57d0e1eff34d44ea230a82df6
7
+ data.tar.gz: db3d40ce810e67cb9d0c4250478bcf72b6c0e0161b6ce90f1503e4a0e984468a6bc7c82be147ca89056f2b4724a24190eab472426bfffe9f6e303238c9bedc40
data/README.md CHANGED
@@ -11,7 +11,17 @@ gem install aws_account_number
11
11
  ## Usage
12
12
 
13
13
  ```
14
- aws_account_number get
14
+ # default by security group
15
+ $ aws_account_number
16
+
17
+ # by CloudFormation
18
+ $ aws_account_number cfn
19
+
20
+ # by IAM User (use current credentials)
21
+ $ aws_account_number iamuser
22
+
23
+ # use profile
24
+ $ aws_account_number --profile foo
15
25
  ```
16
26
 
17
27
  ## Development
@@ -49,5 +49,15 @@ module AwsAccountNumber
49
49
  exit 1
50
50
  end
51
51
  end
52
+
53
+ desc :iamuser, "get AWS Account Number from current IAM User", alias: :i
54
+ def iamuser
55
+ begin
56
+ puts iam.current_user.arn.split(':')[4]
57
+ rescue RuntimeError => e
58
+ $stderr.puts e
59
+ exit 1
60
+ end
61
+ end
52
62
  end
53
63
  end
@@ -1,3 +1,3 @@
1
1
  module AwsAccountNumber
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws_account_number
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ISOBE Kazuhiko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-04-21 00:00:00.000000000 Z
11
+ date: 2015-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -99,3 +99,4 @@ signing_key:
99
99
  specification_version: 4
100
100
  summary: Get AWS Account Number
101
101
  test_files: []
102
+ has_rdoc: