regenerate
This commit is contained in:
parent
1cb9aea752
commit
54a75421ea
|
@ -9,7 +9,7 @@
|
|||
[GH-10377]
|
||||
* **New function** `env` allows users to set the default value of a variable to
|
||||
the value of an environment variable. Please see [env function
|
||||
docs](https://www.packer.io//docs/templates/hcl_templates/functions/contextual/env") for
|
||||
docs](https://www.packer.io/docs/templates/hcl_templates/functions/contextual/env") for
|
||||
more details. [GH-10240]
|
||||
* **Future Scaffolding** This release contains a large number of no-op
|
||||
refactoring changes. The Packer team at HashiCorp is preparing to split the
|
||||
|
|
|
@ -72,23 +72,23 @@ const (
|
|||
# All generated input variables will be of 'string' type as this is how Packer JSON
|
||||
# views them; you can change their type later on. Read the variables type
|
||||
# constraints documentation
|
||||
# https://www.packer.io//docs/templates/hcl_templates/variables#type-constraints for more info.
|
||||
# https://www.packer.io/docs/templates/hcl_templates/variables#type-constraints for more info.
|
||||
`
|
||||
|
||||
packerBlockHeader = `
|
||||
# See https://www.packer.io//docs/templates/hcl_templates/blocks/packer for more info
|
||||
# See https://www.packer.io/docs/templates/hcl_templates/blocks/packer for more info
|
||||
`
|
||||
|
||||
sourcesHeader = `
|
||||
# source blocks are generated from your builders; a source can be referenced in
|
||||
# build blocks. A build block runs provisioner and post-processors on a
|
||||
# source. Read the documentation for source blocks here:
|
||||
# https://www.packer.io//docs/templates/hcl_templates/blocks/source`
|
||||
# https://www.packer.io/docs/templates/hcl_templates/blocks/source`
|
||||
|
||||
buildHeader = `
|
||||
# a build block invokes sources and runs provisioning steps on them. The
|
||||
# documentation for build blocks can be found here:
|
||||
# https://www.packer.io//docs/templates/hcl_templates/blocks/build
|
||||
# https://www.packer.io/docs/templates/hcl_templates/blocks/build
|
||||
build {
|
||||
`
|
||||
)
|
||||
|
@ -343,44 +343,44 @@ func transposeTemplatingCalls(s []byte) []byte {
|
|||
return "", UnhandleableArgumentError{
|
||||
"lower",
|
||||
"`lower(var.example)`",
|
||||
"https://www.packer.io//docs/templates/hcl_templates/functions/string/lower",
|
||||
"https://www.packer.io/docs/templates/hcl_templates/functions/string/lower",
|
||||
}
|
||||
},
|
||||
"upper": func(_ string) (string, error) {
|
||||
return "", UnhandleableArgumentError{
|
||||
"upper",
|
||||
"`upper(var.example)`",
|
||||
"https://www.packer.io//docs/templates/hcl_templates/functions/string/upper",
|
||||
"https://www.packer.io/docs/templates/hcl_templates/functions/string/upper",
|
||||
}
|
||||
},
|
||||
"split": func(_, _ string, _ int) (string, error) {
|
||||
return "", UnhandleableArgumentError{
|
||||
"split",
|
||||
"`split(separator, string)`",
|
||||
"https://www.packer.io//docs/templates/hcl_templates/functions/string/split",
|
||||
"https://www.packer.io/docs/templates/hcl_templates/functions/string/split",
|
||||
}
|
||||
},
|
||||
"replace": func(_, _, _ string, _ int) (string, error) {
|
||||
return "", UnhandleableArgumentError{
|
||||
"replace",
|
||||
"`replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`",
|
||||
"https://www.packer.io//docs/templates/hcl_templates/functions/string/replace or https://www.packer.io//docs/templates/hcl_templates/functions/string/regex_replace",
|
||||
"https://www.packer.io/docs/templates/hcl_templates/functions/string/replace or https://www.packer.io/docs/templates/hcl_templates/functions/string/regex_replace",
|
||||
}
|
||||
},
|
||||
"replace_all": func(_, _, _ string) (string, error) {
|
||||
return "", UnhandleableArgumentError{
|
||||
"replace_all",
|
||||
"`replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`",
|
||||
"https://www.packer.io//docs/templates/hcl_templates/functions/string/replace or https://www.packer.io//docs/templates/hcl_templates/functions/string/regex_replace",
|
||||
"https://www.packer.io/docs/templates/hcl_templates/functions/string/replace or https://www.packer.io/docs/templates/hcl_templates/functions/string/regex_replace",
|
||||
}
|
||||
},
|
||||
"clean_resource_name": func(_ string) (string, error) {
|
||||
return "", UnhandleableArgumentError{
|
||||
"clean_resource_name",
|
||||
"use custom validation rules, `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`",
|
||||
"https://packer.io//docs/templates/hcl_templates/variables#custom-validation-rules" +
|
||||
" , https://www.packer.io//docs/templates/hcl_templates/functions/string/replace" +
|
||||
" or https://www.packer.io//docs/templates/hcl_templates/functions/string/regex_replace",
|
||||
"https://packer.io/docs/templates/hcl_templates/variables#custom-validation-rules" +
|
||||
" , https://www.packer.io/docs/templates/hcl_templates/functions/string/replace" +
|
||||
" or https://www.packer.io/docs/templates/hcl_templates/functions/string/regex_replace",
|
||||
}
|
||||
},
|
||||
"build_name": func() string {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# and HCL2 calls (for example '${ var.string_value_example }' ). They won't be
|
||||
# executed together and the outcome will be unknown.
|
||||
|
||||
# See https://www.packer.io//docs/templates/hcl_templates/blocks/packer for more info
|
||||
# See https://www.packer.io/docs/templates/hcl_templates/blocks/packer for more info
|
||||
packer {
|
||||
required_version = ">= 1.6.0"
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ packer {
|
|||
# All generated input variables will be of 'string' type as this is how Packer JSON
|
||||
# views them; you can change their type later on. Read the variables type
|
||||
# constraints documentation
|
||||
# https://www.packer.io//docs/templates/hcl_templates/variables#type-constraints for more info.
|
||||
# https://www.packer.io/docs/templates/hcl_templates/variables#type-constraints for more info.
|
||||
variable "aws_access_key" {
|
||||
type = string
|
||||
default = ""
|
||||
|
@ -53,7 +53,7 @@ locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }
|
|||
# source blocks are generated from your builders; a source can be referenced in
|
||||
# build blocks. A build block runs provisioner and post-processors on a
|
||||
# source. Read the documentation for source blocks here:
|
||||
# https://www.packer.io//docs/templates/hcl_templates/blocks/source
|
||||
# https://www.packer.io/docs/templates/hcl_templates/blocks/source
|
||||
source "amazon-ebs" "autogenerated_1" {
|
||||
access_key = "${var.aws_access_key}"
|
||||
ami_description = "Ubuntu 16.04 LTS - expand root partition"
|
||||
|
@ -92,7 +92,7 @@ source "amazon-ebs" "autogenerated_1" {
|
|||
|
||||
# a build block invokes sources and runs provisioning steps on them. The
|
||||
# documentation for build blocks can be found here:
|
||||
# https://www.packer.io//docs/templates/hcl_templates/blocks/build
|
||||
# https://www.packer.io/docs/templates/hcl_templates/blocks/build
|
||||
build {
|
||||
sources = ["source.amazon-ebs.autogenerated_1"]
|
||||
|
||||
|
@ -105,7 +105,7 @@ build {
|
|||
# template: hcl2_upgrade:2:38: executing "hcl2_upgrade" at <clean_resource_name>: error calling clean_resource_name: unhandled "clean_resource_name" call:
|
||||
# there is no way to automatically upgrade the "clean_resource_name" call.
|
||||
# Please manually upgrade to use custom validation rules, `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`
|
||||
# Visit https://packer.io//docs/templates/hcl_templates/variables#custom-validation-rules , https://www.packer.io//docs/templates/hcl_templates/functions/string/replace or https://www.packer.io//docs/templates/hcl_templates/functions/string/regex_replace for more infos.
|
||||
# Visit https://packer.io/docs/templates/hcl_templates/variables#custom-validation-rules , https://www.packer.io/docs/templates/hcl_templates/functions/string/replace or https://www.packer.io/docs/templates/hcl_templates/functions/string/regex_replace for more infos.
|
||||
provisioner "shell" {
|
||||
inline = ["echo mybuild-{{isotime | clean_resource_name}}"]
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ build {
|
|||
# template: hcl2_upgrade:2:35: executing "hcl2_upgrade" at <lower>: error calling lower: unhandled "lower" call:
|
||||
# there is no way to automatically upgrade the "lower" call.
|
||||
# Please manually upgrade to `lower(var.example)`
|
||||
# Visit https://www.packer.io//docs/templates/hcl_templates/functions/string/lower for more infos.
|
||||
# Visit https://www.packer.io/docs/templates/hcl_templates/functions/string/lower for more infos.
|
||||
provisioner "shell" {
|
||||
inline = ["echo {{ `SOMETHING` | lower }}"]
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ build {
|
|||
# template: hcl2_upgrade:2:35: executing "hcl2_upgrade" at <upper>: error calling upper: unhandled "upper" call:
|
||||
# there is no way to automatically upgrade the "upper" call.
|
||||
# Please manually upgrade to `upper(var.example)`
|
||||
# Visit https://www.packer.io//docs/templates/hcl_templates/functions/string/upper for more infos.
|
||||
# Visit https://www.packer.io/docs/templates/hcl_templates/functions/string/upper for more infos.
|
||||
provisioner "shell" {
|
||||
inline = ["echo {{ `something` | upper }}"]
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ build {
|
|||
# template: hcl2_upgrade:2:21: executing "hcl2_upgrade" at <split `some-string` `-` 0>: error calling split: unhandled "split" call:
|
||||
# there is no way to automatically upgrade the "split" call.
|
||||
# Please manually upgrade to `split(separator, string)`
|
||||
# Visit https://www.packer.io//docs/templates/hcl_templates/functions/string/split for more infos.
|
||||
# Visit https://www.packer.io/docs/templates/hcl_templates/functions/string/split for more infos.
|
||||
provisioner "shell" {
|
||||
inline = ["echo {{ split `some-string` `-` 0 }}"]
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ build {
|
|||
# template: hcl2_upgrade:2:21: executing "hcl2_upgrade" at <replace_all `-` `/` build_name>: error calling replace_all: unhandled "replace_all" call:
|
||||
# there is no way to automatically upgrade the "replace_all" call.
|
||||
# Please manually upgrade to `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`
|
||||
# Visit https://www.packer.io//docs/templates/hcl_templates/functions/string/replace or https://www.packer.io//docs/templates/hcl_templates/functions/string/regex_replace for more infos.
|
||||
# Visit https://www.packer.io/docs/templates/hcl_templates/functions/string/replace or https://www.packer.io/docs/templates/hcl_templates/functions/string/regex_replace for more infos.
|
||||
provisioner "shell" {
|
||||
inline = ["echo {{ replace_all `-` `/` build_name }}"]
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ build {
|
|||
# template: hcl2_upgrade:2:21: executing "hcl2_upgrade" at <replace `some-string` `-` `/` 1>: error calling replace: unhandled "replace" call:
|
||||
# there is no way to automatically upgrade the "replace" call.
|
||||
# Please manually upgrade to `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`
|
||||
# Visit https://www.packer.io//docs/templates/hcl_templates/functions/string/replace or https://www.packer.io//docs/templates/hcl_templates/functions/string/regex_replace for more infos.
|
||||
# Visit https://www.packer.io/docs/templates/hcl_templates/functions/string/replace or https://www.packer.io/docs/templates/hcl_templates/functions/string/regex_replace for more infos.
|
||||
provisioner "shell" {
|
||||
inline = ["echo {{ replace `some-string` `-` `/` 1 }}"]
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ func decodeVersionConstraint(attr *hcl.Attribute) (VersionConstraint, hcl.Diagno
|
|||
diags = append(diags, &hcl.Diagnostic{
|
||||
Severity: hcl.DiagError,
|
||||
Summary: "Invalid version constraint",
|
||||
Detail: "This string does not use correct version constraint syntax. Check out the docs: https://packer.io//docs/templates/hcl_templates/blocks/packer#version-constraints",
|
||||
Detail: "This string does not use correct version constraint syntax. Check out the docs: https://packer.io/docs/templates/hcl_templates/blocks/packer#version-constraints",
|
||||
Subject: attr.Expr.Range().Ptr(),
|
||||
})
|
||||
return ret, diags
|
||||
|
|
|
@ -59,7 +59,7 @@ here is the list of calls that should get transformed:
|
|||
- `` {{ user `my_var` }} `` becomes `${var.my_var}`.
|
||||
- `` {{ env `my_var` }} `` becomes `${var.my_var}`. Packer HCL2 supports
|
||||
environment variables through input variables. See
|
||||
[docs](http://packer.io//docs/templates/hcl_templates/variables#environment-variables)
|
||||
[docs](http://packer.io/docs/templates/hcl_templates/variables#environment-variables)
|
||||
for more info.
|
||||
- `{{ timestamp }}` becomes `${local.timestamp}`, the local variable
|
||||
will be created for all generated files.
|
||||
|
|
|
@ -205,7 +205,7 @@ provide to procisioners (see below for more details on generatedData.)
|
|||
Packer makes it possible to provide custom template engine variables to be
|
||||
shared with provisioners and post-processors using the `build` function.
|
||||
Json template `build` docs are [here](https://www.packer.io/docs/templates/engine#build)
|
||||
and HCL template build docs are [here](https://www.packer.io//docs/templates/hcl_templates/contextual-variables#build-variables).
|
||||
and HCL template build docs are [here](https://www.packer.io/docs/templates/hcl_templates/contextual-variables#build-variables).
|
||||
|
||||
As of Packer v1.5.0, builder Prepare() methods return a list of custom variables
|
||||
which we call `generated data`. We use that list of variables to generate a
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
if building based on top of a source_ami which is also io1.
|
||||
|
||||
- `source_ami_filter` (awscommon.AmiFilterOptions) - Filters used to populate the source_ami field. Example:
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"source_ami_filter": {
|
||||
|
@ -95,26 +95,26 @@
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
This selects the most recent Ubuntu 16.04 HVM EBS AMI from Canonical. NOTE:
|
||||
This will fail unless *exactly* one AMI is returned. In the above example,
|
||||
`most_recent` will cause this to succeed by selecting the newest image.
|
||||
|
||||
|
||||
- `filters` (map of strings) - filters used to select a `source_ami`.
|
||||
NOTE: This will fail unless *exactly* one AMI is returned. Any filter
|
||||
described in the docs for
|
||||
[DescribeImages](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html)
|
||||
is valid.
|
||||
|
||||
|
||||
- `owners` (array of strings) - Filters the images by their owner. You
|
||||
may specify one or more AWS account IDs, "self" (which will use the
|
||||
account whose credentials you are using to run Packer), or an AWS owner
|
||||
alias: for example, "amazon", "aws-marketplace", or "microsoft". This
|
||||
option is required for security reasons.
|
||||
|
||||
|
||||
- `most_recent` (boolean) - Selects the newest created image when true.
|
||||
This is most useful for selecting a daily distro build.
|
||||
|
||||
|
||||
You may set this in place of `source_ami` or in conjunction with it. If you
|
||||
set this in conjunction with `source_ami`, the `source_ami` will be added
|
||||
to the filter. The provided `source_ami` must meet all of the filtering
|
||||
|
@ -135,16 +135,16 @@
|
|||
always result in an encrypted one.
|
||||
|
||||
- `root_volume_kms_key_id` (string) - ID, alias or ARN of the KMS key to use for *launched* volumes encryption.
|
||||
|
||||
|
||||
Set this value if you select `root_volume_encrypt_boot`, but don't want to use the
|
||||
region's default KMS key.
|
||||
|
||||
|
||||
If you have a custom kms key you'd like to apply to the launch volume,
|
||||
and are only building in one region, it is more efficient to set this
|
||||
and `root_volume_encrypt_boot` to `true` and not use `encrypt_boot` and `kms_key_id`. This saves
|
||||
potentially many minutes at the end of the build by preventing Packer
|
||||
from having to copy and re-encrypt the image at the end of the build.
|
||||
|
||||
|
||||
For valid formats see *KmsKeyId* in the [AWS API docs -
|
||||
CopyImage](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopyImage.html).
|
||||
This field is validated by Packer, when using an alias, you will have to
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
- `ena_support` (boolean) - Enable enhanced networking (ENA but not SriovNetSupport) on
|
||||
HVM-compatible AMIs. If set, add `ec2:ModifyInstanceAttribute` to your
|
||||
AWS IAM policy.
|
||||
|
||||
|
||||
Note: you must make sure enhanced networking is enabled on your
|
||||
instance. See [Amazon's documentation on enabling enhanced
|
||||
networking](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking.html#enabling_enhanced_networking).
|
||||
|
@ -64,12 +64,12 @@
|
|||
the encryption setting to what it was in the source image. Setting false
|
||||
will result in an unencrypted image, and true will result in an encrypted
|
||||
one.
|
||||
|
||||
|
||||
If you have used the `launch_block_device_mappings` to set an encryption
|
||||
key and that key is the same as the one you want the image encrypted with
|
||||
at the end, then you don't need to set this field; leaving it empty will
|
||||
prevent an unnecessary extra copy step and save you some time.
|
||||
|
||||
|
||||
Please note that if you are using an account with the global "Always
|
||||
encrypt new EBS volumes" option set to `true`, Packer will be unable to
|
||||
override this setting, and the final image will be encryoted whether
|
||||
|
@ -79,17 +79,17 @@
|
|||
only applies to the main `region` -- any regions the AMI gets copied to
|
||||
copied will be encrypted by the default EBS KMS key for that region,
|
||||
unless you set region-specific keys in AMIRegionKMSKeyIDs.
|
||||
|
||||
|
||||
Set this value if you select `encrypt_boot`, but don't want to use the
|
||||
region's default KMS key.
|
||||
|
||||
|
||||
If you have a custom kms key you'd like to apply to the launch volume,
|
||||
and are only building in one region, it is more efficient to leave this
|
||||
and `encrypt_boot` empty and to instead set the key id in the
|
||||
launch_block_device_mappings (you can find an example below). This saves
|
||||
potentially many minutes at the end of the build by preventing Packer
|
||||
from having to copy and re-encrypt the image at the end of the build.
|
||||
|
||||
|
||||
For valid formats see *KmsKeyId* in the [AWS API docs -
|
||||
CopyImage](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopyImage.html).
|
||||
This field is validated by Packer, when using an alias, you will have to
|
||||
|
@ -105,7 +105,7 @@
|
|||
conjunction with `snapshot_users` -- in that situation you must use
|
||||
custom keys. For valid formats see *KmsKeyId* in the [AWS API docs -
|
||||
CopyImage](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopyImage.html).
|
||||
|
||||
|
||||
This option supercedes the `kms_key_id` option -- if you set both, and
|
||||
they are different, Packer will respect the value in
|
||||
`region_kms_key_ids` for your build region and silently disregard the
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
Packer will still wait for the instance to be stopped, and failing to
|
||||
send the stop signal yourself, when you have set this flag to `true`,
|
||||
will cause a timeout.
|
||||
|
||||
|
||||
An example of a valid windows shutdown command in a `windows-shell`
|
||||
provisioner is :
|
||||
```shell-session
|
||||
|
@ -54,12 +54,12 @@
|
|||
up a [T2
|
||||
Standard](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-std.html)
|
||||
instance instead.
|
||||
|
||||
|
||||
To use T2 Unlimited you must use a T2 instance type, e.g. `t2.micro`.
|
||||
Additionally, T2 Unlimited cannot be used in conjunction with Spot
|
||||
Instances, e.g. when the `spot_price` option has been configured.
|
||||
Attempting to do so will cause an error.
|
||||
|
||||
|
||||
!> **Warning!** Additional costs may be incurred by enabling T2
|
||||
Unlimited - even for instances that would usually qualify for the
|
||||
[AWS Free Tier](https://aws.amazon.com/free/).
|
||||
|
@ -72,7 +72,7 @@
|
|||
|
||||
- `temporary_iam_instance_profile_policy_document` (\*PolicyDocument) - Temporary IAM instance profile policy document
|
||||
If IamInstanceProfile is specified it will be used instead. Example:
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
|
@ -93,7 +93,7 @@
|
|||
terminate. Defaults to stop.
|
||||
|
||||
- `security_group_filter` (SecurityGroupFilterOptions) - Filters used to populate the `security_group_ids` field. JSON Example:
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"security_group_filter": {
|
||||
|
@ -103,9 +103,9 @@
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
HCL2 Example:
|
||||
|
||||
|
||||
```hcl
|
||||
security_group_filter {
|
||||
filters = {
|
||||
|
@ -113,14 +113,14 @@
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
This selects the SG's with tag `Class` with the value `packer`.
|
||||
|
||||
|
||||
- `filters` (map of strings) - filters used to select a
|
||||
`security_group_ids`. Any filter described in the docs for
|
||||
[DescribeSecurityGroups](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html)
|
||||
is valid.
|
||||
|
||||
|
||||
`security_group_ids` take precedence over this.
|
||||
|
||||
- `run_tags` (map[string]string) - Key/value pair tags to apply to the instance that is that is *launched*
|
||||
|
@ -145,7 +145,7 @@
|
|||
|
||||
- `source_ami_filter` (AmiFilterOptions) - Filters used to populate the `source_ami`
|
||||
field. JSON Example:
|
||||
|
||||
|
||||
```json
|
||||
"builders" [
|
||||
{
|
||||
|
@ -163,7 +163,7 @@
|
|||
]
|
||||
```
|
||||
HCL2 example:
|
||||
|
||||
|
||||
```hcl
|
||||
source "amazon-ebs" "basic-example" {
|
||||
source_ami_filter {
|
||||
|
@ -177,26 +177,26 @@
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
This selects the most recent Ubuntu 16.04 HVM EBS AMI from Canonical. NOTE:
|
||||
This will fail unless *exactly* one AMI is returned. In the above example,
|
||||
`most_recent` will cause this to succeed by selecting the newest image.
|
||||
|
||||
|
||||
- `filters` (map of strings) - filters used to select a `source_ami`.
|
||||
NOTE: This will fail unless *exactly* one AMI is returned. Any filter
|
||||
described in the docs for
|
||||
[DescribeImages](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeImages.html)
|
||||
is valid.
|
||||
|
||||
|
||||
- `owners` (array of strings) - Filters the images by their owner. You
|
||||
may specify one or more AWS account IDs, "self" (which will use the
|
||||
account whose credentials you are using to run Packer), or an AWS owner
|
||||
alias: for example, `amazon`, `aws-marketplace`, or `microsoft`. This
|
||||
option is required for security reasons.
|
||||
|
||||
|
||||
- `most_recent` (boolean) - Selects the newest created image when true.
|
||||
This is most useful for selecting a daily distro build.
|
||||
|
||||
|
||||
You may set this in place of `source_ami` or in conjunction with it. If you
|
||||
set this in conjunction with `source_ami`, the `source_ami` will be added
|
||||
to the filter. The provided `source_ami` must meet all of the filtering
|
||||
|
@ -217,7 +217,7 @@
|
|||
time period your instances are running. Spot Instance prices are set by
|
||||
Amazon EC2 and adjust gradually based on long-term trends in supply and
|
||||
demand for Spot Instance capacity.
|
||||
|
||||
|
||||
When this field is set, it represents the maximum hourly price you are
|
||||
willing to pay for a spot instance. If you do not set this value, it
|
||||
defaults to a maximum price equal to the on demand price of the
|
||||
|
@ -239,7 +239,7 @@
|
|||
|
||||
- `subnet_filter` (SubnetFilterOptions) - Filters used to populate the `subnet_id` field.
|
||||
JSON Example:
|
||||
|
||||
|
||||
```json
|
||||
"builders" [
|
||||
{
|
||||
|
@ -255,7 +255,7 @@
|
|||
]
|
||||
```
|
||||
HCL2 example:
|
||||
|
||||
|
||||
```hcl
|
||||
source "amazon-ebs" "basic-example" {
|
||||
subnet_filter {
|
||||
|
@ -267,24 +267,24 @@
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
This selects the Subnet with tag `Class` with the value `build`, which has
|
||||
the most free IP addresses. NOTE: This will fail unless *exactly* one
|
||||
Subnet is returned. By using `most_free` or `random` one will be selected
|
||||
from those matching the filter.
|
||||
|
||||
|
||||
- `filters` (map of strings) - filters used to select a `subnet_id`.
|
||||
NOTE: This will fail unless *exactly* one Subnet is returned. Any
|
||||
filter described in the docs for
|
||||
[DescribeSubnets](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html)
|
||||
is valid.
|
||||
|
||||
|
||||
- `most_free` (boolean) - The Subnet with the most free IPv4 addresses
|
||||
will be used if multiple Subnets matches the filter.
|
||||
|
||||
|
||||
- `random` (boolean) - A random Subnet will be used if multiple Subnets
|
||||
matches the filter. `most_free` have precendence over this.
|
||||
|
||||
|
||||
`subnet_id` take precedence over this.
|
||||
|
||||
- `subnet_id` (string) - If using VPC, the ID of the subnet, such as
|
||||
|
@ -293,13 +293,13 @@
|
|||
|
||||
- `tenancy` (string) - [Tenancy](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html) used
|
||||
when Packer launches the EC2 instance, allowing it to be launched on dedicated hardware.
|
||||
|
||||
|
||||
The default is "default", meaning shared tenancy. Allowed values are "default",
|
||||
"dedicated" and "host".
|
||||
|
||||
- `temporary_security_group_source_cidrs` ([]string) - A list of IPv4 CIDR blocks to be authorized access to the instance, when
|
||||
packer is creating a temporary security group.
|
||||
|
||||
|
||||
The default is [`0.0.0.0/0`] (i.e., allow any IPv4 source). This is only
|
||||
used when `security_group_id` or `security_group_ids` is not specified.
|
||||
|
||||
|
@ -314,7 +314,7 @@
|
|||
|
||||
- `vpc_filter` (VpcFilterOptions) - Filters used to populate the `vpc_id` field.
|
||||
JSON Example:
|
||||
|
||||
|
||||
```json
|
||||
"builders" [
|
||||
{
|
||||
|
@ -330,7 +330,7 @@
|
|||
]
|
||||
```
|
||||
HCL2 example:
|
||||
|
||||
|
||||
```hcl
|
||||
source "amazon-ebs" "basic-example" {
|
||||
vpc_filter {
|
||||
|
@ -342,17 +342,17 @@
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
This selects the VPC with tag `Class` with the value `build`, which is not
|
||||
the default VPC, and have a IPv4 CIDR block of `/24`. NOTE: This will fail
|
||||
unless *exactly* one VPC is returned.
|
||||
|
||||
|
||||
- `filters` (map of strings) - filters used to select a `vpc_id`. NOTE:
|
||||
This will fail unless *exactly* one VPC is returned. Any filter
|
||||
described in the docs for
|
||||
[DescribeVpcs](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html)
|
||||
is valid.
|
||||
|
||||
|
||||
`vpc_id` take precedence over this.
|
||||
|
||||
- `vpc_id` (string) - If launching into a VPC subnet, Packer needs the VPC ID
|
||||
|
@ -370,12 +370,12 @@
|
|||
if inside a VPC is to use the public IP address if available, otherwise
|
||||
the private IP address will be used. If not in a VPC the public DNS name
|
||||
will be used. Also works for WinRM.
|
||||
|
||||
|
||||
Where Packer is configured for an outbound proxy but WinRM traffic
|
||||
should be direct, `ssh_interface` must be set to `private_dns` and
|
||||
`<region>.compute.internal` included in the `NO_PROXY` environment
|
||||
variable.
|
||||
|
||||
|
||||
When using `session_manager` the machine running Packer must have
|
||||
the AWS Session Manager Plugin installed and within the users' system path.
|
||||
Connectivity via the `session_manager` interface establishes a secure tunnel
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
in the `ebs_volumes` setting. This is a [template
|
||||
engine](/docs/templates/engine), see [Build template
|
||||
data](#build-template-data) for more information.
|
||||
|
||||
|
||||
Note: The tags specified here will be *temporarily* applied to volumes
|
||||
specified in `ebs_volumes` - but only while the instance is being
|
||||
created. Packer will replace all tags on the volume with the tags
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
as the source for this build. *VHD targets are incompatible with this
|
||||
build type* - the target must be a *Managed Image*. When using shared_image_gallery as a source, image_publisher,
|
||||
image_offer, image_sku, image_version, and custom_managed_image_name should not be set.
|
||||
|
||||
|
||||
In JSON
|
||||
```json
|
||||
"shared_image_gallery": {
|
||||
|
@ -43,9 +43,9 @@
|
|||
```
|
||||
|
||||
- `shared_image_gallery_destination` (SharedImageGalleryDestination) - The name of the Shared Image Gallery under which the managed image will be published as Shared Gallery Image version.
|
||||
|
||||
|
||||
Following is an example.
|
||||
|
||||
|
||||
In JSON
|
||||
```json
|
||||
"shared_image_gallery_destination": {
|
||||
|
@ -96,7 +96,7 @@
|
|||
across regions due to image synchronization latency. To ensure a consistent
|
||||
version across regions set this value to one that is available in all
|
||||
regions where you are deploying.
|
||||
|
||||
|
||||
CLI example
|
||||
`az vm image list --location westus --publisher Canonical --offer UbuntuServer --sku 16.04.0-LTS --all`
|
||||
|
||||
|
@ -106,7 +106,7 @@
|
|||
VM from your VHD. See
|
||||
[pricing](https://azure.microsoft.com/en-us/pricing/details/virtual-machines/)
|
||||
information. Defaults to `Standard_A1`.
|
||||
|
||||
|
||||
CLI example `az vm list-sizes --location westus`
|
||||
|
||||
- `managed_image_resource_group_name` (string) - Specify the managed image resource group name where the result of the
|
||||
|
@ -203,9 +203,9 @@
|
|||
terms](https://aka.ms/azuremarketplaceapideployment) for more details.
|
||||
Not all Marketplace images support programmatic deployment, and support
|
||||
is controlled by the image publisher.
|
||||
|
||||
|
||||
An example plan\_info object is defined below.
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"plan_info": {
|
||||
|
@ -215,17 +215,17 @@
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
`plan_name` (string) - The plan name, required. `plan_product` (string) -
|
||||
The plan product, required. `plan_publisher` (string) - The plan publisher,
|
||||
required. `plan_promotion_code` (string) - Some images accept a promotion
|
||||
code, optional.
|
||||
|
||||
|
||||
Images created from the Marketplace with `plan_info` **must** specify
|
||||
`plan_info` whenever the image is deployed. The builder automatically adds
|
||||
tags to the image to ensure this information is not lost. The following
|
||||
tags are added.
|
||||
|
||||
|
||||
```text
|
||||
1. PlanName
|
||||
2. PlanProduct
|
||||
|
@ -257,12 +257,12 @@
|
|||
or
|
||||
[Linux](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/about-disks-and-vhds)
|
||||
for more information.
|
||||
|
||||
|
||||
For VHD builds the final artifacts will be named
|
||||
`PREFIX-dataDisk-<n>.UUID.vhd` and stored in the specified capture
|
||||
container along side the OS disk. The additional disks are included in
|
||||
the deployment template `PREFIX-vmTemplate.UUID`.
|
||||
|
||||
|
||||
For Managed build the final artifacts are included in the managed image.
|
||||
The additional disk will have the same storage account type as the OS
|
||||
disk, as specified with the `managed_image_storage_account_type`
|
||||
|
|
Loading…
Reference in New Issue