Skip to content

Commit

Permalink
Extend documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
simaotwx committed Aug 14, 2024
1 parent 0e8efff commit 45a681f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
6 changes: 3 additions & 3 deletions docs/resources/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ description: |-

- `additional_params` (Set of String) Additional parameters to pass to Packer. Consult Packer documentation for details. Example: `additional_params = ["-parallel-builds=1"]`
- `directory` (String) Working directory to run Packer inside. Default is cwd.
- `environment` (Map of String) Environment variables
- `environment` (Map of String) Environment variables to pass to Packer
- `file` (String) Packer file to use for building
- `force` (Boolean) Force overwriting existing images
- `ignore_environment` (Boolean) Prevents passing all environment variables of the provider through to Packer
- `name` (String) Name of this build. This value is not passed to Packer.
- `sensitive_variables` (Dynamic, Sensitive) Sensitive variables to pass to Packer (does the same as variables, but makes sure Terraform knows these values are sensitive)
- `sensitive_variables` (Dynamic, Sensitive) Sensitive variables to pass to Packer (does the same as variables, but makes sure Terraform knows these values are sensitive). Can contain following types: bool, number, string, list(string), set(string).
- `triggers` (Map of String) Values that, when changed, trigger an update of this resource
- `variables` (Dynamic) Variables to pass to Packer
- `variables` (Dynamic) Variables to pass to Packer. Must be map or object. Can contain following types: bool, number, string, list(string), set(string).

### Read-Only

Expand Down
12 changes: 6 additions & 6 deletions examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
source = "toowoxx/packer"
}
random = {
source = "hashicorp/random"
source = "hashicorp/random"
version = "3.6.2"
}
}
Expand Down Expand Up @@ -73,7 +73,7 @@ resource "packer_image" "image2" {
}

resource "packer_image" "plugins_test" {
file = "tests/plugins.pkr.hcl"
file = "tests/plugins.pkr.hcl"
force = true
triggers = {
packer_version = data.packer_version.version.version
Expand All @@ -86,9 +86,9 @@ data "packer_files" "plugins" {

resource "packer_image" "plugins_dir_test" {
directory = "tests/plugins"
force = true
force = true
environment = {
PACKER_LOG = "1"
PACKER_LOG = "1"
PACKER_LOG_PATH = "/tmp/test-plugins-dir-packer.log"
}
triggers = {
Expand All @@ -97,10 +97,10 @@ resource "packer_image" "plugins_dir_test" {
}

resource "packer_image" "log_output_test_17" {
file = "tests/17_log_output.pkr.hcl"
file = "tests/17_log_output.pkr.hcl"
force = true
environment = {
PACKER_LOG = "1"
PACKER_LOG = "1"
PACKER_LOG_PATH = "/tmp/test-17-packer.log"
}
triggers = {
Expand Down
10 changes: 6 additions & 4 deletions provider/resource_packer_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ func (r resourceImage) Schema(_ context.Context, _ resource.SchemaRequest, respo
Optional: true,
},
"variables": schema.DynamicAttribute{
Description: "Variables to pass to Packer",
Optional: true,
Description: "Variables to pass to Packer. Must be map or object. " +
"Can contain following types: bool, number, string, list(string), set(string).",
Optional: true,
},
"sensitive_variables": schema.DynamicAttribute{
Description: "Sensitive variables to pass to Packer " +
"(does the same as variables, but makes sure Terraform knows these values are sensitive)",
"(does the same as variables, but makes sure Terraform knows these values are sensitive). " +
"Can contain following types: bool, number, string, list(string), set(string).",
Sensitive: true,
Optional: true,
},
Expand All @@ -110,7 +112,7 @@ func (r resourceImage) Schema(_ context.Context, _ resource.SchemaRequest, respo
Optional: true,
},
"environment": schema.MapAttribute{
Description: "Environment variables",
Description: "Environment variables to pass to Packer",
ElementType: types.StringType,
Optional: true,
},
Expand Down

0 comments on commit 45a681f

Please sign in to comment.