Commit Graph

797 Commits

Author SHA1 Message Date
Matthew Hooker 21812fa17f
Add volume and run tags if in us-gov/china
We can't tag on instance creation when we're in "restricted" regions,
so let's add the tags after the resources have been created.

Adds methods to AccessConfig to detect if we're in China or US Gov
regions (i.e. "restricted").

Also turns tag:tag maps into a type, and moves methods around validating
and converting them to ec2Tags to methods of the type.
2018-02-05 16:39:20 -08:00
Matthew Hooker eafda52411
use amazon steps from master 2018-01-24 17:09:18 -08:00
Matthew Hooker 7a189a83a1
fix imports
`find . -type f -name '*.go' -not -path "./vendor/*" -exec goimports -w {} \;`
2018-01-24 17:09:17 -08:00
Matthew Hooker a831d522be
change run signatures
Run now takes a context as well as a statebag. We'll assign the context
to the blank identifier to prevent namespace collisions. We'll let the
step authors opt-in to using the context.

`find . -iname "step_*.go" -exec gsed -i'' 's/func \(.*\)Run(/func \1Run(_ context.Context, /' {} \;`
2018-01-24 17:09:17 -08:00
Matthew Hooker a0c625ea44
Revert "working with opt-in"
This reverts commit 4068ffdaf541354e75507add7ca0b193993fcd52.
2018-01-24 17:09:16 -08:00
Matthew Hooker e98f201602
working with opt-in 2018-01-24 17:09:16 -08:00
Matthew Hooker 366dc3da0a
move multistep imports to helper.
gomvpkg -from "github.com/mitchellh/multistep" -to "github.com/hashicorp/packer/helper/multistep"
2018-01-24 17:09:15 -08:00
Matthew Hooker 807e88245b
trying to add context to state bag 2018-01-24 17:09:15 -08:00
Matthew Hooker cea2ab8c6d
move kms/encrypted validation to block devices 2018-01-12 15:10:51 -08:00
Jason Wieringa 2ac59b3c27 builder/amazon: Added KmsKeyID to BlockDevice
+ Adds kms_key_id to list of options
+ Tests that configuraiton is set along with encrypted
+ Updates documentation on ebsvolume builder
2018-01-11 20:27:38 -08:00
Matthew Hooker f5ea1e8312
Use WaitUntilInstanceReady waiter 2018-01-10 15:57:31 -08:00
Matthew Hooker c5bcb97d06
"borrow" access config code from terraform.
This gives us a few benefits:

* timeout early if metadata service can't be reached
* report which auth provider we're using
* give much better errors if something goes wrong
2018-01-04 15:04:07 -08:00
Matthew Hooker 98c2a2d1f7
builder/aws: catch static credential errors early.
If we're using static credentials, either both the access key and secret key must be set, or neither of them should be.
2018-01-04 11:50:27 -08:00
Matthew Hooker f3dea272d9
Set session in state bag
We can construct connections to arbitrary regions from it
2017-12-19 11:32:33 -08:00
Matthew Hooker 1c352726d7
Merge pull request #5719 from rchenv/issue5606
Ensure all AWS connections are configured alike
2017-12-19 11:32:24 -08:00
Rong Chen 3e92b1374e issue5606: follow the convention to use AccessConfig to create new aws session for step_create_tags etc. 2017-12-19 10:34:12 -08:00
Olivier Bazoud 8bcb469b8b builder/amazon: Added new region Paris - eu-west-3 2017-12-19 10:00:03 +01:00
Matthew Hooker f216330ba3
spot instance ena/sriov checking for all other builders 2017-12-08 14:56:19 -08:00
Matthew Hooker 73b98b2a04
use waiter to wait for ebs instances to stop 2017-12-08 13:38:48 -08:00
Matthew Hooker dada63801b
also use waiter code for spot instances 2017-12-08 13:38:48 -08:00
Matthew Hooker 9e61005f7c
Merge pull request #5660 from hashicorp/fix_5625
modify validation to allow user to have the original region in the am…
2017-12-08 13:36:10 -08:00
Ben Gnoinski 5df2e040d0 Update amazon run_config.go absent ssh_private_key_file error 2017-12-08 08:51:27 -08:00
Matthew Hooker 2c1c7b9659
Merge pull request #5630 from johndaviesco/winrm_no_proxy
Winrm no proxy
2017-12-07 15:41:16 -08:00
Matthew Hooker a90c45d9bb
Wait until source instance OK before continuing 2017-12-07 12:31:50 -08:00
Matthew Hooker 7b5c0900ef
Correctly set aws region if given in template along with a profile. 2017-12-07 11:12:57 -08:00
Megan Marsh 1c681fc096 tests 2017-11-30 14:08:48 -08:00
Megan Marsh 556da47d35 modify validation to allow user to have the original region in the ami_regions list 2017-11-30 13:51:33 -08:00
John Davies-Colley 10aaa49beb fixing tests and funky logic 💦 2017-11-28 14:42:14 +13:00
John Davies-Colley 0c787ec9df Valadating early 2017-11-28 11:46:32 +13:00
John Davies-Colley 75320440ec adding missing quote 🙏 2017-11-22 15:59:15 +13:00
John Davies-Colley 707ec675b2 ssh interface for amazon builders 🔨 2017-11-22 15:49:38 +13:00
Matthew Hooker 0a24f4eb2e
don't shadow package name 2017-11-07 16:05:43 -08:00
Matthew Hooker 545ee45567
debug region we found 2017-11-07 14:51:20 -08:00
Matthew Hooker c106e7c26c
Don't set region from metadata if profile is set. 2017-11-07 14:33:26 -08:00
Matthew Hooker 52fc0100eb
this is a critical error 2017-11-07 12:52:03 -08:00
Matthew Hooker 95e4ae251e
WIP 2017-11-02 09:03:44 -07:00
Matthew Hooker e87b468c6e
Merge pull request #5536 from hashicorp/fix5535
add delay option to security group waiter
2017-11-02 08:54:34 -07:00
Matthew Hooker 8ab390a048
Merge pull request #5495 from smaato/master
Fix regressions relating to spot instances and EBS volumes
2017-11-02 08:53:27 -07:00
Matthew Hooker f2413ff138
add delay option to security group waiter 2017-11-02 00:25:54 -07:00
Matthew Hooker d322fc6c19
Shorten metadata timeout
When running in travis, metadata requests will timeout after 5 seconds.
After 24 such timeouts, we'll hit travis' build timeout of two minutes,
and the build will fail. Lowering it to 100 gets us in a safe time
limit. We _may_ need to expose a timeout env var with this logic,
however.
2017-10-30 15:22:15 -07:00
Matthew Hooker 314fc94bd8
clean up 2017-10-30 15:02:39 -07:00
Matthew Hooker 0e4ea7420b
fix tests 2017-10-30 14:34:16 -07:00
Matthew Hooker c65fa8490d
fix various bugs deregistering AMIs
always deregister ami in session region
validate that session region does not appear in ami_regions
2017-10-30 14:17:19 -07:00
Matthew Hooker 6c4fbe8d87
use correct default region when deregistering AMIs. 2017-10-30 13:07:58 -07:00
Mark Meyer 7e1646826d Check if VolumeTags is empty before tagging volumes
Related to #5486
2017-10-23 21:10:40 +02:00
Matthew Hooker f7e269945e
add cidr validation and rename option 2017-10-12 17:05:56 -07:00
Matthew Hooker c74be87187 Merge pull request #5384 from dave2/sg-source-cidr
[WIP] Allow temporary security group to have source CIDR block explicit
2017-10-12 17:05:45 -07:00
Mark Meyer dbb3c76032 Remove redundant step and its usage
StepTagEBSVolumes is no longer needed, since this functionality is now
taken over by StepRunSourceInstance and StepRunSpotInstance. So remove
this functionality from the codebase.
2017-10-12 21:40:21 +02:00
Mark Meyer 2661fd7869 Move building of spot instances into its own step 2017-10-04 12:38:21 +02:00
Mark Meyer 939b44b4fd Add logic to handle volumes of spot instances 2017-10-03 01:03:21 +02:00
Mark Meyer cfd6b6fed5 Change EBS builder to do tag-on-creation
The EBS builder will now use the tag-on-creation pattern, so
that it's possible to restrict packer to only create volumes that are
properly tagged by using an AWS policy.
2017-10-03 00:13:02 +02:00
Megan Marsh 201e8c05a0 add ami name to output 2017-09-26 16:04:40 -07:00
Zanetti, David 8a8b51be97 Allow temporary security group to have source CIDR block explicitly provided 2017-09-26 00:57:56 +00:00
Zanetti, David 42dc1e4795 In Amazon builders, allow tag names to be interpolated like values 2017-09-25 02:24:23 +00:00
Megan Marsh 1adcce6046 Merge pull request #5284 from hashicorp/fix_5093
Allow granular modification of sriov and ena enhanced networking opti…
2017-08-29 14:28:42 -07:00
Megan Marsh f19040f3aa Merge pull request #5196 from cstuntz/aws-add-tags
Upgrade aws-sdk-go to 1.10.14, add tags at instance run time
2017-08-28 13:17:29 -07:00
Megan Marsh 2d4bc70d7b use ami prefix to make it clear that these variables are amazon specific
add fixer, fixer tests
2017-08-28 11:21:27 -07:00
Megan Marsh 9e2e467b31 Allow granular modification of sriov and ena enhanced networking options in amazon amis. Maintain old functionality. 2017-08-25 14:49:53 -07:00
Megan Marsh 7da52e1f77 Merge pull request #5250 from hashicorp/repro_3399
make force_deregister work in all regions, not just original region.
2017-08-24 14:41:02 -07:00
Łukasz Kostka 8703937cde Natural order of AMI artifacts 2017-08-24 20:57:12 +02:00
Megan Marsh 14b2d04332 make force_deregister work in all regions, not just original region. 2017-08-14 12:31:58 -07:00
Matthew Hooker 754c80d217
create default tags as well 2017-08-11 12:31:05 -07:00
cstuntz db7f860d91 Adding tagging back to spot instances, after they're created 2017-08-11 10:43:05 -07:00
Megan Marsh a924db9a79 Merge pull request #5228 from hashicorp/4653_dont_delete_snapshots
continue, not break
2017-08-08 15:07:01 -07:00
Megan Marsh ef0a091720 continue, not break 2017-08-08 14:53:56 -07:00
Matthew Hooker 968eb94b80 Merge pull request #5211 from hashicorp/4653_dont_delete_snapshots
use block device mappings to know whether a snapshot existed before p…
2017-08-08 14:31:38 -07:00
Megan Marsh 2d6028eb9a use named loops instead of doDelete flag 2017-08-08 14:28:01 -07:00
Megan Marsh e9ec705497 use block device mappings to know whether a snapshot existed before packer's current run. If yes, don't delete the unencrypted snapshot. 2017-08-08 13:59:55 -07:00
Megan Marsh c760e1323f don't panic if the communicator is none and the port is 0 2017-08-03 13:54:57 -07:00
cstuntz c717765154 Removing tagging post instance launch 2017-08-02 09:29:47 -07:00
cstuntz 42444e58e6 Updating step_run_source_instance to add tags at instance start instead of adding them to running instance 2017-07-31 11:38:30 -07:00
Megan Marsh ac15b33d2b Merge pull request #5029 from hashicorp/5007_instance_stop
add exponential backoff retry for stopping instance in amazon
2017-06-20 12:08:52 -07:00
Megan Marsh f7a703dfb2 add pending to allowable states while waiting for ebs instance to stop 2017-06-20 10:55:23 -07:00
Megan Marsh d706147423 add exponential backoff retry for stopping instance in amazon
retry only if the error is instancenotfound
2017-06-20 10:50:57 -07:00
Matthew Hooker febc65aa7c
try again to get region from metadata 2017-06-14 16:30:18 -07:00
Matthew Hooker 8dae6b60c1 Merge pull request #4996 from hashicorp/mwhooker/4613
builder/amazon: Support Assume Role with MFA and ECS Task Roles
2017-06-13 17:40:09 -07:00
Matthew Hooker 350e8bfe0d
we don't need to look for region in metadata.
Closes #4615'
2017-06-13 17:35:48 -07:00
Matthew Hooker 94d7a4ce8d
post-processor/vagrant-cloud: try upload once
* fixes multiple uploads mentioned in #4973
* removed unused token code
2017-06-12 17:34:32 -07:00
Matthew Hooker 4860d7179d
remove redundant log line 2017-06-09 13:00:08 -07:00
Constantin Bugneac ae03dab920 Print in the output the security group name too. 2017-06-09 20:05:59 +01:00
Matthew Hooker a619759bf7
add support for profile 2017-06-09 11:24:30 -07:00
Matthew Hooker 3fb4162660
remove code from bad merge 2017-06-09 11:07:29 -07:00
Matthew Hooker 624aaa2067
bugfix 2017-06-09 11:01:27 -07:00
Matthew Hooker 3ed7572525
remove cli_config 2017-06-09 10:59:50 -07:00
Matthew Hooker f637878822
with wrapping 2017-06-09 10:46:01 -07:00
Matthew Hooker 23084fe171
dedupe 2017-06-09 10:41:58 -07:00
Rickard von Essen 15f80dc5ab
aws: Drop undocumented option `profile`
This was added in 883acb18fa to support
assume role and shared configuration file. This was never completed.
2017-06-09 10:37:54 -07:00
Matthew Hooker 56c513088b
I think this was the intention 2017-06-09 10:34:49 -07:00
Matthew Hooker 94854a26d9
fix go vet issue 2017-06-09 10:30:07 -07:00
Matthew Hooker d7e39b72b2
remove dead code 2017-06-09 10:30:07 -07:00
Rickard von Essen f106e60a7e
builder/amazon: Added MFA support 2017-06-09 10:28:31 -07:00
Rickard von Essen f55c3b9d34
builder/amazon: Support assume role with assume_role_arn
This supports assuming a role when using profile or static credentials.
2017-06-09 10:27:56 -07:00
Rickard von Essen 3833d34829
builder/amazon: Cleaned up credential handeling
This properly handles:
- Preference between types of credential
- Assume role via ECS Task Role
2017-06-09 10:26:22 -07:00
Matthew Hooker 1f4b532ed5 Merge pull request #4948 from hashicorp/kms_key_regions
Kms key regions
2017-06-01 13:30:31 -07:00
Megan Marsh 875745ab9b one more test 2017-05-31 14:16:02 -07:00
Megan Marsh 1944f38985 update docs and clean up 2017-05-31 13:41:32 -07:00
Megan Marsh 5b35d199da golang has different style than python 2017-05-31 12:27:45 -07:00
Megan Marsh f9d7292566 builder/amazon regional KMS keys 2017-05-31 11:23:18 -07:00
Jason Ramey cc309c0e5f spelling fix 2017-05-26 01:03:11 -04:00
Matthew Hooker 0e3469e913
spell fix 2017-05-25 18:49:45 -07:00
Megan Marsh 7174a7a3d5 New map: region_kms_key_ids, allowing custom encryption keys on a per-region basis. Also new tests. 2017-05-25 14:42:03 -07:00
Matthew Hooker 77b4d47409
only delete snapshots which exist 2017-05-25 14:16:20 -07:00
Matthew Hooker 1cf4754d80
correct ami_name error reporting 2017-05-25 13:02:36 -07:00
Megan Marsh 4abb541468 fix logging to clarify that encrypt_boot needs to be set, not encrypt, and fix typo 2017-05-24 16:39:36 -07:00
Matthew Hooker 4137660b7a
fix ami name validation 2017-05-19 02:11:43 -07:00
Matthew Hooker ee5d13611f
update ssh client usage for new crypto/ssh version 2017-05-18 12:01:44 -07:00
Rémi Jouannet 45143bb6f4 add an option custom_endpoint_ec2 for amazon builder, add a condition if vpc_id is empty don't add the parameter to the aws call 2017-05-17 18:45:20 +02:00
Ben Fagin 6f63881020 fixes a typo introduced in a previous change 2017-05-11 13:34:48 -07:00
luis-silva a269bbc6fa Fix issue 4875 - use retry logic when creating instance tags 2017-05-11 16:25:28 +01:00
Matthew Hooker 80d6cd91fd
remove unneeded keypair var 2017-05-01 10:17:21 -07:00
Matthew Hooker 602fd64c5d
builder/amazon: set flag to delete temporary keypair 2017-04-30 14:24:22 -07:00
Matthew Hooker da8c4004f0
builder/amazon: numbers are valid in ami name 2017-04-05 12:39:16 -07:00
Matthew Hooker 3f6b5165f2
add affirmative test case for #4762 2017-04-04 22:08:09 -07:00
Craig Barr d9041bda0c Improved the test for special character so that it doesn't get halted by less than 3 character check 2017-04-05 11:06:59 +10:00
Craig Barr 7911cfa94b Formatting as per make fmt 2017-04-05 11:02:23 +10:00
Craig Barr fdae6858c8 conforming to the standard for imports 2017-04-05 10:53:58 +10:00
Craig Barr df6337e8ab Added AMIName validation (issue 4761) 2017-04-05 10:46:44 +10:00
Matthew Hooker 81522dced0
move packer to hashicorp 2017-04-04 13:39:01 -07:00
Matthew Hooker cc11ec3566
check for a couple errors 2017-03-28 20:36:21 -07:00
Matthew Hooker 35578d9ed1
remove unnecessary type conversions 2017-03-28 20:36:21 -07:00
Matthew Hooker 79287d7e47
simplify some code 2017-03-28 20:36:20 -07:00
Matthew Hooker 0149f679de
Print instead of Printf with no dynamic first variable. 2017-03-28 20:36:20 -07:00
Matthew Hooker 230079f73a
spell fixes 2017-03-28 20:36:19 -07:00
Matthew Hooker 74c8c585f5
builder/amazon: report tag creation 2017-03-23 16:12:59 -07:00
Matthew Hooker bd76b7bb6f
builder/amazon: validate ssh key name/file
When using ssh_key_name, ssh_private_key file must be given,
or ssh_agent_auth enabled.

When automatically retrieving the winrm password, if ssh_key_name is
given, ssh_private_key_file must also be given.
2017-03-13 13:14:18 -07:00
Rickard von Essen 2300b102b7 amazon: Step Region Copy crashing on device mapping
Closes #4635
2017-03-08 18:12:37 +01:00
James Nugent e856339309 build/amazon-ebssurrogate: Add region copy, attributes, tags steps
As pointed out in the initial code review of #4351, some of the steps
from the standard EBS builder were (intetionally) omitted. It turns out
that these actually are useful, and the original rationale for the
omission was wrong. Consequently, this commit adds in the following
steps:

- `StepPrevalidate`
- `StepTagEBSVolumes`
- `StepDeregisterAMI`
- `StepCreateEncryptedAMICopy`
- `StepAMIRegionCopy`
- `StepModifyAMIAttribute`
- `StepCreateTags`

We also fix the interpolation filter and documentation to reflect these
additions, though the majority were already documented and just not
functional.
2017-02-27 09:05:39 -06:00
Matthew Hooker fd1b00a0d1
use aws helper method 2017-02-26 19:33:34 -08:00
Matthew Hooker 61976dfd86 Merge pull request #4578 from life360/enable_ena
Always set both SRIOV and ENA when Enhanced Networking is enabled
2017-02-26 19:31:22 -08:00
Matthew Hooker 6a7c37beb6
builder/amazon-chroot: support encrypted boot volume 2017-02-26 17:48:13 -08:00
Matthew Hooker 2cb9b32acf
don't attempt to delete non-existant key when using agent auth 2017-02-26 17:38:22 -08:00
Matthew Hooker f95514c120
fix ssh agent authentication
treat key name to empty string if it's not been set
by prior step.
2017-02-26 17:17:49 -08:00
Aaron Stone 1cc3cdf7b5 Always set both SRIOV and ENA when Enhanced Networking is enabled
Set SriovNetSupport to "simple". As of February 2017, this applies to C3, C4,
D2, I2, R3, and M4 (excluding m4.16xlarge).

Set EnaSupport to true. As of February 2017, this applies to C5, I3, P2, R4,
X1, and m4.16xlarge.
2017-02-25 07:16:35 -08:00
Richard Owen 33a4c2e13b Change EC2 WindowsPasswordTimeout to 20 minutes
10 minutes is often exceeded when using a custom source AMI
which has been sysprepped.
2017-02-24 11:08:17 +00:00
Rickard von Essen 6e891cf682
Fixed botched merge and review comments 2017-01-22 21:57:23 +01:00
Rickard von Essen ba9cae5078 builder/amazon: Add SourceAMI and BuildRegion template
Added {{ .SourceAMI }} and {{ .BuildRegion }} template values availible
in `ami_description`, `run_tags`, `run_volume_tags`, `tags`, and
`snapshot_tags`.
2017-01-21 20:39:58 +01:00
Matthew Hooker fc30f6cc0a
log tag creation.
closes #4427
2017-01-19 12:00:41 -08:00
Matthew Hooker 56b5e97bf4
verify given security group 2017-01-18 15:25:31 -08:00
Matthew Hooker b265d2614f
builder/amazon: fix when using security_group_id
If `security_group_id` was specified with a group that didn't exist, packer
would go into an infinite loop waiting for it. We shouldn't make assumptions
about the status of explicitely set security groups, so let's just error out
right away if we can't find it.
2017-01-18 15:11:52 -08:00
Matthew Hooker 800351b7ca
fix panic and don't print each tag we add. 2017-01-18 11:34:36 -08:00
Roman Zhuzha d9186dc8cf add proper error handling for tagging source instance 2017-01-18 14:02:10 +01:00
Roman Zhuzha a65af51a4b apply source instance default "Name" tag only if it's not provided in run_tags 2017-01-18 12:55:18 +01:00
Roman Zhuzha aa70c82ec8 use ConvertToEC2Tags to apply tags to source instance, add Say message 2017-01-18 12:50:20 +01:00
Matthew Hooker 377f451a9e
it's InvalidGroup 2017-01-05 16:56:49 -08:00
Matthew Hooker e54605c120
Properly wait for security group to exist.
Adds check for `InvalidGroupID.NotFound` in addition to
`InvalidSecurityGroupID.NotFound`.

Uses aws's `waiter` for clarity.
2017-01-05 15:20:28 -08:00
Zanetti, David ae5730c5a5 Querying EC2 security groups should report unexpected errors
As noted in #4277, we don't report any errors from the loop waiting for
a security group to exist. Instead, we should accept 'errors' which result
from the group not yet existing, and report errors which are actual issues
the user needs to resolve (eg, IAM permissions are incorrect).

Closes #4277
2016-12-21 11:45:12 +13:00
Rickard von Essen d3c2239b9e
builder/amazon: Change shutdown_behaviour to shutdown_behavior 2016-12-14 21:59:16 +01:00
Rickard von Essen c24b4423b2 builder/amazon: Added new region London - eu-west-2 2016-12-14 10:55:19 +01:00
Alexander Krasnukhin ac98aad1df Fix log statement 2016-12-13 12:53:03 +01:00
Matthew Hooker f1fb942219
add ca-central-1 to list of known aws regions.
resolves #4273
2016-12-09 11:21:44 -08:00
Rickard von Essen 5c4d331a34 Added missing LaunchPermission 2016-12-06 09:59:09 +01:00
Rickard von Essen 4ce3b8712a
Replace unencrypted EBS snapshots with encrypted
To ensure that groups and users attributes are added to the encrypted
snapshots.
2016-12-06 03:31:09 +01:00
Rickard von Essen c3a352955e amazon: Added snapshot_users and snapshot_groups 2016-12-04 16:03:01 +01:00
Ari Aviran 46f217f255 amazon - Snapshot permissions correctly applied
Fixes #3344
2016-12-04 16:03:01 +01:00
Rickard von Essen d7a7d8c852
It's not possible to share encrypted AMI's 2016-12-04 15:52:23 +01:00
poida 8b13b75097 Updated documentation and error messages
The docs for kms_key_id needed to be next to encrypt_boot.

Shortened some of the kms_key_id error messages.
2016-12-03 07:49:54 +11:00
poida 7ea17e1630 Allow custom encrypted AMIs to be shared
When using a custom KMS key to encrypt the boot volume of an AMI, packer should allow it to be shared with other users.
2016-12-03 07:49:54 +11:00
poida 3eed6fd508 Added KMS CMK support to EBS builder
Added the 'kms_key_id' parameter. This supports supplying a customer master key (CMK) when encrypting the EBS volume.

The parameter is optional and only takes effect when 'encrypted' is true. When 'encrypted' is true but 'kms_key_id' is missing the 'aws/ebs' key will be used.
2016-12-03 07:49:34 +11:00
Rickard von Essen 8d2ceea5f1 builder/amazon: crash on tagging snapshot when snapshot_tags is unset
Closes #4238
2016-12-01 20:43:15 +01:00
Rickard von Essen bcc7f455b3 amazon: Fix source_ami_filter ignores owners 2016-12-01 14:29:31 +01:00
Matthew Hooker 832de2104b
Revert "Merge pull request #4230 from mitchellh/revert-4223-closes_3320"
This reverts commit bda89b0c42, reversing
changes made to f9f9d82419.
2016-11-30 13:28:34 -08:00
Matthew Hooker f5c3c25d2b Revert "Adds `force_delete_snapshot` flag" 2016-11-30 13:10:22 -08:00
Arthur Burkart 5b59f56cdb Adds `force_delete_snapshot` flag
This PR adds the ability for Packer to clean up snapshots in addition to
deregistering AMIs at build time.

To test this, I used the following `test.json` file:

```json
{
  "builders": [
    {
      "type": "amazon-ebs",
      "region": "us-east-1",
      "source_ami": "ami-fce3c696",
      "ami_name": "packer-test",
      "instance_type": "m3.medium",
      "ssh_username": "ubuntu",
      "vpc_id": "some-vpc-id",
      "subnet_id": "some-subnet-routed-through-igw",
      "security_group_id": "some-security-group-with-port-22-access",
      "force_delete_snapshot": true
    }
  ],
  "provisioners": [
    {
      "type": "shell-local",
      "command": "echo 'hello'"
    }
  ]
}

```

I appreciate any constructive feedbakc that can be given. Cheers!
2016-11-29 23:39:36 -05:00
Rickard von Essen a09f20f996 Merge pull request #4015 from artburkart:closes_3908
Closes #3908: Adds snapshot tag overrides
2016-11-26 17:54:00 +01:00
Arthur Burkart 0c7e73b1cf
Implements Snapshot tagging
While implementing my acceptance test, I stumbled upon a comment stating
that snapshot deletion should also be implemented, so I snuck that in. I
can't help but wonder if there is some generic logic that is implemented
a few times throughout the packer code base that could maybe better serve
us if it were abstracted to the common package.
2016-11-26 17:48:26 +01:00
Rickard von Essen 17eda06d61
Fixed formatting 2016-11-24 21:12:20 +01:00
ephemeralsnow e53f4be005 Fix 'The AssociatePublicIpAddress parameter is only supported for VPC launches.' 2016-11-24 17:01:32 +01:00
Rickard von Essen 96e9a8e6e9 Removed default value for ssh_username 2016-11-17 22:30:34 +01:00
Arthur Burkart 2e65867cba Closes #3908: Adds snapshot tag overrides
This commit adds the ability to configure unique tags on snapshots
that are separate from the tags defined on the AMI. Anything applied
to the AMI will also be applied to the snapshots, but `snapshot_tags`
will override and append tags to the tags already applied to the snapshots
2016-11-15 23:16:27 -05:00
Matthew Hooker 9a91ae4e8f
fix new session error when creating cred chain.
the old and deprecated method won't error and so is safe to use
even if we're not in amazon.
2016-11-14 11:39:22 -08:00
Matthew Hooker d81c06765d
fix go vet issue.
closes #4130
2016-11-07 10:17:53 -08:00
Matthew Hooker f3f5f89fe6 Merge pull request #4096 from mitchellh/filterday
builder/amazon-ebs: show ami id found from filter
2016-11-02 12:25:46 -07:00
Matthew Hooker 60c459d6c8 Merge pull request #4098 from mitchellh/newsession
aws-sdk: use session.NewSession
2016-11-02 12:25:14 -07:00
Matthew Hooker 9bc23ea512 Merge pull request #4099 from mitchellh/waitfail
Waitfail
2016-11-02 12:21:51 -07:00
James Nugent b1ff8c3bfc builder/amazon: Add `ebs-volume` builder
This commit adds a builder that works like EBS builders, except does not
create an AMI, and instead is intended to create EBS volumes in an
initialized state. For example, the following template can be used to
create and export a set of 3 EBS Volumes in a ZFS zpool named `data` for
importing by instances running production systems:

```
{
	"variables": {
		"aws_access_key_id": "{{ env `AWS_ACCESS_KEY_ID` }}",
		"aws_secret_access_key": "{{ env `AWS_SECRET_ACCESS_KEY` }}",
		"region": "{{ env `AWS_REGION` }}",
		"source_ami": "{{ env `PACKER_SOURCE_AMI` }}",
		"vpc_id": "{{ env `PACKER_VPC_ID` }}",
		"subnet_id": "{{ env `PACKER_SUBNET_ID` }}"
	},
	"builders": [{
		"type": "amazon-ebs-volume",
		"access_key": "{{ user `aws_access_key_id` }}",
		"secret_key": "{{ user `aws_secret_access_key` }}",
		"region": "{{user `region`}}",
		"spot_price_auto_product": "Linux/UNIX (Amazon VPC)",

		"ssh_pty": true,
		"instance_type": "t2.medium",
		"vpc_id": "{{user `vpc_id` }}",
		"subnet_id": "{{user `subnet_id` }}",
		"associate_public_ip_address": true,
		"source_ami": "{{user `source_ami` }}",
		"ssh_username": "ubuntu",
		"ssh_timeout": "5m",

		"ebs_volumes": [
			{
				"device_name": "/dev/xvdf",
				"delete_on_termination": false,
				"volume_size": 10,
				"volume_type": "gp2",
				"tags": {
					"Name": "TeamCity-Data1",
					"zpool": "data",
					"Component": "TeamCity"
				}
			},
			{
				"device_name": "/dev/xvdg",
				"delete_on_termination": false,
				"volume_size": 10,
				"volume_type": "gp2",
				"tags": {
					"Name": "TeamCity-Data2",
					"zpool": "data",
					"Component": "TeamCity"
				}
			},
			{
				"device_name": "/dev/xvdh",
				"delete_on_termination": false,
				"volume_size": 10,
				"volume_type": "gp2",
				"tags": {
					"Name": "TeamCity-Data3",
					"zpool": "data",
					"Component": "TeamCity"
				}
			}
		]
	}],
	"provisioners": [
	{
		"type": "shell",
		"start_retry_timeout": "10m",
		"inline": [
			"DEBIAN_FRONTEND=noninteractive sudo apt-get update",
			"DEBIAN_FRONTEND=noninteractive sudo apt-get install -y zfs",
			"lsblk",
			"sudo parted /dev/xvdf --script mklabel GPT",
			"sudo parted /dev/xvdg --script mklabel GPT",
			"sudo parted /dev/xvdh --script mklabel GPT",
			"sudo zpool create -m none data raidz xvdf xvdg xvdh",
			"sudo zpool status",
			"sudo zpool export data",
			"sudo zpool status"
		]
	}
	]
}
```

StepModifyInstance and StepStopInstance are now shared between EBS and
EBS-Volume builders - move them into the AWS common directory and rename
them to indicate that they only apply to EBS-backed builders.
2016-11-02 12:56:39 -04:00
Matthew Hooker d47e47cf1f rewrite to not use private aws package 2016-11-01 18:29:18 -07:00
Matthew Hooker c4c46c349e implement security group waiter 2016-11-01 18:10:42 -07:00
Matthew Hooker 970b37077e Merge pull request #4050 from jen20/ssh-agent
builder/amazon: Allow use of local SSH Agent
2016-11-01 17:27:37 -07:00
Matthew Hooker 48bdae93d1 aws-sdk: use session.NewSession 2016-11-01 15:53:04 -07:00
Matthew Hooker 83b57b98ac show ami id found from filter 2016-11-01 15:26:43 -07:00
Matthew Hooker d920b3fbf4 run gofmt 2016-11-01 14:08:04 -07:00
Matthew Hooker 0dd7d7ff3b fix error message 2016-10-31 16:44:18 -07:00
Ganesh kumar Sankaran b9c6139d67 AWS async operations sometimes takes long times, if there are multiple parallel builds, polling at 2 second frequency will exceed the request limit. Allow 2 seconds to be overwritten with AWS_POLL_DELAY_SECONDS 2016-10-31 16:44:18 -07:00
Rickard von Essen d66490ebfd
Properly cleanup AWS temporary key pairs
Closes #4057 - Amazon key pair no longer cleaned up at end of build
2016-10-27 23:06:13 +02:00
Rickard von Essen d16d5d9686 Merge pull request #3817 from ChrisLundquist/dynamic-source-ami
Dynamic source ami
2016-10-25 21:24:41 +02:00
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 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 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 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 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
Ali Hamidi c6a527dc46 throw error if encrypted ami is shared 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 a9f914ea97 Add shutdown_behaviour option
This means an instance will terminate upon shutdown.
2016-06-14 14:29:10 -07:00
owjjh 658fadbc53 changing if conditionals to be ! instead of == false 2016-06-07 09:21:43 -04:00
owjjh d489ce9904 make fmt run 2016-06-06 14:37:09 -04:00
owjjh de5b69a8df Adding ability to skip region validation when using AWS 2016-06-06 14:17:12 -04:00
Chris Chalfant 8163e16e02 gofmt code 2016-03-14 13:49:42 -04:00
Chris Chalfant 72a7123a0b Add option to tell packer not to stop the instance
It is sometimes desirable to sysprep a windows machine before creating
an EC2 image. The AWS-approved way to do this is to run
ec2configservice.exe -sysprep and let ec2configservice shut down the instance.
This change adds an option to disable the stop instance call issued by packer
so that the user can control when the machine is stopped.
2016-03-14 12:54:03 -04:00
Chris Bednarski d0ab8658bc Create a session for EC2RoleProvider; prevents crash; fixes #3123 2016-02-19 17:10:05 -08:00
Chris Bednarski 4458de4ea0 Reformat 2016-02-11 23:53:40 -08:00
Chris Bednarski 765ec5cf39 Merge pull request #2962 from dave2/postprocess_amazon_ova
New post-processor: amazon-import
2016-02-11 23:38:15 -08:00
Chris Bednarski 358b5c62e2 Merge pull request #3143 from ThatGerber/iam-roles
IAM CLI Profile/Assume Role Support
2016-02-04 16:47:09 -08:00
Christopher Gerber e7711c31ea Wrong function to convert int to string. 2016-02-04 16:18:57 -06:00
Christopher Gerber b75d561c56 Fixes more windows testing errors.
"constant 9999999999 overflows int" running test on CI server. Replaced with timestamp to unixnano
2016-02-04 16:12:18 -06:00
Christopher Gerber d25ba245f4 Fixes bytes to string issues in Windows build. 2016-02-04 16:05:49 -06:00
Christopher Gerber a6aefa859f Fixes issue in build where multiple processes were trying to access the same file. 2016-02-04 15:39:54 -06:00
Christopher Gerber 6c3e0daf24 Added tests. Updated CLIConfig to pass tests. 2016-02-04 14:56:22 -06:00
Chris Bednarski e6b6f0b020 Merge pull request #2539 from fnoeding/amazon-ebs-fix-ec-user-data-encoding
amazon builder: always base64 encode ec2 user data
2016-02-03 16:47:01 -08:00
Christopher Gerber f1ae2a2b5a Moved assume credentials to CLIConfig. Added new functions and methods to CLIConfig. Ran gofmt. 2016-02-03 15:53:01 -06:00
Christopher Gerber 4cf9e36085 Changes credential/config file opener to use homedir instead of HOME environmental variable. 2016-02-03 10:43:48 -06:00
Christopher Gerber 7975c5e336 Move CLIConfig instantiation inside of ProfileName check. 2016-02-02 08:36:36 -06:00
Christopher Gerber 883acb18fa IAM Role Switching
Adds initial IAM Role Switching support and support for AWS CLI Credential and Config files.

See: https://github.com/mitchellh/packer/issues/3109
2016-02-01 18:55:59 -06:00
Chris Bednarski 0cad32c696 Move region list into a function so we can re-use it in tests 2016-01-12 19:03:21 -08:00
Chulki Lee 20c0f6b02b fix doc: wrong function name 2016-01-11 13:06:34 -08:00
Chulki Lee 1aa24035fc add ap-northeast-2: Asia Pacific (Seoul) 2016-01-11 13:05:18 -08:00
Chulki Lee 7018517374 one region per line, sorted 2016-01-11 13:04:35 -08:00
Chulki Lee 3f0795b23c sort regions by name 2016-01-11 13:04:00 -08:00
Chulki Lee 7f3f5f4bfa add tests for all ami regions 2016-01-11 13:02:38 -08:00
David Zanetti 418da16991 Track the import task and report AMIs created from it 2015-11-23 15:55:09 +13:00
Luke Amdor 8682dec178 aws: build after upstream breaking change
see 1a69d06935
2015-10-30 13:58:56 -05:00
Mark Peek eb15536041 Merge pull request #2774 from btd/btd-patch-1
Fix AMI creation - replace not allowed character , and add allowed .
2015-10-26 22:00:16 -07:00
Mark Peek 4e1e9b788a Merge pull request #2845 from abridgett/feature/spot_price_zero
spot_price of "0" to mean on demand
2015-10-26 21:51:44 -07:00
Denis Bardadym 25e2ff7b85 Fix not allowed comma, add all allowed special characters 2015-10-19 13:41:30 +03:00
Mark Peek 6f5c64db41 Merge branch 'use-default-volumesize' 2015-10-18 13:04:41 -07:00
Mark Peek fc39f07ecc Add EbsOptimized to RequestSpotInstances (#2806) 2015-10-18 11:39:36 -07:00
Mark Peek edda3de677 Merge pull request #2806 from abridgett/feature/add_ebs_optimized_support
Add ebs_optimized support
2015-10-18 11:31:50 -07:00
Mark Peek f6c7e3740f Don't create EBS block device if VirtualName is specified 2015-10-18 11:05:21 -07:00
Mark Peek 914e78f602 builder/amazon/common: go fmt 2015-10-18 11:00:05 -07:00
Mark Peek 581c3574f6 Merge pull request #2672 from lightpriest/b-aws-ebs-block-device
Fix and refactor block device mapping builder
2015-10-18 10:56:53 -07:00
Mark Peek 45829c30e5 builder/amazon/*: fix go vet 2015-10-11 12:18:23 -07:00
Adrian Bridgett da771c469e spot_price of "0" to mean on demand
this helps avoid duplicating packer templates just to select
spot instances or not
2015-10-06 22:13:17 +01:00
Adrian Bridgett 8349e22df9 Add ebs_optimized support 2015-10-06 21:36:21 +01:00
Or Cohen 2a94b596ce Fix and refactor block device mapping builder
Fix NoDevice not properly configured #2398.
Refactor the mapping builder to match BlockDeviceMapping from AWS SDK:

* If NoDevice is specified, include NoDevice only.
* If VirtualName starts with ephemeral, don't create Ebs (they are mutually
  exclusive anyway)
* Otherwise, assume Ebs and create it with the exact specified attributes by
  the user.

Change/add tests to reflect these changes.
2015-08-25 00:24:05 +03:00
Chris Bednarski 1a775c05d9 Update calls to amazon to match the upstream
- see http://aws.amazon.com/releasenotes/2948141298714307
- run awsmigrate-renamer on each amazon module (chroot, instance, etc.)
2015-08-17 17:44:01 -07:00
Chris Bednarski 4cc443da8e Update use of ec2rolecreds to match upstream 2015-08-10 13:59:56 -07:00
Chris Bednarski abb67fdd79 Fix govet issues 2015-08-05 19:41:29 -07:00
Florian Noeding 62c39888b4 amazon builder: always base64 encode ec2 user data 2015-07-31 16:34:33 +02:00
Florian Noeding 98b9d22b68 amazon builder: only fetch password for winrm 2015-07-31 15:34:25 +02:00
Chris Bednarski a9c299d9c4 Merge pull request #2404 from mitchellh/b-instance-destroy
amazon/common: store instance ID earlier for cleanup
2015-07-28 18:24:37 -07:00
Chris Bednarski 28bf1877c2 Updated AWS SDK calls to match the 0.7.0 release of the AWS SDK 2015-07-28 17:10:21 -07:00
Yo Takezawa 628462b919 Use snapshot size if you don't specify a VolumeSize 2015-07-21 14:07:30 +09:00
Tommy Ulfsparre 241903d0b0 no point in setting iops on a standard volumes 2015-07-15 17:18:03 -07:00
Chris Bednarski c615539929 Reformat long lines 2015-07-15 17:17:59 -07:00
Chris Bednarski 9365a43179 Reformat 2015-07-15 17:07:36 -07:00
Tommy Ulfsparre ae064207d5 Add test for ephemeral block device mapping 2015-07-15 17:05:32 -07:00
Anthony Spring 224bb78175 Make EBS block device mapping optional for ephemeral virtual names. 2015-07-15 17:04:45 -07:00
Mitchell Hashimoto 26aa3dd575 amazon/common: store instance ID earlier for cleanup 2015-07-07 11:07:38 -06:00
Steven Merrill 0869c9fe64 Fix #2830. 2015-07-02 10:23:44 -04:00
Mitchell Hashimoto 0a2e54feaf builder/amazon: output WinRM password for debug mode [GH-2336] 2015-06-29 09:40:15 -07:00
Mitchell Hashimoto 95dd79740f Merge pull request #2324 from tcahill/group-launch-permissions
Fix setting ami_groups
2015-06-29 09:30:51 -07:00
Mitchell Hashimoto 7b64723a11 Merge pull request #2327 from emate/fix-for-spot-requests-cleanup
Fixes spot instance cleanup.
2015-06-29 09:24:01 -07:00
Mitchell Hashimoto aab5ca7059 update CHANGELOG 2015-06-29 09:22:33 -07:00
Marcin Matlaszek 3eaf7f38b0 Fix adding launch permissions for created ami. 2015-06-29 15:39:27 +02:00
Tom Cahill 6644d76982 Use aws.String to obtain string pointers 2015-06-26 12:08:44 -07:00
Tom Cahill 016d916d83 Fix adding groups to AMI launch permissions.
Previously, groups were granted launch permissions by submitting a
ModifyImageAttribute request with the UserGroups parameter set
appropriately. This is no longer valid, as the LaunchPermission
parameter must be set.
2015-06-26 10:52:27 -07:00
Marcin Matlaszek 586cab11ee Fixes spot instance cleanup. 2015-06-26 15:29:46 +02:00
Tommy Ulfsparre 8ae0cfc759 copy and convert to pointer 2015-06-25 20:07:45 +02:00
Clint 7b9d48799e Merge pull request #2316 from jjappi/fix-aws-tagging
Fix failing AMI snapshot tagging when copying to other regions.
2015-06-25 10:17:34 -05:00
Marcin Matlaszek dd97a60c9b Fix for tag creation when creating new ec2 instance. 2015-06-25 17:02:38 +02:00
Jani Jappinen c537623bc6 Fix failing AMI snapshot tagging when copying to other regions. 2015-06-25 17:25:28 +03:00
Clint Shryock 7af5d5419a builder/amazon: Fix issue with sharing AMIs with ami_users 2015-06-24 11:41:58 -05:00
Mitchell Hashimoto 944b4bf46c common: delete file if checksum fails 2015-06-22 12:17:29 -07:00
Clint 6579219013 Merge pull request #2282 from mitchellh/f-amazon-cleanup-volumes
builder/amazon-ebs: Clean up orphan volumes
2015-06-22 12:56:26 -05:00
Clint Shryock c9714ce69e builder/amazon-ebs: Clean up orphan volumes
Fixes #1783
2015-06-19 10:22:39 -05:00
Mitchell Hashimoto 9c0f37b2c9 builder/amazon: fix weird edge cases with key names [GH-2281] 2015-06-19 06:21:20 +02:00
Mitchell Hashimoto b7dab2689a fmt 2015-06-18 05:23:04 +02:00
Mitchell Hashimoto de2004c1c9 Merge branch 'master' of https://github.com/nyetsche/packer into nyetsche-master 2015-06-15 15:21:58 -07:00
Clint Shryock d22c4173d3 fix crash when waiting for an instance that has failed 2015-06-15 11:53:21 -05:00
Clint 2372393f64 Merge pull request #2212 from mitchellh/f-amazon-add-tags-to-snapshots
Add EBS snapshot tags #846 #1219
2015-06-15 10:05:57 -05:00
Clint 8fca582278 Merge pull request #2221 from mitchellh/f-amazon-force-deregister-artifacts
builder/amazon: Add force_deregister option
2015-06-15 10:02:30 -05:00
Mitchell Hashimoto ccf20568a7 Merge pull request #2240 from mitchellh/f-windows
Windows AWS instances
2015-06-14 10:52:10 -07:00
Mitchell Hashimoto b8d5bd3776 Merge pull request #2242 from emate/spot_network_interfaces_fix
Fix network interface spec when requesting spot.
2015-06-14 10:48:59 -07:00
Marcin Matlaszek b51761ca36 Fix network interface spec when requesting spot. 2015-06-14 17:47:45 +02:00
Mitchell Hashimoto e9d916a7bc builder/amazon: don't print windows password 2015-06-13 23:14:48 -07:00
Mitchell Hashimoto 8f6ecfd9e3 builder/amazon: various fixes (minor) to get things going 2015-06-13 23:12:59 -07:00
Mitchell Hashimoto 022a115d19 builder/amazon: improve messaging 2015-06-13 22:42:10 -07:00
Mitchell Hashimoto d23f254b76 builder/amazon: don't get password if platform not set on image 2015-06-13 22:39:19 -07:00
Mitchell Hashimoto fd4e0e9da4 builder/amazon: StepGetPassword 2015-06-13 22:35:45 -07:00
Mitchell Hashimoto 115d583cff helper/communicator: make host more generic 2015-06-13 19:23:33 -04:00
Mitchell Hashimoto e557928119 builder/amazon: use helper/communicator 2015-06-13 18:16:12 -04:00
Clint Shryock bec59b535d builder/amazon: Add force_deregister option, to automatically deregister artifacts with name conflicts 2015-06-12 13:23:47 -05:00
Clint Shryock 1fbf8b7f32 update create_tags for new sdk 2015-06-11 10:43:27 -05:00
Clint Shryock a8155e17aa merge acaire/add-ebs-snapshot-tags 2015-06-11 10:33:55 -05:00
Clint Shryock 2056fda4d3 builder/amazon: Allow spaces in AMI names 2015-06-10 16:19:36 -05:00
Mitchell Hashimoto be4a82dfae amazon/*: fix some merge conflicts 2015-06-10 10:33:01 -07:00
Mitchell Hashimoto 8e1db0d94c Merge branch 'fix_amazon_instance_waits' of https://github.com/renat-sabitov/packer into renat-sabitov-fix_amazon_instance_waits 2015-06-10 10:31:21 -07:00
Jan Schumann 802cfa3871 make sure IOPS is not set for empty VolumeType 2015-06-10 17:21:25 +02:00
Jan Schumann 5d600c70f2 added test to illustrate wrong behavior 2015-06-10 17:20:41 +02:00
Clint Shryock 4da118c64f fix up tests 2015-06-09 11:56:40 -05:00
Clint Shryock 999b0874cc Update AWS EBS builder to fix invalid params 2015-06-09 11:38:53 -05:00
Clint 455d57a87f Merge pull request #2187 from mitchellh/f-aws-add-prevalidate-step
builder/aws: Add pre validate step, to validate things before building.
2015-06-08 22:02:36 -05:00
Clint Shryock 68040f786c show AMI id in error message 2015-06-08 22:00:59 -05:00
Clint Shryock 231f01cd35 builder/aws: Add pre validate step, to validate things before building. 2015-06-08 17:08:39 -05:00
Mitchell Hashimoto 984bbc3a1e amazon/common: wording nit 2015-06-08 09:38:50 -07:00
Mitchell Hashimoto 8aec42e363 update CHANGELOG 2015-06-08 09:25:56 -07:00
Mitchell Hashimoto 9387cc1ea1 Merge pull request #2175 from henrysher/fix-duplicate-ami
check the region before do the ami copy to fix the duplicate ami [GH-2123]
2015-06-08 09:20:02 -07:00
Henry Huang 052b5e6699 "Name" parameter required for copying ami across regions [GH-2172] 2015-06-05 11:15:48 +00:00
Henry Huang a5c476c6fe check the region before do the ami copy to fix [GH-2123] 2015-06-04 06:16:44 -04:00
Seth Vargo 33ca8b7fb5 Migrate to new AWS repo 2015-06-03 17:13:52 -04:00
Mitchell Hashimoto edf3415c6e builder/amazon: delete physical private key for debug mode [GH-1801] 2015-05-29 17:10:14 -07:00
Mitchell Hashimoto 913d6f6996 builder/amazon/common: fix compilation issues with latest libs 2015-05-28 10:20:34 -07:00
Mitchell Hashimoto 07734133a3 builder/amazon: fix test failures 2015-05-28 09:44:33 -07:00
Mitchell Hashimoto 3031886aaf Merge branch 'master' of https://github.com/aocsolutions/packer into aocsolutions-master 2015-05-28 09:35:02 -07:00
Mitchell Hashimoto 11e2fad6d0 Merge pull request #2022 from mefellows/issue/2021
Report error during Temporary Security Group creation in AWS EBS builder
2015-05-28 08:32:55 -07:00
Mitchell Hashimoto b78b119a11 amazon/*: fix merge issues with lib switch 2015-05-28 08:31:22 -07:00
Mitchell Hashimoto 44b980e659 Merge branch 'aws-sdk-go' of https://github.com/jen20/packer into jen20-aws-sdk-go 2015-05-28 08:24:41 -07:00
jszwedko b1497b951c code.google.com/p/go.crypto/ssh -> golang.org/x/crypto/ssh
code.google.com/p/go.crypto/ssh is now at golang.org/x/crypto/ssh as of
https://code.google.com/p/go/source/detail?spec=svn.crypto.69e2a90ed92d03812364aeb947b7068dc42e561e&repo=crypto&r=8fec09c61d5d66f460d227fd1df3473d7e015bc6

Using the code.google.com import redirects properly, but runs into
issues if you try to use a subpackage of `ssh`, e.g. `agent` which
refers to golang.org/x/crypto/ssh causing conflicts if your types expect
code.google.com/p/go.crypto/ssh.

This is a precursor to a PR for #1066.
2015-05-28 08:17:49 -07:00
Mitchell Hashimoto c78c4e78ad amazon/common: sleep 3 seconds if instance doesn't exist 2015-05-27 20:15:07 -07:00
Mitchell Hashimoto f78d7eefdc Merge pull request #2129 from lokulin/master
Fixes #2128 Retry the AWS API when looking for a newly created instance
2015-05-27 20:14:14 -07:00
Mitchell Hashimoto 50d7c598e9 amazon/ebs: use new interpolation stuff 2015-05-27 11:35:56 -07:00
lokulin bda4ef7c65 Retry the AWS API when looking for a newly created instance
Sometimes the AWS API responds that it can't find a newly created
instance if you poll it too soon after creation.  Retry a few times
to be sure it really hasn't been created.
2015-05-22 15:08:51 +10:00
James Nugent 65a9347b1e Fix potential nil pointer errors in ported code
This commit adds extra nil checks for some pointers which were not
necessary when using goamz
2015-04-15 12:17:44 -07:00
James Nugent e99cd56b6c Migrate from mitchellh/goamz to awslabs/aws-sdk-go
This commit moves the Amazon builders of Packer away from the Hashicorp
fork of the goamz library to the official AWS SDK for Go, in order that
third party plugins may depend on the more complete official library
more easily.
2015-04-12 21:33:09 -04:00
Matt Fellows a973dce7d3 Report error code during Temporary Security Group creation (#2021) 2015-04-07 12:11:34 +10:00
Nevins Bartolomeo 6686b62347 AWS availability zone could be incorrect when using spot instances with no AZ specified 2015-04-03 20:52:54 -04:00
renat-sabitov-sirca d046e1cc5b Fixing transient AWS errors during EBS builds
Relates to #1539

AWS is eventually consistent and instance can be not visibile for
some time after creation. This fix eliminates describe-instances
call before going to the proper wait loop
2015-03-11 10:34:21 +11:00
Ash Caire 361e859556 Add EBS snapshot tags 2015-03-01 10:27:30 +11:00
Emil Hessman 05c2206684 builder/amazon/common: fix incorrect printf verb type in amiRegionCopy
Fixes the following vet reports:

builder/amazon/common/step_ami_region_copy.go:81: arg target for printf verb %s of wrong type: github.com/mitchellh/goamz/aws.Region
builder/amazon/common/step_ami_region_copy.go:93: arg target for printf verb %s of wrong type: github.com/mitchellh/goamz/aws.Region
2015-02-25 05:29:53 +01:00
Lesko, Matthew (NIH/NLM/NCBI) [C] 43f08b2664 go fmt all the things 2015-01-13 22:58:41 -05:00
Lesko, Matthew (NIH/NLM/NCBI) [C] 62e054c404 simplify output 2015-01-13 21:40:15 -05:00
Lesko, Matthew (NIH/NLM/NCBI) [C] 9d097f9d4e Permit Temp keys and named SSH keypairs
These changes permit the use of pre-created SSH keypairs with AWS. If
so, the configuration for the builder needs to include an
ssh_keypair_name option and a ssh_private_key_file.

If ssh_private_key_file is *not* defined, it'll go through the
rigamarole of creating a temporary keypair. The ssh_keypair_name option
by itself won't make that change, because it doesn't make sense to
specify a keypair but not tell packer where the private key is, but it
does happen that you could have a private key and the public-key is
"baked in", and not part of your EC2 account.
2015-01-13 16:27:33 -05:00