aws-ec2 1.4.0 → 1.4.1

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
  SHA256:
3
- metadata.gz: bb267f8cd533d910838799ca725bfb8e792d5c5c09d5214a42dc61f123178507
4
- data.tar.gz: ea088020fa9c7fb16933d60bcc598a1cbe2870038c533a1dda9a5ff21c465603
3
+ metadata.gz: 5560582b50baf27e28aac6b3b9d3ae01b34a57b6860a1a4f4dea8c8174d63964
4
+ data.tar.gz: f0e2be852cfc48ec8c1d49ad34d299695c6f959fc7decd43e4babda4691df897
5
5
  SHA512:
6
- metadata.gz: 4d31388fb4b6d63789f39b0afce19705aa0fe8b8bf2a7d2b670a7b804278649aaabc28bc149dcabef5231d5d8eaeffd0d2300877c28524cf4057ff6f41594ab1
7
- data.tar.gz: 157911b5ab7ea840093bcf3b742de32e6497440e17ca66cfea762d52747297c116acdba140ca259adf42f3a231eb01f2d9c91de8ad57910451e5e1d814f95b39
6
+ metadata.gz: 675fe8d9e1e71a472132d21ca58a0272c7629852b8b0ef90b591e1c01cb4abb6752c462026620ab5441f41ed9f8d9e9ef70d0b90b473022608afb678317f4568
7
+ data.tar.gz: e7d16c84a8cdf3ee21664655d7e194e83c65b88734c09989c2cb80389bee0f14e736fa94dc9a32c339972d0ddc020370f7d4f653053dbf97a002732f8be6a0f1
@@ -3,6 +3,11 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [1.4.1]
7
+ - fix cloudwatch support check and add add_to_clipboard url
8
+ - fix copy_to_clipboard
9
+ - remove normalize_os debugging call
10
+
6
11
  ## [1.4.0]
7
12
  - Merge pull request #8 from tongueroo/cloudwatch
8
13
  - cloudwatch support for amazonlinux2 and ubuntu
@@ -26,6 +26,27 @@ module AwsEc2
26
26
  display_spot_info(instance_id)
27
27
  puts "EC2 instance #{@name} created: #{instance_id} 🎉"
28
28
  puts "Visit https://console.aws.amazon.com/ec2/home to check on the status"
29
+ display_cloudwatch_info(instance_id)
30
+ end
31
+
32
+ def display_cloudwatch_info(instance_id)
33
+ return unless @options[:cloudwatch]
34
+
35
+ region = `aws configure get region`.strip
36
+ region = 'us-east-1' if region == ''
37
+ url = "https://#{region}.console.aws.amazon.com/cloudwatch/home?region=#{region}#logEventViewer:group=ec2;stream=#{instance_id}/var/log/cloud-init-output.log"
38
+ puts "To view instance's cloudwatch logs visit:"
39
+ puts " #{url}"
40
+ puts "Note: It takes a little time for the instance to launch and report logs."
41
+ add_to_clipboard(url)
42
+ end
43
+
44
+ def add_to_clipboard(text)
45
+ return unless RUBY_PLATFORM =~ /darwin/
46
+ return unless system("type pbcopy > /dev/null")
47
+
48
+ system(%[echo "#{text}" | pbcopy])
49
+ puts "Pro tip: The CloudWatch Console Link has been added to your copy-and-paste clipboard."
29
50
  end
30
51
 
31
52
  def run_instances(params)
@@ -13,8 +13,8 @@ LOG_GROUP_NAME=$1
13
13
  # shellcheck disable=SC1091
14
14
  source "/opt/aws-ec2/shared/functions.sh"
15
15
  OS=$(os_name)
16
- if [ "$OS" != "amazonlinux2" ] || [ "$OS" != "ubuntu" ] ; then
17
- echo "Sorry, enable cloudwatch logging with the aws-ec2 tool is only supported for amazonlinux2 and ubuntu"
16
+ if [ "$OS" != "amazonlinux2" ] && [ "$OS" != "ubuntu" ] ; then
17
+ echo "Sorry, cloudwatch logging with the aws-ec2 tool is supported for amazonlinux2 and ubuntu only"
18
18
  exit
19
19
  fi
20
20
 
@@ -75,4 +75,4 @@ function os_name() {
75
75
 
76
76
  echo "$OS"
77
77
  }
78
- OS=$(normalize_os)
78
+
@@ -1,3 +1,3 @@
1
1
  module AwsEc2
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen