From f159f95f8fc5d24f2e072a4df86a2c4325c8ccac Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 15 Feb 2022 11:34:16 +0100 Subject: [PATCH] codegen --- .../builder/happycloud/Config-not-required.mdx | 16 ++++++++++++++++ .../builder/happycloud/Config-required.mdx | 5 +++++ .../docs-partials/builder/happycloud/Config.mdx | 7 +++++++ .../CustomerEncryptionKey-not-required.mdx | 8 ++++++++ .../builder/happycloud/CustomerEncryptionKey.mdx | 5 +++++ shell-local/config.hcl2spec.go | 2 ++ 6 files changed, 43 insertions(+) create mode 100644 cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/Config-not-required.mdx create mode 100644 cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/Config-required.mdx create mode 100644 cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/Config.mdx create mode 100644 cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/CustomerEncryptionKey-not-required.mdx create mode 100644 cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/CustomerEncryptionKey.mdx diff --git a/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/Config-not-required.mdx b/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/Config-not-required.mdx new file mode 100644 index 0000000000..08c44c0ec9 --- /dev/null +++ b/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/Config-not-required.mdx @@ -0,0 +1,16 @@ + + +- `account_file` (string) - The JSON file containing your account credentials. Not required if you + run Packer on a HappyCloud instance with a service account. Instructions for + creating the file or using service accounts are above. + +- `accelerator_count` (int64) - Number of guest accelerator cards to add to the launched instance. + +- `address` (string) - The name of a pre-allocated static external IP address. Note, must be the + name and not the actual IP address. + +- `disable_default_service_account` (bool) - If true, the default service account will not be used if + service_account_email is not specified. Set this value to true and omit + service_account_email to provision a VM with no service account. + + diff --git a/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/Config-required.mdx b/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/Config-required.mdx new file mode 100644 index 0000000000..0f64817192 --- /dev/null +++ b/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/Config-required.mdx @@ -0,0 +1,5 @@ + + +- `project_id` (string) - The project ID that will be used to launch instances and store images. + + diff --git a/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/Config.mdx b/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/Config.mdx new file mode 100644 index 0000000000..927b9a8165 --- /dev/null +++ b/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/Config.mdx @@ -0,0 +1,7 @@ + + +Config is the configuration structure for the happycloud builder. It stores +both the publicly settable state as well as the privately generated state of +the config object. + + diff --git a/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/CustomerEncryptionKey-not-required.mdx b/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/CustomerEncryptionKey-not-required.mdx new file mode 100644 index 0000000000..438ead349c --- /dev/null +++ b/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/CustomerEncryptionKey-not-required.mdx @@ -0,0 +1,8 @@ + + +- `key_name` (string) - KeyName: The name of the encryption key that is stored in happycloud + +- `raw_key` (string) - RawKey: Specifies a 256-bit customer-supplied encryption key, encoded in + RFC 4648 base64 to either encrypt or decrypt this resource. + + diff --git a/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/CustomerEncryptionKey.mdx b/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/CustomerEncryptionKey.mdx new file mode 100644 index 0000000000..d626cac0ad --- /dev/null +++ b/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/docs-partials/builder/happycloud/CustomerEncryptionKey.mdx @@ -0,0 +1,5 @@ + + +CustomerEncryptionKey helps configure a customer encryption key + + diff --git a/shell-local/config.hcl2spec.go b/shell-local/config.hcl2spec.go index 085322dfec..92e2db3600 100644 --- a/shell-local/config.hcl2spec.go +++ b/shell-local/config.hcl2spec.go @@ -23,6 +23,7 @@ type FlatConfig struct { Scripts []string `cty:"scripts" hcl:"scripts"` ValidExitCodes []int `mapstructure:"valid_exit_codes" cty:"valid_exit_codes" hcl:"valid_exit_codes"` Vars []string `mapstructure:"environment_vars" cty:"environment_vars" hcl:"environment_vars"` + Env map[string]string `mapstructure:"env" cty:"env" hcl:"env"` EnvVarFormat *string `mapstructure:"env_var_format" cty:"env_var_format" hcl:"env_var_format"` Command *string `cty:"command" hcl:"command"` ExecuteCommand []string `mapstructure:"execute_command" cty:"execute_command" hcl:"execute_command"` @@ -57,6 +58,7 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { "scripts": &hcldec.AttrSpec{Name: "scripts", Type: cty.List(cty.String), Required: false}, "valid_exit_codes": &hcldec.AttrSpec{Name: "valid_exit_codes", Type: cty.List(cty.Number), Required: false}, "environment_vars": &hcldec.AttrSpec{Name: "environment_vars", Type: cty.List(cty.String), Required: false}, + "env": &hcldec.AttrSpec{Name: "env", Type: cty.Map(cty.String), Required: false}, "env_var_format": &hcldec.AttrSpec{Name: "env_var_format", Type: cty.String, Required: false}, "command": &hcldec.AttrSpec{Name: "command", Type: cty.String, Required: false}, "execute_command": &hcldec.AttrSpec{Name: "execute_command", Type: cty.List(cty.String), Required: false},