ami_spec 1.7.0 → 1.8.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 718f947b58e6bedd2093507f23b7bcc1c8deae4503dde3603c6768700729948a
4
- data.tar.gz: b8c05a3702f5951932d372f6c3788a2ee71f9d0ead934a4bdfb52cae382bbe70
3
+ metadata.gz: a2a7a5034e02deb64f10fae91426c5771688bbae9c8e56764c6af2faa13ebe7c
4
+ data.tar.gz: b006c1eeeae2d04e63d077717fabf1aa0ebe29a8361f88c6958d92401866ff7f
5
5
  SHA512:
6
- metadata.gz: a2ceb57cf5b2ea84f085a835e47e1533065338479c23bf3da88ff962d5c046c6109f2c0b93461ac4c1d5093a14bc7d522e4c154d1f34225ef3813ebd70f6ecda
7
- data.tar.gz: ca6403909f96efb50c412ed722e6449b51ea147677f10d2e7729e31d02adc8ae82561eeaf2bbe054ab774bdf9086fe7b690254512f590c49d977920f99e2f371
6
+ metadata.gz: c9e66fea702fe7f9edf9aa8679ec2c386e1c46079c9371b5cbae2964b25b9d84eb60ed65a54b34e54d123ab27e7bc2756dd4c9ee2fefffdd751187802d74976a
7
+ data.tar.gz: 1aaf85899a5269204bc817680c83c386e1b8132727712c49145cfa52627b72ea7301c8be6d08b28ae143daab2aa67aa0a61ec07854fb6b4a896c230b5843ccde
data/README.md CHANGED
@@ -54,7 +54,8 @@ Options:
54
54
  group will be generated in AWS
55
55
  -n, --allow-any-temporary-security-group The temporary security group will allow SSH connections
56
56
  from any IP address (0.0.0.0/0), otherwise allow the subnet's block
57
- -p, --aws-public-ip Launch instances with a public IP
57
+ -p, --aws-public-ip Launch instances with a public IP and use that IP for SSH
58
+ -q, --associate-public-ip Launch instances with a public IP and use the Private IP for SSH
58
59
  -t, --ssh-retries=<i> The number of times we should try sshing to the ec2 instance
59
60
  before giving up. Defaults to 30 (default: 30)
60
61
  -g, --tags=<s> Additional tags to add to launched instances in the form of
@@ -19,6 +19,7 @@ module AmiSpec
19
19
  @key_name = options.fetch(:key_name)
20
20
  @instance_type = options.fetch(:aws_instance_type)
21
21
  @public_ip = options.fetch(:aws_public_ip)
22
+ @associate_public_ip = options.fetch(:associate_public_ip)
22
23
  @region = options.fetch(:aws_region)
23
24
  @security_group_ids = options.fetch(:aws_security_groups)
24
25
  @tags = ec2ify_tags(options.fetch(:tags))
@@ -61,7 +62,7 @@ module AmiSpec
61
62
  key_name: @key_name,
62
63
  network_interfaces: [{
63
64
  device_index: 0,
64
- associate_public_ip_address: @public_ip,
65
+ associate_public_ip_address: @public_ip || @associate_public_ip,
65
66
  subnet_id: @subnet_id,
66
67
  }]
67
68
  }
@@ -12,6 +12,7 @@ module AmiSpec
12
12
  property :aws_public_ip
13
13
  property :aws_region
14
14
  property :aws_security_groups
15
+ property :associate_public_ip
15
16
  property :tags
16
17
  property :user_data_file
17
18
  property :iam_instance_profile_arn
@@ -1,3 +1,3 @@
1
1
  module AmiSpec
2
- VERSION = '1.7.0'
2
+ VERSION = '1.8.0'
3
3
  end
data/lib/ami_spec.rb CHANGED
@@ -38,7 +38,9 @@ module AmiSpec
38
38
  # aws_instance_type::
39
39
  # AWS ec2 instance type
40
40
  # aws_public_ip::
41
- # Should the instances get a public IP address
41
+ # Should the instances get a public IP address and use that IP for SSH
42
+ # associate_public_ip::
43
+ # Launch instances with a public IP but don't use that IP for SSH
42
44
  # ssh_user::
43
45
  # The username to SSH to the AMI with.
44
46
  # ssh_retries::
@@ -147,7 +149,8 @@ web_server,ami-id.',
147
149
  type: :string, default: nil, multi: true, short: :c
148
150
  opt :allow_any_temporary_security_group, 'The temporary security group will allow SSH connections from any IP address (0.0.0.0/0)',
149
151
  short: :n
150
- opt :aws_public_ip, 'Launch instances with a public IP', short: :p
152
+ opt :aws_public_ip, 'Launch instances with a public IP and use that IP for SSH', short: :p
153
+ opt :associate_public_ip, "Launch instances with a public IP but don't use that IP for SSH", short: :q
151
154
  opt :ssh_retries, 'The number of times we should try sshing to the ec2 instance before giving up. Defaults to 30',
152
155
  type: :int, default: 30, short: :t
153
156
  opt :tags, 'Additional tags to add to launched instances in the form of comma separated key=value pairs. i.e. Name=AmiSpec',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ami_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Robinson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-07-01 00:00:00.000000000 Z
12
+ date: 2021-11-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk-ec2