awshark 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +15 -6
- data/lib/awshark/cloud_formation/manager.rb +6 -0
- data/lib/awshark/cloud_formation/subcommand.rb +16 -0
- data/lib/awshark/ec2/subcommand.rb +2 -2
- data/lib/awshark/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 944b9d2229c69abfd14fae195f1ba6ffad83e48b1f8a6d8b250ba1958a600330
|
4
|
+
data.tar.gz: d1b9886e347b3eb551f765f1788e556751aca04b17ae95e034d9b4ffbd83936b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 348b4502d6989094798ad96470f219d2207bbf1acaeef6aeaffde67ae1d25a10efc371f6bf9c7f00a0ba64b5c0fc137bf40379bb49b547792038eee73baec9b5
|
7
|
+
data.tar.gz: 3b014bab2c44409f4c1c25f3359f7fc8f4ce6d00e7b1c0fcc9ac286f287e91b3309e0b51b3c29720a32668fdae636fb53e94c618e2507b3086b6e47710afa2cd
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -18,37 +18,46 @@ Use `AWS_PROFILE=PROFILE` and/or `AWS_REGION=REGION` to configure the internal A
|
|
18
18
|
|
19
19
|
#### S3 commands
|
20
20
|
|
21
|
-
List all S3 buckets
|
21
|
+
List all S3 buckets with number of objects and total size.
|
22
|
+
(Data depends on AWS Cloudwatch Metrics so there is a time difference to the actual data.)
|
22
23
|
```
|
23
24
|
awshark s3 list
|
24
25
|
```
|
25
26
|
|
26
|
-
List all objects in a specific S3 bucket
|
27
|
+
List all objects in a specific S3 bucket.
|
27
28
|
```
|
28
29
|
awshark s3 objects BUCKET_NAME fonts/
|
29
30
|
```
|
30
31
|
|
31
32
|
#### EC2 commands
|
32
33
|
|
33
|
-
List all EC2 instances in a region
|
34
|
+
List all EC2 instances in a region.
|
34
35
|
```
|
35
36
|
awshark ec2 list
|
36
37
|
```
|
37
38
|
|
38
39
|
#### ECS commands
|
39
40
|
|
40
|
-
List all
|
41
|
+
List all ECS services in a region.
|
41
42
|
```
|
42
43
|
awshark ecs list
|
43
44
|
```
|
44
45
|
|
45
46
|
#### Cloud Formation commands
|
46
47
|
|
47
|
-
|
48
|
+
Display changes to AWS Cloud Formation stack.
|
49
|
+
```
|
50
|
+
awshark cf diff TEMPLATE_PATH --stage=STAGE --bucket=S3_BUCKET.bundesimmo.de
|
51
|
+
```
|
52
|
+
|
53
|
+
Update or create AWS Cloud Formation stack.
|
48
54
|
```
|
49
55
|
awshark cf deploy TEMPLATE_PATH --stage=STAGE --bucket=S3_BUCKET.bundesimmo.de
|
56
|
+
```
|
50
57
|
|
51
|
-
|
58
|
+
Save AWS Cloud Formation stack as file `STACK_NAME-STAGE.json`.
|
59
|
+
```
|
60
|
+
awshark cf save TEMPLATE_PATH --stage=STAGE
|
52
61
|
```
|
53
62
|
|
54
63
|
For a further information visit the [Wiki](https://github.com/jdahlke/awshark/wiki).
|
@@ -46,6 +46,12 @@ module Awshark
|
|
46
46
|
raise e
|
47
47
|
end
|
48
48
|
|
49
|
+
def save_stack_template
|
50
|
+
filename = "#{stack.name}.json"
|
51
|
+
File.open(filename, 'w') { |f| f.write(template.body) }
|
52
|
+
filename
|
53
|
+
end
|
54
|
+
|
49
55
|
def tail_stack_events
|
50
56
|
stack.reload
|
51
57
|
stack_events = StackEvents.new(stack)
|
@@ -63,6 +63,22 @@ module Awshark
|
|
63
63
|
puts diff
|
64
64
|
end
|
65
65
|
|
66
|
+
desc 'save', 'Save AWS CloudFormation JSON template as file'
|
67
|
+
long_desc <<-LONGDESC
|
68
|
+
Save AWS CloudFormation JSON template as file TEMPLATE_PATH/cloudformation-stage.json
|
69
|
+
|
70
|
+
Example: `awshark cf save TEMPLATE_PATH`
|
71
|
+
LONGDESC
|
72
|
+
def save(template_path)
|
73
|
+
process_class_options
|
74
|
+
|
75
|
+
manager = create_manager(template_path)
|
76
|
+
print_stack_information(manager.stack)
|
77
|
+
|
78
|
+
filename = manager.save_stack_template
|
79
|
+
printf "Written CloudFormation JSON template to: %<name>s\n\n", name: filename
|
80
|
+
end
|
81
|
+
|
66
82
|
private
|
67
83
|
|
68
84
|
def create_manager(template_path)
|
@@ -50,7 +50,7 @@ module Awshark
|
|
50
50
|
desc: 'Security group to allow access to.'
|
51
51
|
option :username,
|
52
52
|
type: :string,
|
53
|
-
desc: '
|
53
|
+
desc: 'Optional user name (defaults to whoami).'
|
54
54
|
def authorize
|
55
55
|
process_class_options
|
56
56
|
|
@@ -72,7 +72,7 @@ module Awshark
|
|
72
72
|
desc: 'Security group to remove access from.'
|
73
73
|
option :username,
|
74
74
|
type: :string,
|
75
|
-
desc: '
|
75
|
+
desc: 'Optional user name (defaults to whoami).'
|
76
76
|
def unauthorize
|
77
77
|
process_class_options
|
78
78
|
|
data/lib/awshark/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awshark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joergen Dahlke
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|