aws-ec2 1.4.0 → 1.4.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/aws_ec2/create.rb +21 -0
- data/lib/aws_ec2/scripts/cloudwatch.sh +2 -2
- data/lib/aws_ec2/scripts/shared/functions.sh +1 -1
- data/lib/aws_ec2/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5560582b50baf27e28aac6b3b9d3ae01b34a57b6860a1a4f4dea8c8174d63964
|
4
|
+
data.tar.gz: f0e2be852cfc48ec8c1d49ad34d299695c6f959fc7decd43e4babda4691df897
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 675fe8d9e1e71a472132d21ca58a0272c7629852b8b0ef90b591e1c01cb4abb6752c462026620ab5441f41ed9f8d9e9ef70d0b90b473022608afb678317f4568
|
7
|
+
data.tar.gz: e7d16c84a8cdf3ee21664655d7e194e83c65b88734c09989c2cb80389bee0f14e736fa94dc9a32c339972d0ddc020370f7d4f653053dbf97a002732f8be6a0f1
|
data/CHANGELOG.md
CHANGED
@@ -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
|
data/lib/aws_ec2/create.rb
CHANGED
@@ -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" ]
|
17
|
-
echo "Sorry,
|
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
|
|
data/lib/aws_ec2/version.rb
CHANGED