2019-10-14 10:43:59 -04:00
|
|
|
// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT.
|
2020-12-11 19:04:43 -05:00
|
|
|
|
2019-10-14 10:43:59 -04:00
|
|
|
package amazonimport
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/hcl/v2/hcldec"
|
|
|
|
"github.com/hashicorp/packer/builder/amazon/common"
|
|
|
|
"github.com/zclconf/go-cty/cty"
|
|
|
|
)
|
|
|
|
|
|
|
|
// FlatConfig is an auto-generated flat version of Config.
|
|
|
|
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
|
|
|
|
type FlatConfig struct {
|
HCL2: generate hcl tags with go-cty tags too (#9306)
This will allow to generate the config files:
```go
package main
import (
"fmt"
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/hashicorp/hcl/v2/hclwrite"
"github.com/hashicorp/packer/builder/alicloud/ecs"
)
func main() {
name := "name"
app := ecs.FlatConfig{
AlicloudImageName: &name,
ECSSystemDiskMapping: &ecs.FlatAlicloudDiskDevice{
DiskName: &name,
},
}
f := hclwrite.NewEmptyFile()
block := gohcl.EncodeAsBlock(&app, `source "something" "something"`)
f.Body().AppendBlock(block)
fmt.Printf("%s", f.Bytes())
}
```
Will output:
```
source "something" "something" {
packer_user_variables = null
packer_sensitive_variables = null
image_name = "name"
image_share_account = null
image_unshare_account = null
image_copy_regions = null
image_copy_names = null
tags = null
tag = null
system_disk_mapping = { disk_category = null, disk_delete_with_instance = null, disk_descri
ption = null, disk_device = null, disk_encrypted = null, disk_name = "name", disk_size = null, disk_
snapshot_id = null }
image_disk_mappings = null
ssh_remote_tunnels = null
ssh_local_tunnels = null
ssh_public_key = null
ssh_private_key = null
}
```
This is a good first step for #9015 and #9282
fix #9304
2020-05-28 05:19:00 -04:00
|
|
|
PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"`
|
|
|
|
PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"`
|
2020-11-10 11:16:59 -05:00
|
|
|
PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"`
|
HCL2: generate hcl tags with go-cty tags too (#9306)
This will allow to generate the config files:
```go
package main
import (
"fmt"
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/hashicorp/hcl/v2/hclwrite"
"github.com/hashicorp/packer/builder/alicloud/ecs"
)
func main() {
name := "name"
app := ecs.FlatConfig{
AlicloudImageName: &name,
ECSSystemDiskMapping: &ecs.FlatAlicloudDiskDevice{
DiskName: &name,
},
}
f := hclwrite.NewEmptyFile()
block := gohcl.EncodeAsBlock(&app, `source "something" "something"`)
f.Body().AppendBlock(block)
fmt.Printf("%s", f.Bytes())
}
```
Will output:
```
source "something" "something" {
packer_user_variables = null
packer_sensitive_variables = null
image_name = "name"
image_share_account = null
image_unshare_account = null
image_copy_regions = null
image_copy_names = null
tags = null
tag = null
system_disk_mapping = { disk_category = null, disk_delete_with_instance = null, disk_descri
ption = null, disk_device = null, disk_encrypted = null, disk_name = "name", disk_size = null, disk_
snapshot_id = null }
image_disk_mappings = null
ssh_remote_tunnels = null
ssh_local_tunnels = null
ssh_public_key = null
ssh_private_key = null
}
```
This is a good first step for #9015 and #9282
fix #9304
2020-05-28 05:19:00 -04:00
|
|
|
PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"`
|
|
|
|
PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"`
|
|
|
|
PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"`
|
|
|
|
PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"`
|
|
|
|
PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"`
|
|
|
|
AccessKey *string `mapstructure:"access_key" required:"true" cty:"access_key" hcl:"access_key"`
|
2020-09-22 19:58:56 -04:00
|
|
|
AssumeRole *common.FlatAssumeRoleConfig `mapstructure:"assume_role" required:"false" cty:"assume_role" hcl:"assume_role"`
|
HCL2: generate hcl tags with go-cty tags too (#9306)
This will allow to generate the config files:
```go
package main
import (
"fmt"
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/hashicorp/hcl/v2/hclwrite"
"github.com/hashicorp/packer/builder/alicloud/ecs"
)
func main() {
name := "name"
app := ecs.FlatConfig{
AlicloudImageName: &name,
ECSSystemDiskMapping: &ecs.FlatAlicloudDiskDevice{
DiskName: &name,
},
}
f := hclwrite.NewEmptyFile()
block := gohcl.EncodeAsBlock(&app, `source "something" "something"`)
f.Body().AppendBlock(block)
fmt.Printf("%s", f.Bytes())
}
```
Will output:
```
source "something" "something" {
packer_user_variables = null
packer_sensitive_variables = null
image_name = "name"
image_share_account = null
image_unshare_account = null
image_copy_regions = null
image_copy_names = null
tags = null
tag = null
system_disk_mapping = { disk_category = null, disk_delete_with_instance = null, disk_descri
ption = null, disk_device = null, disk_encrypted = null, disk_name = "name", disk_size = null, disk_
snapshot_id = null }
image_disk_mappings = null
ssh_remote_tunnels = null
ssh_local_tunnels = null
ssh_public_key = null
ssh_private_key = null
}
```
This is a good first step for #9015 and #9282
fix #9304
2020-05-28 05:19:00 -04:00
|
|
|
CustomEndpointEc2 *string `mapstructure:"custom_endpoint_ec2" required:"false" cty:"custom_endpoint_ec2" hcl:"custom_endpoint_ec2"`
|
2020-09-22 19:58:56 -04:00
|
|
|
CredsFilename *string `mapstructure:"shared_credentials_file" required:"false" cty:"shared_credentials_file" hcl:"shared_credentials_file"`
|
HCL2: generate hcl tags with go-cty tags too (#9306)
This will allow to generate the config files:
```go
package main
import (
"fmt"
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/hashicorp/hcl/v2/hclwrite"
"github.com/hashicorp/packer/builder/alicloud/ecs"
)
func main() {
name := "name"
app := ecs.FlatConfig{
AlicloudImageName: &name,
ECSSystemDiskMapping: &ecs.FlatAlicloudDiskDevice{
DiskName: &name,
},
}
f := hclwrite.NewEmptyFile()
block := gohcl.EncodeAsBlock(&app, `source "something" "something"`)
f.Body().AppendBlock(block)
fmt.Printf("%s", f.Bytes())
}
```
Will output:
```
source "something" "something" {
packer_user_variables = null
packer_sensitive_variables = null
image_name = "name"
image_share_account = null
image_unshare_account = null
image_copy_regions = null
image_copy_names = null
tags = null
tag = null
system_disk_mapping = { disk_category = null, disk_delete_with_instance = null, disk_descri
ption = null, disk_device = null, disk_encrypted = null, disk_name = "name", disk_size = null, disk_
snapshot_id = null }
image_disk_mappings = null
ssh_remote_tunnels = null
ssh_local_tunnels = null
ssh_public_key = null
ssh_private_key = null
}
```
This is a good first step for #9015 and #9282
fix #9304
2020-05-28 05:19:00 -04:00
|
|
|
DecodeAuthZMessages *bool `mapstructure:"decode_authorization_messages" required:"false" cty:"decode_authorization_messages" hcl:"decode_authorization_messages"`
|
|
|
|
InsecureSkipTLSVerify *bool `mapstructure:"insecure_skip_tls_verify" required:"false" cty:"insecure_skip_tls_verify" hcl:"insecure_skip_tls_verify"`
|
|
|
|
MaxRetries *int `mapstructure:"max_retries" required:"false" cty:"max_retries" hcl:"max_retries"`
|
|
|
|
MFACode *string `mapstructure:"mfa_code" required:"false" cty:"mfa_code" hcl:"mfa_code"`
|
|
|
|
ProfileName *string `mapstructure:"profile" required:"false" cty:"profile" hcl:"profile"`
|
|
|
|
RawRegion *string `mapstructure:"region" required:"true" cty:"region" hcl:"region"`
|
|
|
|
SecretKey *string `mapstructure:"secret_key" required:"true" cty:"secret_key" hcl:"secret_key"`
|
|
|
|
SkipMetadataApiCheck *bool `mapstructure:"skip_metadata_api_check" cty:"skip_metadata_api_check" hcl:"skip_metadata_api_check"`
|
2020-09-29 17:03:44 -04:00
|
|
|
SkipCredsValidation *bool `mapstructure:"skip_credential_validation" cty:"skip_credential_validation" hcl:"skip_credential_validation"`
|
HCL2: generate hcl tags with go-cty tags too (#9306)
This will allow to generate the config files:
```go
package main
import (
"fmt"
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/hashicorp/hcl/v2/hclwrite"
"github.com/hashicorp/packer/builder/alicloud/ecs"
)
func main() {
name := "name"
app := ecs.FlatConfig{
AlicloudImageName: &name,
ECSSystemDiskMapping: &ecs.FlatAlicloudDiskDevice{
DiskName: &name,
},
}
f := hclwrite.NewEmptyFile()
block := gohcl.EncodeAsBlock(&app, `source "something" "something"`)
f.Body().AppendBlock(block)
fmt.Printf("%s", f.Bytes())
}
```
Will output:
```
source "something" "something" {
packer_user_variables = null
packer_sensitive_variables = null
image_name = "name"
image_share_account = null
image_unshare_account = null
image_copy_regions = null
image_copy_names = null
tags = null
tag = null
system_disk_mapping = { disk_category = null, disk_delete_with_instance = null, disk_descri
ption = null, disk_device = null, disk_encrypted = null, disk_name = "name", disk_size = null, disk_
snapshot_id = null }
image_disk_mappings = null
ssh_remote_tunnels = null
ssh_local_tunnels = null
ssh_public_key = null
ssh_private_key = null
}
```
This is a good first step for #9015 and #9282
fix #9304
2020-05-28 05:19:00 -04:00
|
|
|
Token *string `mapstructure:"token" required:"false" cty:"token" hcl:"token"`
|
|
|
|
VaultAWSEngine *common.FlatVaultAWSEngineOptions `mapstructure:"vault_aws_engine" required:"false" cty:"vault_aws_engine" hcl:"vault_aws_engine"`
|
2020-08-17 11:09:19 -04:00
|
|
|
PollingConfig *common.FlatAWSPollingConfig `mapstructure:"aws_polling" required:"false" cty:"aws_polling" hcl:"aws_polling"`
|
HCL2: generate hcl tags with go-cty tags too (#9306)
This will allow to generate the config files:
```go
package main
import (
"fmt"
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/hashicorp/hcl/v2/hclwrite"
"github.com/hashicorp/packer/builder/alicloud/ecs"
)
func main() {
name := "name"
app := ecs.FlatConfig{
AlicloudImageName: &name,
ECSSystemDiskMapping: &ecs.FlatAlicloudDiskDevice{
DiskName: &name,
},
}
f := hclwrite.NewEmptyFile()
block := gohcl.EncodeAsBlock(&app, `source "something" "something"`)
f.Body().AppendBlock(block)
fmt.Printf("%s", f.Bytes())
}
```
Will output:
```
source "something" "something" {
packer_user_variables = null
packer_sensitive_variables = null
image_name = "name"
image_share_account = null
image_unshare_account = null
image_copy_regions = null
image_copy_names = null
tags = null
tag = null
system_disk_mapping = { disk_category = null, disk_delete_with_instance = null, disk_descri
ption = null, disk_device = null, disk_encrypted = null, disk_name = "name", disk_size = null, disk_
snapshot_id = null }
image_disk_mappings = null
ssh_remote_tunnels = null
ssh_local_tunnels = null
ssh_public_key = null
ssh_private_key = null
}
```
This is a good first step for #9015 and #9282
fix #9304
2020-05-28 05:19:00 -04:00
|
|
|
S3Bucket *string `mapstructure:"s3_bucket_name" cty:"s3_bucket_name" hcl:"s3_bucket_name"`
|
|
|
|
S3Key *string `mapstructure:"s3_key_name" cty:"s3_key_name" hcl:"s3_key_name"`
|
|
|
|
S3Encryption *string `mapstructure:"s3_encryption" cty:"s3_encryption" hcl:"s3_encryption"`
|
|
|
|
S3EncryptionKey *string `mapstructure:"s3_encryption_key" cty:"s3_encryption_key" hcl:"s3_encryption_key"`
|
|
|
|
SkipClean *bool `mapstructure:"skip_clean" cty:"skip_clean" hcl:"skip_clean"`
|
|
|
|
Tags map[string]string `mapstructure:"tags" cty:"tags" hcl:"tags"`
|
|
|
|
Name *string `mapstructure:"ami_name" cty:"ami_name" hcl:"ami_name"`
|
|
|
|
Description *string `mapstructure:"ami_description" cty:"ami_description" hcl:"ami_description"`
|
|
|
|
Users []string `mapstructure:"ami_users" cty:"ami_users" hcl:"ami_users"`
|
|
|
|
Groups []string `mapstructure:"ami_groups" cty:"ami_groups" hcl:"ami_groups"`
|
|
|
|
Encrypt *bool `mapstructure:"ami_encrypt" cty:"ami_encrypt" hcl:"ami_encrypt"`
|
|
|
|
KMSKey *string `mapstructure:"ami_kms_key" cty:"ami_kms_key" hcl:"ami_kms_key"`
|
|
|
|
LicenseType *string `mapstructure:"license_type" cty:"license_type" hcl:"license_type"`
|
|
|
|
RoleName *string `mapstructure:"role_name" cty:"role_name" hcl:"role_name"`
|
|
|
|
Format *string `mapstructure:"format" cty:"format" hcl:"format"`
|
2019-10-14 10:43:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// FlatMapstructure returns a new FlatConfig.
|
|
|
|
// FlatConfig is an auto-generated flat version of Config.
|
|
|
|
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
|
2019-12-17 05:25:56 -05:00
|
|
|
func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
|
|
|
|
return new(FlatConfig)
|
|
|
|
}
|
2019-10-14 10:43:59 -04:00
|
|
|
|
2019-12-17 05:25:56 -05:00
|
|
|
// HCL2Spec returns the hcl spec of a Config.
|
|
|
|
// This spec is used by HCL to read the fields of Config.
|
|
|
|
// The decoded values from this spec will then be applied to a FlatConfig.
|
2019-10-14 10:43:59 -04:00
|
|
|
func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec {
|
|
|
|
s := map[string]hcldec.Spec{
|
|
|
|
"packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false},
|
|
|
|
"packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false},
|
2020-11-10 11:16:59 -05:00
|
|
|
"packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false},
|
2019-10-14 10:43:59 -04:00
|
|
|
"packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false},
|
|
|
|
"packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false},
|
|
|
|
"packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false},
|
2020-04-14 10:05:13 -04:00
|
|
|
"packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false},
|
2019-10-14 10:43:59 -04:00
|
|
|
"packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false},
|
|
|
|
"access_key": &hcldec.AttrSpec{Name: "access_key", Type: cty.String, Required: false},
|
2020-09-22 19:58:56 -04:00
|
|
|
"assume_role": &hcldec.BlockSpec{TypeName: "assume_role", Nested: hcldec.ObjectSpec((*common.FlatAssumeRoleConfig)(nil).HCL2Spec())},
|
2019-10-14 10:43:59 -04:00
|
|
|
"custom_endpoint_ec2": &hcldec.AttrSpec{Name: "custom_endpoint_ec2", Type: cty.String, Required: false},
|
2020-09-22 19:58:56 -04:00
|
|
|
"shared_credentials_file": &hcldec.AttrSpec{Name: "shared_credentials_file", Type: cty.String, Required: false},
|
2019-10-14 10:43:59 -04:00
|
|
|
"decode_authorization_messages": &hcldec.AttrSpec{Name: "decode_authorization_messages", Type: cty.Bool, Required: false},
|
|
|
|
"insecure_skip_tls_verify": &hcldec.AttrSpec{Name: "insecure_skip_tls_verify", Type: cty.Bool, Required: false},
|
2020-02-07 10:36:14 -05:00
|
|
|
"max_retries": &hcldec.AttrSpec{Name: "max_retries", Type: cty.Number, Required: false},
|
2019-10-14 10:43:59 -04:00
|
|
|
"mfa_code": &hcldec.AttrSpec{Name: "mfa_code", Type: cty.String, Required: false},
|
|
|
|
"profile": &hcldec.AttrSpec{Name: "profile", Type: cty.String, Required: false},
|
|
|
|
"region": &hcldec.AttrSpec{Name: "region", Type: cty.String, Required: false},
|
|
|
|
"secret_key": &hcldec.AttrSpec{Name: "secret_key", Type: cty.String, Required: false},
|
|
|
|
"skip_metadata_api_check": &hcldec.AttrSpec{Name: "skip_metadata_api_check", Type: cty.Bool, Required: false},
|
2020-09-29 17:03:44 -04:00
|
|
|
"skip_credential_validation": &hcldec.AttrSpec{Name: "skip_credential_validation", Type: cty.Bool, Required: false},
|
2019-10-14 10:43:59 -04:00
|
|
|
"token": &hcldec.AttrSpec{Name: "token", Type: cty.String, Required: false},
|
|
|
|
"vault_aws_engine": &hcldec.BlockSpec{TypeName: "vault_aws_engine", Nested: hcldec.ObjectSpec((*common.FlatVaultAWSEngineOptions)(nil).HCL2Spec())},
|
2020-08-17 11:09:19 -04:00
|
|
|
"aws_polling": &hcldec.BlockSpec{TypeName: "aws_polling", Nested: hcldec.ObjectSpec((*common.FlatAWSPollingConfig)(nil).HCL2Spec())},
|
2019-10-14 10:43:59 -04:00
|
|
|
"s3_bucket_name": &hcldec.AttrSpec{Name: "s3_bucket_name", Type: cty.String, Required: false},
|
|
|
|
"s3_key_name": &hcldec.AttrSpec{Name: "s3_key_name", Type: cty.String, Required: false},
|
|
|
|
"s3_encryption": &hcldec.AttrSpec{Name: "s3_encryption", Type: cty.String, Required: false},
|
|
|
|
"s3_encryption_key": &hcldec.AttrSpec{Name: "s3_encryption_key", Type: cty.String, Required: false},
|
|
|
|
"skip_clean": &hcldec.AttrSpec{Name: "skip_clean", Type: cty.Bool, Required: false},
|
2020-04-14 10:05:13 -04:00
|
|
|
"tags": &hcldec.AttrSpec{Name: "tags", Type: cty.Map(cty.String), Required: false},
|
2019-10-14 10:43:59 -04:00
|
|
|
"ami_name": &hcldec.AttrSpec{Name: "ami_name", Type: cty.String, Required: false},
|
|
|
|
"ami_description": &hcldec.AttrSpec{Name: "ami_description", Type: cty.String, Required: false},
|
|
|
|
"ami_users": &hcldec.AttrSpec{Name: "ami_users", Type: cty.List(cty.String), Required: false},
|
|
|
|
"ami_groups": &hcldec.AttrSpec{Name: "ami_groups", Type: cty.List(cty.String), Required: false},
|
|
|
|
"ami_encrypt": &hcldec.AttrSpec{Name: "ami_encrypt", Type: cty.Bool, Required: false},
|
|
|
|
"ami_kms_key": &hcldec.AttrSpec{Name: "ami_kms_key", Type: cty.String, Required: false},
|
|
|
|
"license_type": &hcldec.AttrSpec{Name: "license_type", Type: cty.String, Required: false},
|
|
|
|
"role_name": &hcldec.AttrSpec{Name: "role_name", Type: cty.String, Required: false},
|
|
|
|
"format": &hcldec.AttrSpec{Name: "format", Type: cty.String, Required: false},
|
|
|
|
}
|
|
|
|
return s
|
|
|
|
}
|