Commit Graph

115 Commits

Author SHA1 Message Date
Megan Marsh 2cfba56265 fix typos 2019-05-07 16:44:29 -07:00
Megan Marsh 02c9f24531 allow user to set architecture 2019-05-07 16:38:55 -07:00
Megan Marsh 2c352cc681 add tests for step_ami_region_copy 2019-05-03 14:47:09 -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 aee73d745d update code after go mod update 2019-04-11 14:19:24 +02: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 9f82b75e57 Use the hashicorp/go-getter to download files
* removed packer.Cache and references since packer.Cache is never used except in the download step. The download step now uses the new func packer.CachePath(targetPath) for this, the behavior is the same.
* removed download code from packer that was reimplemented into the go-getter library: progress bar, http download restart, checksuming from file, skip already downloaded files, symlinking, make a download cancellable by context.
* on windows if packer is running without symlinking rights and we are getting a local file, the file will be copied instead to avoid errors.
* added unit tests for step_download that are now CI tested on windows, mac & linux.
* files are now downloaded under cache dir `sha1(filename + "?checksum=" + checksum) + file_extension`
* since the output dir is based on the source url and the checksum, when the checksum fails, the file is auto deleted.
* a download file is protected and locked by a file lock,
* updated docs
* updated go modules and vendors
2019-03-13 12:11:58 +01:00
Megan Marsh 0196d7f835
Merge pull request #7370 from sargun/allow-users-to-specify-custom-block-device-mapping
amazon-chroot: Allow users to specify custom block device mapping
2019-03-12 14:21:23 -07: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
Sargun Dhillon 601e754438 amazon/chroot: Allow creating new block device mappings !not fromScratch
Previously, when you built from an existing image, you were unable
to reconfigure block device mappings, as it just took them and
copied them over. This allows users to specify new, custom
block device mappings, even when building from an existing
image.
2019-03-04 13:11:14 -08: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
Megan Marsh 3704a053d0 move region validation and credential wait into step pre validate 2019-02-05 14:07:04 -08:00
Megan Marsh 035c3506ba manually set proxyfromenvironment in default http client for ec2 sessions 2019-01-25 12:33:25 -08:00
Matthew Hooker 9181570bc3
remove stray struct dumps in logs 2018-09-27 00:14:05 -07:00
Sargun Dhillon 07ce820c70 Enable setting the volume type when building with the Amazon Chroot builder 2018-09-06 13:22:09 -07:00
Sargun Dhillon 902497d6ce Allow users to build hvm images from pv images to have ena_support 2018-09-04 18:16:52 -07:00
Megan Marsh ff6a039d5b replace scrubconfig with packer.LogSecretFilter.Set
filter winrm password from logs
Add new root-level packer template option, sensitive-variables, to tell us what user variables to mark sensitive.
2018-08-20 15:35:55 -07:00
Anshul Sharma 885ecb0790
Issue-6309 Amazon Chroot Provider
-  Add tags on CreateVolume
2018-07-18 13:01:15 +03:00
Megan Marsh e670eed315 Add new option, nvme_device_path, so that we can properly mount nvme block devices. 2018-05-23 09:16:40 -07:00
Megan Marsh 59e3ec722d allow user to mount entire block device in chroot builder 2018-04-25 10:47:52 -07: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 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 f6c401a143
don't pass in accessconfig 2017-12-19 11:32:32 -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
Krzysztof Wilczynski 05327b7524
amazon: Remove Session Token (STS) from being shown in the log.
This commit adds a change which ensures that the Session Token
config struct item is removed from log output.

Signed-off-by: Krzysztof Wilczynski <kw@linux.com>
2017-12-04 22:14:38 +01: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
Megan Marsh 85ad1f58fb include ena_support and sriov_support in chroot and instance docs 2017-08-29 09:36:06 -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 14b2d04332 make force_deregister work in all regions, not just original region. 2017-08-14 12:31:58 -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
Matthew Hooker 56c513088b
I think this was the intention 2017-06-09 10:34:49 -07:00
Megan Marsh b8c2a5fd43 fix step initializer everywhere StepAMIRegionCopy is called 2017-06-01 09:28:17 -07:00
Matthew Hooker 81522dced0
move packer to hashicorp 2017-04-04 13:39:01 -07:00
Matthew Hooker e4aa2a34ca
builder/amazon-chroot: nullable copy_files
Allow users to specify that they don't want any
files copied into the chroot by setting an empty
copy_files list
2017-03-24 13:51:47 -07:00
Matthew Hooker 50d9546658
builder/amazon: set force_deregister to true on -force 2017-03-09 14:24:49 -08:00
Matthew Hooker 6a7c37beb6
builder/amazon-chroot: support encrypted boot volume 2017-02-26 17:48:13 -08: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
Rickard von Essen c3a352955e amazon: Added snapshot_users and snapshot_groups 2016-12-04 16:03:01 +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
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 48bdae93d1 aws-sdk: use session.NewSession 2016-11-01 15:53:04 -07:00
Matthew Hooker d920b3fbf4 run gofmt 2016-11-01 14:08:04 -07:00
Chris Lundquist ab3500b45c [dynamic-source-ami] support chroot builder 2016-10-01 22:56:09 +00: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
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