Commit Graph

670 Commits

Author SHA1 Message Date
Megan Marsh 6a895db9be converte block device encryption to trilean 2019-08-22 14:24:22 -07:00
Megan Marsh 1d9bba6fe3 change AMIEncryptBootVolume to trilean 2019-08-22 14:04:26 -07:00
Megan Marsh 1a6adadb89 convert EnableAMIENASupport to trilean in code 2019-08-22 13:18:22 -07:00
Megan Marsh 3c3f7f26ce implement custom data type "trilean" (tri-state-boolean) to track booleans which have a "null" or "unset" state. Previously we used *bool for these template options, but it turns out that those won't work because "unset" will evaluate to "false" if a user is using template variables to set the option that maps to a *bool. 2019-08-22 13:18:15 -07:00
Megan Marsh 4aa33306cb make sure that fleetId exists before trying to stick it into error message 2019-08-19 13:44:39 -07:00
Megan Marsh 316a30b31d fix spot_tags 2019-08-15 16:06:16 -07:00
Megan Marsh 9f6d14c75a work around spot_tags related regression and bad fleet cleanup in spot instances 2019-08-14 11:08:59 -07:00
Megan Marsh b42701380c add test for nil case 2019-07-29 12:11:59 -07:00
DanHam 088151e51d
Type assertion safety - fix panic when key cannot be retrieved from statebag 2019-07-28 10:44:24 +01:00
Christian Muehlhaeuser 216afbaa8b
Fixed various typos
Just a bunch of nit-picky typo fixes.
2019-07-25 06:49:51 +02:00
Megan Marsh 54d2ad5028 refactored step_ami_region_copy to fix bugs and clarify assumptions; added more tests for that step.
fix race condition caused by variable declaration outside of loop
2019-07-17 11:30:20 -07:00
Megan Marsh 39a4da4d07 add code to deduplicate the region list, and to make sure that the original region's kms key id is in the map. 2019-07-11 16:56:40 -07:00
Megan Marsh 6ad975f296 Revert "move SSHInterface/SSHIPVersion fields to communitator.Config struct"
This reverts commit b0c09087a2.
2019-07-02 10:46:10 -07:00
Megan Marsh 42611e6004 fix build 2019-07-01 13:03:33 -07:00
Megan Marsh a60f7e395e add a test to make sure we don't error becaue of spot price auto product, yet 2019-07-01 13:01:41 -07:00
Megan Marsh c722afe707 stop calculating spot bids; amazon changed the way spot instances are priced to be stable rather than bid-based, so when user sets auto, we can just default to the ondemand price and know that they'll get the same price as everyone else bidding at that time. 2019-07-01 13:01:41 -07:00
Daniel Rodgers-Pryor 8a9753032c Allow EC2 fleet packer instances to run in parallel
Without conflicting over the name of the launch template that they create/delete.

Previously, the launch template name was just hard coded to `packer-fleet-launch-template`, but since AWS enforces unique template names within an account, this caused simultaneously running packer instances to hit template-already-exists errors when creating their templates and race-conditions around deleting the template. Now, the template name is randomly generated on each run, so there should be no conflicts.
2019-06-30 16:19:35 +10:00
Megan Marsh 305592d8ed fix copy logic and tests 2019-06-17 15:38:28 -07:00
Megan Marsh 8cc82ca8d2 add broken test 2019-06-17 15:04:19 -07:00
Megan Marsh 0d55bc46ee add skip_save_build_region flag to fix naming conflicts when building for multiple regions 2019-06-17 14:39:11 -07:00
Megan Marsh 1c3b234b55
Merge pull request #7737 from hashicorp/document_retry
retry.Backoff: document
2019-06-13 10:54:08 -07:00
Adrien Delorme 98206d59d7 aws: step_create_tags make the max waiting time 30s and not 30ns 2019-06-11 12:37:52 +02:00
Pratyush Singhal d92e82c43f refactor: replace the maxBackoff from 30 nanosecond to 30 seconds
Co-Authored-By: Adrien Delorme <azr@users.noreply.github.com>
2019-06-11 16:01:03 +05:30
Pratyush singhal d4b0cb68e3 feat: add retry for temp key-pair generation in amazon-ebs
Signed-off-by: Pratyush singhal <psinghal20@gmail.com>
2019-06-10 22:45:02 +05:30
Megan Marsh 3f036b33c5 test for length of ami tags before tagging 2019-06-03 19:14:06 -07:00
Megan Marsh 078d888dba
Merge pull request #7707 from CARFAX/master
Enable encrypted AMI sharing across accounts
2019-06-03 13:08:06 -07:00
Jason McIntosh abef9820c7 Fixed spacing on comment 2019-05-30 17:25:36 -05:00
Jason McIntosh 24a4e2f23e Updated comments 2019-05-30 17:18:33 -05:00
Jason McIntosh 24bc50ce1b Enable encrypted AMIs with custom KMS Keys 2019-05-30 17:16:36 -05:00
Megan Marsh 6786c0d641 update tests to reflect new behavior 2019-05-30 16:17:23 -05:00
Megan Marsh bda09bf7d5 the build ami is made with an intermediary name, which means that we can't skip copying even from the original build region when unencrypted 2019-05-24 15:08:20 -07:00
Megan Marsh 708165eaa8 refactoring step_run_spot_instance and swapping out the calls to create a spot instance with a call to create a spot fleet of one, so that we can be more flexible with the instance type when desired 2019-05-24 09:32:54 -07:00
Megan Marsh 1062295ecd add omit_from_artifact option for ebssurragote launch_block_devices 2019-05-10 11:12:11 -07:00
Megan Marsh 2c352cc681 add tests for step_ami_region_copy 2019-05-03 14:47:09 -07:00
Megan Marsh 8c1d0f9686 clean up temporary unencrypted AMI and associated snapshots 2019-05-02 14:20:26 -07:00
Megan Marsh c0e69a9da0 if encrypt_boot is explicitly set to false, don't copy. Also, make sure we don't cause a wait group block when we aren't performing a copy. 2019-05-02 13:28:43 -07:00
Megan Marsh 105d3f8853 delete unencrypted temporary snapshot when encrypt_boot is true. Also, fix nil map error in region copy 2019-04-17 12:55:30 -07:00
Megan Marsh 201c8c1332 make sure that you encrypt using the provided kms key id and not the default 2019-04-15 16:44:56 -07:00
Adrien Delorme d72040f4fa move retry code into the common/retry pkg and make retry context aware 2019-04-09 17:46:38 +02:00
Adrien Delorme a81abd297b Merge remote-tracking branch 'origin/master' into context_provisioner 2019-04-08 20:09:01 +02:00
Megan Marsh 3e72e65a6c
Merge pull request #7456 from hashicorp/do_5770
introduce the clean_resource_name to clean image/var names
2019-04-05 09:12:20 -07:00
Adrien Delorme c4f3dccc14 rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
Adrien Delorme a4bf94dd3c change Builder to be passed a context for cancellation
we have to to give it to our hook
2019-04-03 15:55:55 +02:00
Adrien Delorme 9836dad0c9 introduce the clean_resource_name to clean image names and deprecate the old ones 2019-04-03 11:25:51 +02:00
Akshat Mahajan f07e4214cc Addresses issues #5384, #5494: Rename and change `temporary_security_group_source_cidr`
to accept a list of strings (for Amazon builders).

Per this change, `temporary_security_group_source_cidr` in the configuration:

1. Will be renamed to `temporary_security_group_source_cidrs`.
2. Will accept a list of CIDRs.
3. Will have its documentation updated to reflect this change.
4. Will have a fixer attached for newer templates to avail of.
2019-03-30 15:47:03 -07:00
programmer04 596a9cc7ff Improve error message for AWS and Alibaba 2019-03-15 23:38:05 +01:00
Megan Marsh 3ed9fe6dee remove unused imports
remove HttpClientWithEnvironmentProxy from amazon builders; let access config handle it
2019-03-04 16:42:33 -08:00
Megan Marsh ca9a5daf29 fix proxy and tls 2019-03-04 16:41:31 -08:00
Adrien Delorme f535464097 up a test 2019-02-27 11:17:56 +01:00
Adrien Delorme f03cbd8a10 aws: allow to pass nil bool as encryption parameter
to retain current encryption settings

this changes the fields :
* ami_config.encrypt_boot
* block_device.encrypted

This also removes StepCreateEncryptedAMICopy as this step is now done in StepAMIRegionCopy
2019-02-27 11:17:56 +01:00