packer-cn/builder/amazon/common
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
..
access_config.go packer.io prefix removal, html extension remove for in-code errors 2020-04-07 17:53:22 -04:00
access_config.hcl2spec.go HCL2: generate hcl tags with go-cty tags too (#9306) 2020-05-28 11:19:00 +02:00
access_config_test.go make ValidateRegion a member of *AccessConfig and make it variadic 2018-10-24 11:26:53 +02:00
ami_config.go make sure keyvalue and namevalue filters are using the same naming as the service being used 2020-04-16 17:22:13 +02:00
ami_config_test.go builder/amazon/common: remove nil check on slice, len() on nil slices is zero 2019-10-31 12:09:32 -07:00
artifact.go Sharing info with post-processors via artifact (#8632) 2020-01-30 11:27:58 +01:00
artifact_test.go Sharing info with post-processors via artifact (#8632) 2020-01-30 11:27:58 +01:00
block_device.go docs: Various doc clean-ups to fix code block formatting and syntax highlighting (#8868) 2020-03-12 15:05:08 +01:00
block_device.hcl2spec.go HCL2: generate hcl tags with go-cty tags too (#9306) 2020-05-28 11:19:00 +02:00
block_device_test.go fix test 2019-09-20 15:28:43 +02:00
build_filter.go need to initialize variables scoped to the individual loop, because the address of k,v stay the same and that means we overwrite previous variables when assigning them to the struct directly. 2019-10-28 14:31:13 -07:00
build_filter_test.go add test to catch this case 2019-10-29 11:28:56 -07:00
errors.go builder/amazon/common: remove nil check on slice, len() on nil slices is zero 2019-10-31 12:09:32 -07:00
errors_test.go use a UI wrapper to auto-decode error messages 2018-09-11 16:05:43 -07:00
helper_funcs.go Add retry mechanism to amazon DeleteSnapshot (#8614) 2020-01-16 14:38:46 +01:00
interpolate_build_info.go Added SourceAMICreationDate 2020-05-26 15:04:03 -04:00
interpolate_build_info_test.go Added SourceAMICreationDate 2020-05-26 15:04:03 -04:00
regions.go aws: document ValidateRegion better 2019-02-27 11:17:08 +01:00
run_config.go Apply suggestions from code review 2020-05-08 09:36:43 -04:00
run_config.hcl2spec.go HCL2: generate hcl tags with go-cty tags too (#9306) 2020-05-28 11:19:00 +02:00
run_config_test.go make sure keyvalue and namevalue filters are using the same naming as the service being used 2020-04-16 17:22:13 +02:00
ssh.go Update address to localhost to be consistent with other proxies 2020-05-08 09:32:54 -04:00
ssh_test.go Update address to localhost to be consistent with other proxies 2020-05-08 09:32:54 -04:00
ssm_driver.go tests/builder/amazon: Enhance the test coverage for SSM Tunnel related steps (#9213) 2020-05-13 10:10:55 -04:00
ssm_driver_test.go tests/builder/amazon: Enhance the test coverage for SSM Tunnel related steps (#9213) 2020-05-13 10:10:55 -04:00
ssm_mock_funcs.go tests/builder/amazon: Enhance the test coverage for SSM Tunnel related steps (#9213) 2020-05-13 10:10:55 -04:00
state.go Instance Running waiter not aware of global waiter settings 2020-02-05 15:09:09 -08:00
state_test.go refactored env var code and tests so that I don't have to set env vars during tests to check logic 2018-07-11 10:36:21 -07:00
step_ami_region_copy.go Format code with `gofmt -s -w` 2020-01-28 16:52:50 -05:00
step_ami_region_copy_test.go use trilean initializers in test where missing 2019-08-23 11:17:45 +02:00
step_cleanup_volumes.go make error messaging around ResourceNotReady better, update docs with other possible issues (#8349) 2019-11-08 11:15:24 +01:00
step_create_ssm_tunnel.go tests/builder/amazon: Enhance the test coverage for SSM Tunnel related steps (#9213) 2020-05-13 10:10:55 -04:00
step_create_ssm_tunnel_test.go tests/builder/amazon: Enhance the test coverage for SSM Tunnel related steps (#9213) 2020-05-13 10:10:55 -04:00
step_create_tags.go wip 2020-03-16 17:47:44 +01:00
step_deregister_ami.go rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
step_get_password.go get data sharing to a working state with the powershell provisioner 2019-12-11 15:43:38 -08:00
step_iam_instance_profile.go build using HCL2 (#8423) 2019-12-17 11:25:56 +01:00
step_key_pair.go refactor: replace the maxBackoff from 30 nanosecond to 30 seconds 2019-06-11 16:01:03 +05:30
step_modify_ami_attributes.go Add golangci-lint to project (#8686) 2020-02-14 11:42:29 -05:00
step_modify_ebs_instance.go amazon-ebssurrogate: allow enabling ena/sr-iov on spot instances 2019-11-21 11:13:32 +01:00
step_network_info.go builder.amazon.common: remove pointer (*) from []*string and map[*string]*string types 2019-10-15 12:56:41 +02:00
step_pre_validate.go allow validation to pass when subnet filters are present 2020-01-17 11:57:42 -05:00
step_pre_validate_test.go Format code with `gofmt -s -w` 2020-01-28 16:52:50 -05:00
step_run_source_instance.go wip 2020-03-16 17:47:44 +01:00
step_run_spot_instance.go only set NoDevice if NoEphemeral is set; otherwise, legit block device mappings get destroyed 2020-03-24 08:51:32 -07:00
step_run_spot_instance_test.go add test of NoEphemeral 2020-03-24 09:10:31 -07:00
step_security_group.go amazon/builder: Move port validation for security group into RunConfig.Prepare 2020-05-08 09:32:48 -04:00
step_source_ami_info.go builder.amazon.common: remove pointer (*) from []*string and map[*string]*string types 2019-10-15 12:56:41 +02:00
step_source_ami_info_test.go change Builder to be passed a context for cancellation 2019-04-03 15:55:55 +02:00
step_stop_ebs_instance.go builder/amazon: Add helper function for checking against AWSError 2019-11-12 15:27:47 -05:00
tags.go wip 2020-03-16 17:47:44 +01:00
template_funcs.go Revert "fix template imports" 2019-11-04 14:29:00 -08:00
template_funcs_test.go Fix not allowed comma, add all allowed special characters 2015-10-19 13:41:30 +03:00