Adrien Delorme
40947c2bf6
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 11:19:00 +02:00
..
2018-10-24 11:26:53 +02:00
2020-04-07 17:53:22 -04:00
2020-05-28 11:19:00 +02:00
2019-10-31 12:09:32 -07:00
2020-04-16 17:22:13 +02:00
2020-01-30 11:27:58 +01:00
2020-01-30 11:27:58 +01:00
2019-09-20 15:28:43 +02:00
2020-03-12 15:05:08 +01:00
2020-05-28 11:19:00 +02:00
2019-10-29 11:28:56 -07:00
2019-10-28 14:31:13 -07:00
2018-09-11 16:05:43 -07:00
2019-10-31 12:09:32 -07:00
2020-01-16 14:38:46 +01:00
2020-05-26 15:04:03 -04:00
2020-05-26 15:04:03 -04:00
2019-02-27 11:17:08 +01:00
2020-04-16 17:22:13 +02:00
2020-05-08 09:36:43 -04:00
2020-05-28 11:19:00 +02:00
2020-05-08 09:32:54 -04:00
2020-05-08 09:32:54 -04:00
2020-05-13 10:10:55 -04:00
2020-05-13 10:10:55 -04:00
2020-05-13 10:10:55 -04:00
2018-07-11 10:36:21 -07:00
2020-02-05 15:09:09 -08:00
2019-08-23 11:17:45 +02:00
2020-01-28 16:52:50 -05:00
2019-11-08 11:15:24 +01:00
2020-05-13 10:10:55 -04:00
2020-05-13 10:10:55 -04:00
2020-03-16 17:47:44 +01:00
2019-04-03 15:56:15 +02:00
2019-12-11 15:43:38 -08:00
2019-12-17 11:25:56 +01:00
2019-06-11 16:01:03 +05:30
2020-02-14 11:42:29 -05:00
2019-11-21 11:13:32 +01:00
2019-10-15 12:56:41 +02:00
2020-01-28 16:52:50 -05:00
2020-01-17 11:57:42 -05:00
2020-03-16 17:47:44 +01:00
2020-03-24 09:10:31 -07:00
2020-03-24 08:51:32 -07:00
2020-05-08 09:32:48 -04:00
2019-04-03 15:55:55 +02:00
2019-10-15 12:56:41 +02:00
2019-11-12 15:27:47 -05:00
2020-03-16 17:47:44 +01:00
2015-10-19 13:41:30 +03:00
2019-11-04 14:29:00 -08:00