From 5499c370807d4780ba13de2a676fae969faf51c7 Mon Sep 17 00:00:00 2001 From: Arthur Burkart Date: Wed, 26 Oct 2016 23:36:35 -0400 Subject: [PATCH 1/3] Adds add'l docs regarding delete_on_termination This PR adds documentation pointing out that volumes are not by default deleted on termination of any AWS EC2 instance during a packer build. --- website/Makefile | 4 +-- ...root.html.md => amazon-chroot.html.md.erb} | 15 +++++---- ...zon-ebs.html.md => amazon-ebs.html.md.erb} | 3 +- ...ce.html.md => amazon-instance.html.md.erb} | 2 +- .../_ami-block-device-mappings.html.md | 33 +++++++++++++++++++ 5 files changed, 46 insertions(+), 11 deletions(-) rename website/source/docs/builders/{amazon-chroot.html.md => amazon-chroot.html.md.erb} (97%) rename website/source/docs/builders/{amazon-ebs.html.md => amazon-ebs.html.md.erb} (99%) rename website/source/docs/builders/{amazon-instance.html.md => amazon-instance.html.md.erb} (99%) create mode 100644 website/source/partials/builders/_ami-block-device-mappings.html.md diff --git a/website/Makefile b/website/Makefile index b703f68fb..8c327cad0 100644 --- a/website/Makefile +++ b/website/Makefile @@ -13,5 +13,5 @@ format: bundle exec htmlbeautifier -t 2 source/*.erb bundle exec htmlbeautifier -t 2 source/layouts/*.erb @pandoc -v > /dev/null || echo "pandoc must be installed in order to format markdown content" - pandoc -v > /dev/null && find . -iname "*.html.md" | xargs -I{} bash -c "pandoc -r markdown -w markdown --tab-stop=4 --atx-headers -s --columns=80 {} > {}.new"\; || true - pandoc -v > /dev/null && find . -iname "*.html.md" | xargs -I{} bash -c "mv {}.new {}"\; || true + pandoc -v > /dev/null && find . -iname "*.html.md*" | xargs -I{} bash -c "pandoc -r markdown -w markdown --tab-stop=4 --atx-headers -s --columns=80 {} > {}.new"\; || true + pandoc -v > /dev/null && find . -iname "*.html.md*" | xargs -I{} bash -c "mv {}.new {}"\; || true diff --git a/website/source/docs/builders/amazon-chroot.html.md b/website/source/docs/builders/amazon-chroot.html.md.erb similarity index 97% rename from website/source/docs/builders/amazon-chroot.html.md rename to website/source/docs/builders/amazon-chroot.html.md.erb index 210fa4c73..4fd3e830e 100644 --- a/website/source/docs/builders/amazon-chroot.html.md +++ b/website/source/docs/builders/amazon-chroot.html.md.erb @@ -122,18 +122,19 @@ each category, the available configuration keys are alphabetized. `ec2:ModifyInstanceAttribute` to your AWS IAM policy. - `force_deregister` (boolean) - Force Packer to first deregister an existing - AMI if one with the same name already exists. Default false. + AMI if one with the same name already exists. Default `false`. - `from_scratch` (boolean) - Build a new volume instead of starting from an - existing AMI root volume snapshot. Default false. If true, `source_ami` is + existing AMI root volume snapshot. Default `false`. If true, `source_ami` is no longer used and the following options become required: `ami_virtualization_type`, `pre_mount_commands` and `root_volume_size`. The below options are also required in this mode only: - - `ami_block_device_mappings` (array of block device mappings) An entry - matching `root_device_name` should be set. See the - [amazon-ebs](/docs/builders/amazon-ebs.html) documentation for more - details on this parameter. + - `ami_block_device_mappings` (array of block device mappings) - Add the block + device mappings to the AMI. A `device_name` entry matching `root_device_name` + should be set. The block device mappings allow for keys: + + <%= partial "partials/builders/ami-block-device-mappings" %> - `root_device_name` (string) - The root device name. For example, `xvda`. @@ -170,7 +171,7 @@ each category, the available configuration keys are alphabetized. this field must be defined. - `skip_region_validation` (boolean) - Set to true if you want to skip - validation of the `ami_regions` configuration option. Defaults to false. + validation of the `ami_regions` configuration option. Default `false`. - `source_ami_filter` (object) - Filters used to populate the `source_ami` field. Example: diff --git a/website/source/docs/builders/amazon-ebs.html.md b/website/source/docs/builders/amazon-ebs.html.md.erb similarity index 99% rename from website/source/docs/builders/amazon-ebs.html.md rename to website/source/docs/builders/amazon-ebs.html.md.erb index 8e10b7aed..f55c30a4d 100644 --- a/website/source/docs/builders/amazon-ebs.html.md +++ b/website/source/docs/builders/amazon-ebs.html.md.erb @@ -174,7 +174,7 @@ builder. `security_group_id`. - `skip_region_validation` (boolean) - Set to true if you want to skip - validation of the region configuration option. Defaults to false. + validation of the region configuration option. Default `false`. - `source_ami_filter` (object) - Filters used to populate the `source_ami` field. Example: @@ -359,3 +359,4 @@ up all residual volumes that are not designated by the user to remain after termination. If you need to preserve those source volumes, you can overwrite the termination setting by specifying `delete_on_termination=false` in the `launch_block_device_mappings` block for the device. + diff --git a/website/source/docs/builders/amazon-instance.html.md b/website/source/docs/builders/amazon-instance.html.md.erb similarity index 99% rename from website/source/docs/builders/amazon-instance.html.md rename to website/source/docs/builders/amazon-instance.html.md.erb index 75e1cb246..0fcad4e5a 100644 --- a/website/source/docs/builders/amazon-instance.html.md +++ b/website/source/docs/builders/amazon-instance.html.md.erb @@ -189,7 +189,7 @@ builder. `security_group_id`. - `skip_region_validation` (boolean) - Set to true if you want to skip - validation of the region configuration option. Defaults to false. + validation of the region configuration option. Default `false`. - `source_ami_filter` (object) - Filters used to populate the `source_ami` field. Example: diff --git a/website/source/partials/builders/_ami-block-device-mappings.html.md b/website/source/partials/builders/_ami-block-device-mappings.html.md new file mode 100644 index 000000000..abd80af45 --- /dev/null +++ b/website/source/partials/builders/_ami-block-device-mappings.html.md @@ -0,0 +1,33 @@ +- `delete_on_termination` (boolean) - Indicates whether the EBS volume is + deleted on instance termination. Default `false`. **NOTE**: If this + value is not explicitly set to `true` and volumes are not cleaned up by + an alternative method, additional volumes will accumulate after + every build. + +- `device_name` (string) - The device name exposed to the instance (for + example, "/dev/sdh" or "xvdh"). Required when specifying `volume_size`. + +- `encrypted` (boolean) - Indicates whether to encrypt the volume or not + +- `iops` (integer) - The number of I/O operations per second (IOPS) that the + volume supports. See the documentation on + [IOPs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html) + for more information + +- `no_device` (boolean) - Suppresses the specified device included in the + block device mapping of the AMI + +- `snapshot_id` (string) - The ID of the snapshot + +- `virtual_name` (string) - The virtual device name. See the documentation on + [Block Device + Mapping](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html) + for more information + +- `volume_size` (integer) - The size of the volume, in GiB. Required if not + specifying a `snapshot_id` + +- `volume_type` (string) - The volume type. gp2 for General Purpose (SSD) + volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic + volumes + From 1a0dc767f38ec270773bc745c7cbcdb76470cb17 Mon Sep 17 00:00:00 2001 From: Arthur Burkart Date: Tue, 15 Nov 2016 22:55:59 -0500 Subject: [PATCH 2/3] Rolls back `partials` work, but still consolidates Since the packer website isn't yet ready to use middleman partials, this commit rolls back the partials in favor of bringing parity to each amazon docs page --- website/Makefile | 4 +- ...root.html.md.erb => amazon-chroot.html.md} | 39 +++++++++++++++++-- ...zon-ebs.html.md.erb => amazon-ebs.html.md} | 16 +++++++- ...ce.html.md.erb => amazon-instance.html.md} | 17 +++++++- .../_ami-block-device-mappings.html.md | 33 ---------------- 5 files changed, 66 insertions(+), 43 deletions(-) rename website/source/docs/builders/{amazon-chroot.html.md.erb => amazon-chroot.html.md} (88%) rename website/source/docs/builders/{amazon-ebs.html.md.erb => amazon-ebs.html.md} (98%) rename website/source/docs/builders/{amazon-instance.html.md.erb => amazon-instance.html.md} (98%) delete mode 100644 website/source/partials/builders/_ami-block-device-mappings.html.md diff --git a/website/Makefile b/website/Makefile index 8c327cad0..b703f68fb 100644 --- a/website/Makefile +++ b/website/Makefile @@ -13,5 +13,5 @@ format: bundle exec htmlbeautifier -t 2 source/*.erb bundle exec htmlbeautifier -t 2 source/layouts/*.erb @pandoc -v > /dev/null || echo "pandoc must be installed in order to format markdown content" - pandoc -v > /dev/null && find . -iname "*.html.md*" | xargs -I{} bash -c "pandoc -r markdown -w markdown --tab-stop=4 --atx-headers -s --columns=80 {} > {}.new"\; || true - pandoc -v > /dev/null && find . -iname "*.html.md*" | xargs -I{} bash -c "mv {}.new {}"\; || true + pandoc -v > /dev/null && find . -iname "*.html.md" | xargs -I{} bash -c "pandoc -r markdown -w markdown --tab-stop=4 --atx-headers -s --columns=80 {} > {}.new"\; || true + pandoc -v > /dev/null && find . -iname "*.html.md" | xargs -I{} bash -c "mv {}.new {}"\; || true diff --git a/website/source/docs/builders/amazon-chroot.html.md.erb b/website/source/docs/builders/amazon-chroot.html.md similarity index 88% rename from website/source/docs/builders/amazon-chroot.html.md.erb rename to website/source/docs/builders/amazon-chroot.html.md index 4fd3e830e..12dcc6959 100644 --- a/website/source/docs/builders/amazon-chroot.html.md.erb +++ b/website/source/docs/builders/amazon-chroot.html.md @@ -130,11 +130,42 @@ each category, the available configuration keys are alphabetized. `ami_virtualization_type`, `pre_mount_commands` and `root_volume_size`. The below options are also required in this mode only: - - `ami_block_device_mappings` (array of block device mappings) - Add the block - device mappings to the AMI. A `device_name` entry matching `root_device_name` - should be set. The block device mappings allow for keys: +- `ami_block_device_mappings` (array of block device mappings) - Add the block +device mappings to the AMI. A `device_name` entry matching `root_device_name` +should be set. The block device mappings allow for keys: - <%= partial "partials/builders/ami-block-device-mappings" %> + - `delete_on_termination` (boolean) - Indicates whether the EBS volume is + deleted on instance termination. Default `false`. **NOTE**: If this + value is not explicitly set to `true` and volumes are not cleaned up by + an alternative method, additional volumes will accumulate after + every build. + + - `device_name` (string) - The device name exposed to the instance (for + example, "/dev/sdh" or "xvdh"). Required when specifying `volume_size`. + + - `encrypted` (boolean) - Indicates whether to encrypt the volume or not + + - `iops` (integer) - The number of I/O operations per second (IOPS) that the + volume supports. See the documentation on + [IOPs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html) + for more information + + - `no_device` (boolean) - Suppresses the specified device included in the + block device mapping of the AMI + + - `snapshot_id` (string) - The ID of the snapshot + + - `virtual_name` (string) - The virtual device name. See the documentation on + [Block Device + Mapping](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html) + for more information + + - `volume_size` (integer) - The size of the volume, in GiB. Required if not + specifying a `snapshot_id` + + - `volume_type` (string) - The volume type. gp2 for General Purpose (SSD) + volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic + volumes - `root_device_name` (string) - The root device name. For example, `xvda`. diff --git a/website/source/docs/builders/amazon-ebs.html.md.erb b/website/source/docs/builders/amazon-ebs.html.md similarity index 98% rename from website/source/docs/builders/amazon-ebs.html.md.erb rename to website/source/docs/builders/amazon-ebs.html.md index f55c30a4d..2f2ccc80d 100644 --- a/website/source/docs/builders/amazon-ebs.html.md.erb +++ b/website/source/docs/builders/amazon-ebs.html.md @@ -66,27 +66,39 @@ builder. - `ami_block_device_mappings` (array of block device mappings) - Add the block device mappings to the AMI. The block device mappings allow for keys: + - `delete_on_termination` (boolean) - Indicates whether the EBS volume is + deleted on instance termination. Default `false`. **NOTE**: If this + value is not explicitly set to `true` and volumes are not cleaned up by + an alternative method, additional volumes will accumulate after + every build. + - `device_name` (string) - The device name exposed to the instance (for example, "/dev/sdh" or "xvdh"). Required when specifying `volume_size`. - - `delete_on_termination` (boolean) - Indicates whether the EBS volume is - deleted on instance termination + - `encrypted` (boolean) - Indicates whether to encrypt the volume or not + - `iops` (integer) - The number of I/O operations per second (IOPS) that the volume supports. See the documentation on [IOPs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html) for more information + - `no_device` (boolean) - Suppresses the specified device included in the block device mapping of the AMI + - `snapshot_id` (string) - The ID of the snapshot + - `virtual_name` (string) - The virtual device name. See the documentation on [Block Device Mapping](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html) for more information + - `volume_size` (integer) - The size of the volume, in GiB. Required if not specifying a `snapshot_id` + - `volume_type` (string) - The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes + - `ami_description` (string) - The description to set for the resulting AMI(s). By default this description is empty. diff --git a/website/source/docs/builders/amazon-instance.html.md.erb b/website/source/docs/builders/amazon-instance.html.md similarity index 98% rename from website/source/docs/builders/amazon-instance.html.md.erb rename to website/source/docs/builders/amazon-instance.html.md index 0fcad4e5a..241c9aeb4 100644 --- a/website/source/docs/builders/amazon-instance.html.md.erb +++ b/website/source/docs/builders/amazon-instance.html.md @@ -87,27 +87,40 @@ builder. - `ami_block_device_mappings` (array of block device mappings) - Add the block device mappings to the AMI. The block device mappings allow for keys: + - `delete_on_termination` (boolean) - Indicates whether the EBS volume is - deleted on instance termination + deleted on instance termination. Default `false`. **NOTE**: If this + value is not explicitly set to `true` and volumes are not cleaned up by + an alternative method, additional volumes will accumulate after + every build. + - `device_name` (string) - The device name exposed to the instance (for - example, "/dev/sdh" or "xvdh"). Required when specifying `volume_size`. + example, "/dev/sdh" or "xvdh"). Required when specifying `volume_size`. + - `encrypted` (boolean) - Indicates whether to encrypt the volume or not + - `iops` (integer) - The number of I/O operations per second (IOPS) that the volume supports. See the documentation on [IOPs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html) for more information + - `no_device` (boolean) - Suppresses the specified device included in the block device mapping of the AMI + - `snapshot_id` (string) - The ID of the snapshot + - `virtual_name` (string) - The virtual device name. See the documentation on [Block Device Mapping](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html) for more information + - `volume_size` (integer) - The size of the volume, in GiB. Required if not specifying a `snapshot_id` + - `volume_type` (string) - The volume type. gp2 for General Purpose (SSD) volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic volumes + - `ami_description` (string) - The description to set for the resulting AMI(s). By default this description is empty. diff --git a/website/source/partials/builders/_ami-block-device-mappings.html.md b/website/source/partials/builders/_ami-block-device-mappings.html.md deleted file mode 100644 index abd80af45..000000000 --- a/website/source/partials/builders/_ami-block-device-mappings.html.md +++ /dev/null @@ -1,33 +0,0 @@ -- `delete_on_termination` (boolean) - Indicates whether the EBS volume is - deleted on instance termination. Default `false`. **NOTE**: If this - value is not explicitly set to `true` and volumes are not cleaned up by - an alternative method, additional volumes will accumulate after - every build. - -- `device_name` (string) - The device name exposed to the instance (for - example, "/dev/sdh" or "xvdh"). Required when specifying `volume_size`. - -- `encrypted` (boolean) - Indicates whether to encrypt the volume or not - -- `iops` (integer) - The number of I/O operations per second (IOPS) that the - volume supports. See the documentation on - [IOPs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html) - for more information - -- `no_device` (boolean) - Suppresses the specified device included in the - block device mapping of the AMI - -- `snapshot_id` (string) - The ID of the snapshot - -- `virtual_name` (string) - The virtual device name. See the documentation on - [Block Device - Mapping](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html) - for more information - -- `volume_size` (integer) - The size of the volume, in GiB. Required if not - specifying a `snapshot_id` - -- `volume_type` (string) - The volume type. gp2 for General Purpose (SSD) - volumes, io1 for Provisioned IOPS (SSD) volumes, and standard for Magnetic - volumes - From cd6b70a2b395be599c56670e8f05f5fbde0109ae Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Mon, 28 Nov 2016 12:41:22 -0800 Subject: [PATCH 3/3] Update amazon-chroot.html.md --- website/source/docs/builders/amazon-chroot.html.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/source/docs/builders/amazon-chroot.html.md b/website/source/docs/builders/amazon-chroot.html.md index 12dcc6959..d90353909 100644 --- a/website/source/docs/builders/amazon-chroot.html.md +++ b/website/source/docs/builders/amazon-chroot.html.md @@ -131,8 +131,8 @@ each category, the available configuration keys are alphabetized. below options are also required in this mode only: - `ami_block_device_mappings` (array of block device mappings) - Add the block -device mappings to the AMI. A `device_name` entry matching `root_device_name` -should be set. The block device mappings allow for keys: + device mappings to the AMI. A `device_name` entry matching `root_device_name` + should be set. The block device mappings allow for keys: - `delete_on_termination` (boolean) - Indicates whether the EBS volume is deleted on instance termination. Default `false`. **NOTE**: If this