Skip to content

Latest commit

 

History

History
108 lines (89 loc) · 4.37 KB

email_task.md

File metadata and controls

108 lines (89 loc) · 4.37 KB
page_title subcategory description
morpheus_email_task Resource - terraform-provider-morpheus
Provides a Morpheus email task resource

morpheus_email_task

Provides a Morpheus email task resource

Example Usage

Creating the email task with local email template content:

resource "morpheus_email_task" "tfexample_email" {
  name                        = "tfexample_email"
  code                        = "tfexample_email"
  labels                      = ["demo", "terraform"]
  email_address               = "<%=instance.createdByEmail%>"
  subject                     = "<%=instance.hostname%> provisioning complete"
  source                      = "local"
  content                     = "Your instance <%=instance.hostname%> was provisioned."
  skip_wrapped_email_template = false
  retryable                   = true
  retry_count                 = 1
  retry_delay_seconds         = 10
  allow_custom_config         = true
}

Creating the email task with the email template fetched from a url:

resource "morpheus_email_task" "tfexample_email_url" {
  name                        = "tfexample_email_url"
  code                        = "tfexample_email_url"
  labels                      = ["demo", "terraform"]
  email_address               = "<%=instance.createdByEmail%>"
  subject                     = "<%=instance.hostname%> provisioning complete"
  source                      = "url"
  content_url                 = "https://example.com/example.txt"
  skip_wrapped_email_template = false
  retryable                   = true
  retry_count                 = 1
  retry_delay_seconds         = 10
  allow_custom_config         = true
}

Creating the email task with the email template fetched via git:

resource "morpheus_email_task" "tfexample_email_git" {
  name                        = "tfexample_email_git"
  code                        = "tfexample_email_git"
  labels                      = ["demo", "terraform"]
  email_address               = "<%=instance.createdByEmail%>"
  subject                     = "<%=instance.hostname%> provisioning complete"
  source                      = "repository"
  content_path                = "example.txt"
  repository_id               = 1
  version_ref                 = "main"
  skip_wrapped_email_template = false
  retryable                   = true
  retry_count                 = 1
  retry_delay_seconds         = 10
  allow_custom_config         = true
}

Schema

Required

  • email_address (String) Email addresses can be entered literally or Morpheus automation variables can be injected, such as <%=instance.createdByEmail%>
  • name (String) The name of the email task
  • subject (String) The subject line of the email, Morpheus automation variables can be injected into the subject field

Optional

  • allow_custom_config (Boolean) Custom configuration data to pass during the execution of the email task
  • code (String) The code of the email task
  • content (String) The body of the email is HTML. Morpheus automation variables can be injected into the email body when needed. Used with a source type of local
  • content_path (String) The file path of the template used for the email task, used with a source type of repository
  • content_url (String) The URL of the template used for the email task, used with a source type of url
  • labels (Set of String) The organization labels associated with the task (Only supported on Morpheus 5.5.3 or higher)
  • repository_id (Number) The ID of the git repository to fetch the email template
  • retry_count (Number) The number of times to retry the task if there is a failure
  • retry_delay_seconds (Number) The number of seconds to wait between retry attempts
  • retryable (Boolean) Whether to retry the task if there is a failure
  • skip_wrapped_email_template (Boolean) Whether to ignore the Morpheus-styled email template
  • source (String) Choose local to draft or paste the email directly into the Task. Choose Repository or URL to bring in a template from a Git repository or another outside source (local, repository, url)
  • version_ref (String) The git reference of the repository to pull (main, master, etc.)

Read-Only

  • id (String) The ID of the email task

Import

Import is supported using the following syntax:

terraform import morpheus_email_task.tf_example_email_task 1