piculet 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -0
  3. data/bin/piculet +11 -4
  4. data/lib/piculet/version.rb +1 -1
  5. metadata +15 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7950d816481ab26728fb4bf8d1e28811ec568ce
4
- data.tar.gz: 0f18ab57131aaf558518ee0b0bc89a0577075e49
3
+ metadata.gz: 35c298f7269b6ac63e128e3eb6fc20d21ab354f2
4
+ data.tar.gz: bfcaa543bba0f3169d1bc356c33298d77b6d042e
5
5
  SHA512:
6
- metadata.gz: 929ee5edf3c0f42372ffa3a3611e4767479fdf5d9ab03db598dd8c60c37d564efa6de5e1159a1889891bc90e84259ed1a854cf6fc27280fcb5cbaa22253a39ae
7
- data.tar.gz: 5195d1864f6dec6fc897bb66ce557e2974cb63962feab1a87e7089f990f8cce535240c33c47a78b730946d1d8f5cd4031d63d071cbd07c436b17658711e8be4b
6
+ metadata.gz: c37cb0e2c593006952085d12e4cb9f9a7c1e934c1076a6c17b617c5c71411c1f8961dd5357a9317b0d24321ba2d92185537acbf604afbbf335bb18c1a9189edc
7
+ data.tar.gz: 77ee7caa9d2942021b6ff0639e72121ec85615d35fca63a306fd24c0159e10fa9cc2104aa171de61ae00921971bbd535acdf6a29de406b2edac1bb999ac9cab7
data/README.md CHANGED
@@ -36,6 +36,25 @@ piculet -a --dry-run
36
36
  piculet -a # apply `Groupfile` to EC2 SecurityGroup
37
37
  ```
38
38
 
39
+ ## Help
40
+ ```
41
+ Usage: piculet [options]
42
+ -p, --profile PROFILE_NAME
43
+ -k, --access-key ACCESS_KEY
44
+ -s, --secret-key SECRET_KEY
45
+ -r, --region REGION
46
+ -a, --apply
47
+ -f, --file FILE
48
+ -n, --names SG_LIST
49
+ --ec2s VPC_IDS
50
+ --dry-run
51
+ -e, --export
52
+ -o, --output FILE
53
+ --split
54
+ --no-color
55
+ --debug
56
+ ```
57
+
39
58
  ## Groupfile example
40
59
 
41
60
  ```ruby
data/bin/piculet CHANGED
@@ -20,7 +20,9 @@ ARGV.options do |opt|
20
20
  access_key = nil
21
21
  secret_key = nil
22
22
  region = nil
23
+ profile_name = nil
23
24
 
25
+ opt.on('-p', '--profile PROFILE_NAME') {|v| profile_name = v }
24
26
  opt.on('-k', '--access-key ACCESS_KEY') {|v| access_key = v }
25
27
  opt.on('-s', '--secret-key SECRET_KEY') {|v| secret_key = v }
26
28
  opt.on('-r', '--region REGION') {|v| region = v }
@@ -36,19 +38,24 @@ ARGV.options do |opt|
36
38
  opt.on('' , '--debug') { options[:debug] = true }
37
39
  opt.parse!
38
40
 
41
+ aws_opts = {}
39
42
  if access_key and secret_key
40
43
  aws_opts = {
41
44
  :access_key_id => access_key,
42
45
  :secret_access_key => secret_key,
43
46
  }
44
- aws_opts[:region] = region if region
45
- AWS.config(aws_opts)
47
+ elsif profile_name
48
+ provider = AWS::Core::CredentialProviders::SharedCredentialFileProvider.new(
49
+ :profile_name => profile_name
50
+ )
51
+ aws_opts[:credential_provider] = provider
46
52
  elsif (access_key and !secret_key) or (!access_key and secret_key) or mode.nil?
47
53
  puts opt.help
48
54
  exit 1
49
- elsif region
50
- AWS.config(:region => region)
51
55
  end
56
+
57
+ aws_opts[:region] = region if region
58
+ AWS.config(aws_opts)
52
59
  rescue => e
53
60
  $stderr.puts("[ERROR] #{e.message}")
54
61
  exit 1
@@ -1,5 +1,5 @@
1
1
  module Piculet
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
4
4
 
5
5
  Version = Piculet::VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piculet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - winebarrel
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: 2.14.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec-instafail
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  description: Piculet is a tool to manage EC2 Security Group. It defines the state
84
98
  of EC2 Security Group using DSL, and updates EC2 Security Group according to DSL.
85
99
  email: