diff --git a/builder/amazon/ebs/builder.hcl2spec.go b/builder/amazon/ebs/builder.hcl2spec.go index e0556b568..231368838 100644 --- a/builder/amazon/ebs/builder.hcl2spec.go +++ b/builder/amazon/ebs/builder.hcl2spec.go @@ -120,6 +120,7 @@ type FlatConfig struct { AMIMappings []common.FlatBlockDevice `mapstructure:"ami_block_device_mappings" required:"false" cty:"ami_block_device_mappings"` LaunchMappings []common.FlatBlockDevice `mapstructure:"launch_block_device_mappings" required:"false" cty:"launch_block_device_mappings"` VolumeRunTags common.TagMap `mapstructure:"run_volume_tags" cty:"run_volume_tags"` + NoEphemeral *bool `mapstructure:"no_ephemeral" required:"false" cty:"no_ephemeral"` } // FlatMapstructure returns a new FlatConfig. @@ -241,6 +242,7 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "ami_block_device_mappings": &hcldec.BlockListSpec{TypeName: "ami_block_device_mappings", Nested: &hcldec.BlockSpec{TypeName: "ami_block_device_mappings", Nested: hcldec.ObjectSpec((*common.FlatBlockDevice)(nil).HCL2Spec())}}, "launch_block_device_mappings": &hcldec.BlockListSpec{TypeName: "launch_block_device_mappings", Nested: &hcldec.BlockSpec{TypeName: "launch_block_device_mappings", Nested: hcldec.ObjectSpec((*common.FlatBlockDevice)(nil).HCL2Spec())}}, "run_volume_tags": &hcldec.BlockAttrsSpec{TypeName: "common.TagMap", ElementType: cty.String, Required: false}, + "no_ephemeral": &hcldec.AttrSpec{Name: "no_ephemeral", Type: cty.Bool, Required: false}, } return s } diff --git a/website/source/partials/builder/amazon/ebs/_Config-not-required.html.md b/website/source/partials/builder/amazon/ebs/_Config-not-required.html.md index d49d105c5..63e1edafb 100644 --- a/website/source/partials/builder/amazon/ebs/_Config-not-required.html.md +++ b/website/source/partials/builder/amazon/ebs/_Config-not-required.html.md @@ -21,4 +21,10 @@ duplicated in `tags`. This is a [template engine](/docs/templates/engine.html), see [Build template data](#build-template-data) for more information. + +- `no_ephemeral` (bool) - If you set this flag, we'll add clauses to the + launch_block_device_mappings that make sure ephemeral drives don't show + up in the EC2 console. If you launched from the EC2 console, you'd get + this automatically, but the SDK does not provide this service. + This only applies when you are not running spot instances. \ No newline at end of file