798 Commits

Author SHA1 Message Date
James Nugent
395d88941c amazon: Allow SSH Agent auth for existing key pair
This commit allows SSH Agent authentication to be used with an existing
key pair defined in AWS.
2016-10-23 22:26:14 -05:00
James Nugent
7425fef2c7 builder/amazon: Allow use of local SSH Agent
This commit adds an option to use the local SSH Agent to authenticate
connections to source instances started by the the EBS and Instance
Store builders.

This is of use when the source AMI _already_ has configuration for
authorized SSH keys - for example if one uses an SSH certificate
authority.

A further extension (not implemented in this commit) is to allow SSH
agent use with a pre-defined key pair, in order to allow keys with
passphrases to be used without giving the passphrase to Packer.
2016-10-23 21:43:47 -05:00
Asif R Choudhury
48d94342ba Add us-east-2 (Ohio) AWS region 2016-10-17 21:31:41 -05:00
Rickard von Essen
c273bd6beb Merge pull request #3789 from jeremy-asher/amazon-ebs-delete-volumes-on-failure
clean up EBS volumes on failure
2016-10-15 14:57:15 +02:00
Rickard von Essen
0be3034e82 Merge pull request #3953 from rickard-von-essen/amz-ssh
builder/amazon: Allow using ssh_private_key_file and ssh_password
2016-10-03 10:22:15 +02:00
Rickard von Essen
acc2689b49
builder/amazon: Allow using ssh_private_key_file and ssh_password
This adds support for using amazon-ebs/amazon-instance builder without
a keypair. If a ssh_private_key_file is supplied without a
ssh_keypair_name no temporary ssh keypair is created. If ssh_password is
used no temporary ssh keypair is created and the password is used when
trying to connect.

Closes #2301
Closes #3156
2016-10-02 22:20:36 +02:00
Rickard von Essen
cffc8e892c Merge pull request #3382 from ahamidi/encrypted-boot-volume
Create AMI with encrypted boot volume
2016-10-02 01:02:43 +02:00
Chris Lundquist
9379cbc5d9 [dynamic-source-ami] support instance builder too 2016-10-01 23:01:01 +00:00
Chris Lundquist
ab3500b45c [dynamic-source-ami] support chroot builder 2016-10-01 22:56:09 +00:00
Chris Lundquist
1b4895c684 Merge remote-tracking branch 'origin/master' into dynamic-source-ami 2016-10-01 22:20:17 +00:00
Matthew Hooker
a9abe43325 builder/amazon: add retry login when creating tags.
also move Retry from builder/googlecompute/common to common/retry
2016-09-28 18:22:31 -07:00
Rickard von Essen
13c9db5dd5 Merge pull request #3885 from orivej/on-error
Add -on-error command line argument to allow preserving artifacts on builder errors
2016-09-20 12:28:14 +02:00
Jeremy Asher
aea05f6485 fix nil pointer dereference in amazon-chroot
The refactor of StepRegisterAmi to add the from_scratch parameter
incorrectly replaced iteration over image.BlockDeviceMappings with
iteration over the new mapping array when not using from_scratch.  This
fixes the regression and renames the parameters to newMappings and
mappings for better clarity.
2016-09-16 18:35:36 -07:00
Orivej Desh
6762965696 Add -on-error command line argument to allow preserving artifacts on builder errors
Resolves #409
2016-09-16 12:15:00 +00:00
Rickard von Essen
3b47893eb8
builder/amazon: reverted wrongly modified ssh_test's. 2016-09-14 20:26:09 +02:00
Rickard von Essen
067155c344
builder/amazon: guard aginst empty/nil PrivateIpAddress and updated tests. 2016-09-14 00:16:09 +02:00
Rickard von Essen
7f4bee737c Merge pull request #3752 from tarrall/issue3751-ssh-privateip-classic
builder/amazon: Honor ssh_private_ip flag in EC2-Classic, not just VPC
2016-09-13 22:54:00 +02:00
Rickard von Essen
120b60ae37 Merge pull request #3865 from dpiddy/amazon-ssh-retry-fix
amazon/common/ssh: fix saving of instance to state
2016-09-12 15:04:35 +02:00
Dan Peterson
c7af9a67bc amazon/common/ssh: fix saving of instance to state
Fixes #3496
2016-09-09 10:16:53 -03:00
Jeremy Asher
1c392b23f9 generate warnings for unused options with from_scratch 2016-09-03 12:32:43 -07:00
Jeremy Asher
ef0c7543e1 add amazon-chroot post mount commands
This adds an additional PostMountCommands step to the amazon-chroot
builder which executes after the volume is mounted, but before the
extra chroot mounts and copy step.
2016-09-03 12:32:41 -07:00
Jeremy Asher
5e8b697a76 add from_scratch option to amazon-chroot builder
This provides an alternate mode for the amazon-chroot builder which uses
a blank volume to build the image.  It adds StepPreMountCommands to
permit partitioning and format commands to be executed before mounting
the new volume.
2016-09-03 12:28:22 -07:00
Jeremy Asher
85ae04bb75 split up BlockDevices in amazon/common
This breaks up the two options provided by BlockDevices into separate
structs to allow only one of them to be used by the amazon-chroot
builder.
2016-09-03 09:58:45 -07:00
Chris Lundquist
defdd1ecf3 Merge remote-tracking branch 'origin/master' into dynamic-source-ami 2016-09-02 01:43:03 +00:00
Rickard von Essen
ba629922c6 Merge pull request #3662 from ryansb/boost-spot-bid
(AWS Spot) Add 0.5 cents to discovered spot price
2016-08-27 03:18:59 +02:00
Krzysztof Wilczynski
d01fb65dcf Fix. Use temporary_key_pair_name when specified. (#3739)
Fix: Use temporary_key_pair_name when specified.

This is to fix an issue where the temporary_key_pair_name configuration option
for amazon-ebs and amazon-instance builders would be ignored and replaced with
an automatically generated value using UUID, even when the option was explicitly
specified.

Remove space from the auto-generated SSH key-pair name.

Resolves #3736
2016-08-25 09:17:57 +02:00
Chris Lundquist
3cc8d35450 [dynamic-source-ami] fix old key name in error message 2016-08-21 00:58:01 +00:00
Chris Lundquist
b4d20706ce [dynamic-source-ami] add some very basic tests 2016-08-21 00:29:51 +00:00
Chris Lundquist
57e7a1a3e6 [dynamic-source-ami] fix lint error 2016-08-21 00:07:58 +00:00
Chris Lundquist
95afaa58ca [dynamic-source-ami] rename to source_ami_filter 2016-08-20 23:34:22 +00:00
Chris Lundquist
0e248f1516 [dynamic-source-ami] make most_recent work 2016-08-20 23:08:45 +00:00
Chris Lundquist
ec1abb9448 [dynamic-source-ami] proof of concept 2016-08-20 18:58:36 +00:00
Jeremy Asher
6130b8588d remove check for AMIs when deleting vols
This removes the unnecessary check for AMIs before cleaning up volumes.
AMIs will exist on a successful run, but not when a build fails after
instance creation (during provisioning for example).  The following
check for instance being nil should be sufficient.
2016-08-08 14:16:43 -07:00
Ali Hamidi
c6a527dc46 throw error if encrypted ami is shared 2016-07-29 15:01:24 -07:00
Ali Hamidi
1cecda639a add encrypted boot volume acceptance test 2016-07-29 15:01:24 -07:00
Ali Hamidi
902ae375b3 delete unencrypted snapshot 2016-07-29 15:01:24 -07:00
Ali Hamidi
53b3867c50 allow packer to create an encrypted copy of the AMI 2016-07-29 15:01:24 -07:00
Robert Tarrall
94bf981d3b Honor ssh_private_ip flag in EC2-Classic, not just VPC
VpcId will be nil in Classic, but we may still wish to ssh to the
instance's private IP address -- if for example we are using security
groups to block SSH access via the public IP.
2016-07-26 08:15:44 -06:00
Chris Bednarski
c0b637b0c5 Merge pull request #3733 from envato/no-shutdown-behaviour-instance-backed
No shutdown behaviour instance backed
2016-07-19 01:49:05 -07:00
Ricard Clau
172a1c7a57 add source ami to output 2016-07-07 00:05:59 +01:00
Chris Bednarski
ee5c5260a4 Merge pull request #3663 from liv3d/add_ap-south-1
Add support for ap-south-1 in AWS
2016-07-06 14:09:24 -07:00
Chris Bednarski
443ffd68f2 Added explicit error when SG is not working 2016-07-02 15:48:51 -07:00
Dan Offord
4428079a68 Add support for ap-south-1 in AWS
Amazon recently announced support for ap-south-1 in Mumbai, adding this
to the list of known regions to Packer
2016-06-29 15:44:02 +01:00
Ryan S. Brown
c68ddef4e9 (AWS Spot) Add 0.5 cents to discovered spot price
Related to #2979 , in volatile spot markets the automatic price can
cause your instances to be evicted if the spot price rises. This change
adds one half a cent to your bid to protect against small amounts of
price volatility.
2016-06-29 07:00:21 -04:00
Mike LoSapio
080806243e Added a hook to query the security groups before launching the instance - seems to catch the AWS eventual consistency nicely 2016-06-27 16:20:53 -04:00
Patrick Robinson
40bd45764c Only set InstanceInititatedShutdownBehavior on ebs instances 2016-06-27 10:28:54 +10:00
Chris Bednarski
ab9621ab7d Added aws shutdown_behavior to the changelog 2016-06-14 14:34:01 -07:00
Patrick Robinson
f361e1d894 Precompile regex 2016-06-14 14:29:10 -07:00
Patrick Robinson
b1d6d28a90 Add unit tests for shutdown behaviour 2016-06-14 14:29:10 -07:00
Patrick Robinson
a9f914ea97 Add shutdown_behaviour option
This means an instance will terminate upon shutdown.
2016-06-14 14:29:10 -07:00