diff --git a/docs/index.md b/docs/index.md index b88381a..a59fe8e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -44,6 +44,9 @@ resource "linux_script" "install_package" { PACKAGE_NAME = "apache2" PACKAGE_VERSION = "2.4.18-2ubuntu3.4" } + triggers = { + PACKAGE_NAME = "apache2" + } } ``` diff --git a/docs/resources/script.md b/docs/resources/script.md index 3e5b2fb..fad6018 100644 --- a/docs/resources/script.md +++ b/docs/resources/script.md @@ -16,6 +16,9 @@ resource "linux_script" "install_package" { PACKAGE_NAME = "apache2" PACKAGE_VERSION = "2.4.18-2ubuntu3.4" } + triggers = { + PACKAGE_NAME = "apache2" + } } ``` diff --git a/linux/script-resource.go b/linux/script-resource.go index cf1f113..8ec714e 100644 --- a/linux/script-resource.go +++ b/linux/script-resource.go @@ -23,14 +23,17 @@ const ( attrScriptLifecycleCommandRead = "read" attrScriptLifecycleCommandUpdate = "update" attrScriptLifecycleCommandDelete = "delete" - attrScriptTriggers = "triggers" - attrScriptEnvironment = "environment" - attrScriptSensitiveEnvironment = "sensitive_environment" attrScriptInterpreter = "interpreter" - attrScriptWorkingDirectory = "working_directory" - attrScriptDirty = "dirty" - attrScriptReadFailed = "read_failed" - attrScriptOutput = "output" + + attrScriptTriggers = "triggers" + attrScriptEnvironment = "environment" + attrScriptSensitiveEnvironment = "sensitive_environment" + attrScriptWorkingDirectory = "working_directory" + + attrScriptOutput = "output" + + attrScriptDirty = "__dirty__" + attrScriptReadFailed = "__read_failed__" ) var schemaScriptResource = map[string]*schema.Schema{ @@ -59,6 +62,14 @@ var schemaScriptResource = map[string]*schema.Schema{ }, }, }, + attrScriptInterpreter: { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + attrScriptTriggers: { Type: schema.TypeMap, Optional: true, @@ -75,13 +86,6 @@ var schemaScriptResource = map[string]*schema.Schema{ Elem: schema.TypeString, Sensitive: true, }, - attrScriptInterpreter: { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, attrScriptWorkingDirectory: { Type: schema.TypeString, Optional: true, @@ -97,13 +101,13 @@ var schemaScriptResource = map[string]*schema.Schema{ Type: schema.TypeBool, Optional: true, Default: false, - Description: "`true` if new output is different than previous output. User must not manually set it to `true`", + Description: "`true` if new output is different than previous output. User must not manually set this to `true`", }, attrScriptReadFailed: { Type: schema.TypeBool, Optional: true, Default: false, - Description: "`true` if read operation result in execution error. User must not manually set it to `true`", + Description: "`true` if read operation result in execution error. User must not manually set this to `true`", }, }