# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities

__all__ = ['WorkflowAutomationArgs', 'WorkflowAutomation']

@pulumi.input_type
class WorkflowAutomationArgs:
    def __init__(__self__, *,
                 definition: pulumi.Input[_builtins.str],
                 scope_id: pulumi.Input[_builtins.str],
                 scope_type: pulumi.Input[_builtins.str],
                 name: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a WorkflowAutomation resource.

        :param pulumi.Input[_builtins.str] definition: The YAML definition of the workflow automation. This should be a valid YAML string that includes a `name` field matching the resource `name` argument, and defines the workflow steps and configuration.
        :param pulumi.Input[_builtins.str] scope_id: The scope ID for the workflow automation. For `ACCOUNT` scope, this should be your New Relic account ID (numeric). For `ORGANIZATION` scope, this should be your organization ID (string). **Important**: Changes to this field will force a new resource to be created.
        :param pulumi.Input[_builtins.str] scope_type: The scope type for the workflow automation. Must be either `ACCOUNT` or `ORGANIZATION`. **Important**: Changes to this field will force a new resource to be created.
        :param pulumi.Input[_builtins.str] name: The name of the workflow automation. This must match the `name` field in the YAML definition provided in the `definition` argument. **Important**: Changes to this field will force a new resource to be created.
        """
        pulumi.set(__self__, "definition", definition)
        pulumi.set(__self__, "scope_id", scope_id)
        pulumi.set(__self__, "scope_type", scope_type)
        if name is not None:
            pulumi.set(__self__, "name", name)

    @_builtins.property
    @pulumi.getter
    def definition(self) -> pulumi.Input[_builtins.str]:
        """
        The YAML definition of the workflow automation. This should be a valid YAML string that includes a `name` field matching the resource `name` argument, and defines the workflow steps and configuration.
        """
        return pulumi.get(self, "definition")

    @definition.setter
    def definition(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "definition", value)

    @_builtins.property
    @pulumi.getter(name="scopeId")
    def scope_id(self) -> pulumi.Input[_builtins.str]:
        """
        The scope ID for the workflow automation. For `ACCOUNT` scope, this should be your New Relic account ID (numeric). For `ORGANIZATION` scope, this should be your organization ID (string). **Important**: Changes to this field will force a new resource to be created.
        """
        return pulumi.get(self, "scope_id")

    @scope_id.setter
    def scope_id(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "scope_id", value)

    @_builtins.property
    @pulumi.getter(name="scopeType")
    def scope_type(self) -> pulumi.Input[_builtins.str]:
        """
        The scope type for the workflow automation. Must be either `ACCOUNT` or `ORGANIZATION`. **Important**: Changes to this field will force a new resource to be created.
        """
        return pulumi.get(self, "scope_type")

    @scope_type.setter
    def scope_type(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "scope_type", value)

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the workflow automation. This must match the `name` field in the YAML definition provided in the `definition` argument. **Important**: Changes to this field will force a new resource to be created.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "name", value)


@pulumi.input_type
class _WorkflowAutomationState:
    def __init__(__self__, *,
                 definition: Optional[pulumi.Input[_builtins.str]] = None,
                 definition_id: Optional[pulumi.Input[_builtins.str]] = None,
                 description: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 scope_id: Optional[pulumi.Input[_builtins.str]] = None,
                 scope_type: Optional[pulumi.Input[_builtins.str]] = None,
                 version: Optional[pulumi.Input[_builtins.int]] = None,
                 yaml: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering WorkflowAutomation resources.

        :param pulumi.Input[_builtins.str] definition: The YAML definition of the workflow automation. This should be a valid YAML string that includes a `name` field matching the resource `name` argument, and defines the workflow steps and configuration.
        :param pulumi.Input[_builtins.str] definition_id: The ID of the workflow automation.
        :param pulumi.Input[_builtins.str] description: The description of the workflow automation, as defined in the YAML definition.
        :param pulumi.Input[_builtins.str] name: The name of the workflow automation. This must match the `name` field in the YAML definition provided in the `definition` argument. **Important**: Changes to this field will force a new resource to be created.
        :param pulumi.Input[_builtins.str] scope_id: The scope ID for the workflow automation. For `ACCOUNT` scope, this should be your New Relic account ID (numeric). For `ORGANIZATION` scope, this should be your organization ID (string). **Important**: Changes to this field will force a new resource to be created.
        :param pulumi.Input[_builtins.str] scope_type: The scope type for the workflow automation. Must be either `ACCOUNT` or `ORGANIZATION`. **Important**: Changes to this field will force a new resource to be created.
        :param pulumi.Input[_builtins.int] version: The current version number of the workflow automation.
        :param pulumi.Input[_builtins.str] yaml: The yaml of the workflow automation.
        """
        if definition is not None:
            pulumi.set(__self__, "definition", definition)
        if definition_id is not None:
            pulumi.set(__self__, "definition_id", definition_id)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if scope_id is not None:
            pulumi.set(__self__, "scope_id", scope_id)
        if scope_type is not None:
            pulumi.set(__self__, "scope_type", scope_type)
        if version is not None:
            pulumi.set(__self__, "version", version)
        if yaml is not None:
            pulumi.set(__self__, "yaml", yaml)

    @_builtins.property
    @pulumi.getter
    def definition(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The YAML definition of the workflow automation. This should be a valid YAML string that includes a `name` field matching the resource `name` argument, and defines the workflow steps and configuration.
        """
        return pulumi.get(self, "definition")

    @definition.setter
    def definition(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "definition", value)

    @_builtins.property
    @pulumi.getter(name="definitionId")
    def definition_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the workflow automation.
        """
        return pulumi.get(self, "definition_id")

    @definition_id.setter
    def definition_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "definition_id", value)

    @_builtins.property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The description of the workflow automation, as defined in the YAML definition.
        """
        return pulumi.get(self, "description")

    @description.setter
    def description(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "description", value)

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the workflow automation. This must match the `name` field in the YAML definition provided in the `definition` argument. **Important**: Changes to this field will force a new resource to be created.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "name", value)

    @_builtins.property
    @pulumi.getter(name="scopeId")
    def scope_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The scope ID for the workflow automation. For `ACCOUNT` scope, this should be your New Relic account ID (numeric). For `ORGANIZATION` scope, this should be your organization ID (string). **Important**: Changes to this field will force a new resource to be created.
        """
        return pulumi.get(self, "scope_id")

    @scope_id.setter
    def scope_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "scope_id", value)

    @_builtins.property
    @pulumi.getter(name="scopeType")
    def scope_type(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The scope type for the workflow automation. Must be either `ACCOUNT` or `ORGANIZATION`. **Important**: Changes to this field will force a new resource to be created.
        """
        return pulumi.get(self, "scope_type")

    @scope_type.setter
    def scope_type(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "scope_type", value)

    @_builtins.property
    @pulumi.getter
    def version(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        The current version number of the workflow automation.
        """
        return pulumi.get(self, "version")

    @version.setter
    def version(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "version", value)

    @_builtins.property
    @pulumi.getter
    def yaml(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The yaml of the workflow automation.
        """
        return pulumi.get(self, "yaml")

    @yaml.setter
    def yaml(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "yaml", value)


@pulumi.type_token("newrelic:index/workflowAutomation:WorkflowAutomation")
class WorkflowAutomation(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 definition: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 scope_id: Optional[pulumi.Input[_builtins.str]] = None,
                 scope_type: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        Use this resource to create and manage New Relic Workflow Automation.

        Workflow Automation allows you to define automated workflows using YAML definitions. These workflows can be scoped to either an account or an organization and support various automation steps and configurations.

        ## Example Usage

        ### Basic Workflow Automation with ACCOUNT Scope

        ### Workflow Automation with ORGANIZATION Scope

        ### Advanced Workflow: CCU Governance and Monitoring

        This example demonstrates a production-grade workflow for monitoring and governing Compute Capacity Unit (CCU) consumption with input validation, email notifications, and event tracking:

        ## YAML Definition Structure

        The `definition` argument accepts a YAML string that defines the workflow automation. The YAML must include the following fields:

        ### Required Fields

        * `name` - (Required) The name of the workflow. This **must** match the `name` argument in the Terraform resource.
        * `description` - (Optional but recommended) A description of what the workflow automation does.
        * `steps` - (Required) An array of steps that define the workflow automation logic.

        ### Workflow Inputs

        Workflows can define inputs that can be passed when the workflow is executed:

        Inputs can reference secrets using the syntax: `${{ :secrets:secretName }}`

        #### Input Validation

        Workflow inputs support various validation types to ensure data integrity:

        **Regex Validation:**

        **Integer Range Validation:**

        **List Type:**

        ### Step Types

        Each step in the `steps` array can be of different types:

        #### Action Steps

        Action steps execute specific actions like querying NRDB, transforming data, or sending notifications:

        * `type: action` - Executes an action
          * `action` - The action to execute (e.g., `newrelic.nrdb.query`, `utils.transform.toCSV`, `slack.chat.postMessage`)
          * `version` - The version of the action to use
          * `inputs` - Input parameters for the action

        Common actions include:
        - `newrelic.nrdb.query` - Query New Relic database
        - `utils.transform.toCSV` - Transform data to CSV format
        - `slack.chat.postMessage` - Send messages to Slack
        - And many more...

        #### Wait Steps

        * `type: wait` - Pauses the workflow execution
          * `seconds` - Number of seconds to wait
          * `signals` - Optional array of signals to wait for
          * `next` - Optional next step name (use "end" to terminate)

        #### Switch Steps

        * `type: switch` - Conditional branching based on expressions
          * `switch` - Array of conditions to evaluate
            * `condition` - Expression to evaluate (uses JQ syntax)
            * `next` - Step to execute if condition is true
          * `next` - Default step if no conditions match

        #### Loop Steps

        * `type: loop` - Repeats a set of steps
          * `for.in` - Expression defining the iteration (e.g., `${{ [range(1; 30)] }}`)
          * `steps` - Array of steps to execute in each iteration
          * Steps can use `next: break` to exit the loop early

        ### Referencing Data in Workflows

        You can reference data from previous steps and inputs using template expressions:

        * Workflow inputs: `${{ .workflowInputs.inputName }}`
        * Step outputs: `${{ .steps.stepName.outputs.fieldName }}`
        * Secrets: `${{ :secrets:secretName }}`

        ### Example YAML Structure

        **Simple workflow with query and wait:**

        **Advanced workflow with inputs and multiple actions:**

        ## Important Notes

        ### Name Consistency

        The `name` field in the Terraform resource **must** match the `name` field in the YAML definition. If they don't match, Terraform will return an error during plan or apply.

        For example, this configuration is **correct**:

        This configuration is **incorrect** and will fail:

        ### Scope Types

        * **ACCOUNT** - The workflow automation is scoped to a specific New Relic account. Use your numeric account ID as the `scope_id`.
        * **ORGANIZATION** - The workflow automation is scoped to your entire New Relic organization. Use your organization ID string as the `scope_id`.

        ### ForceNew Attributes

        The following attributes will force a new resource to be created if changed:
        * `name` - Changing the workflow name creates a new workflow.
        * `scope_id` - Changing the scope ID creates a new workflow.
        * `scope_type` - Changing between ACCOUNT and ORGANIZATION creates a new workflow.

        ### YAML Validation

        The provider validates the YAML definition during plan and apply operations:
        * The YAML must be valid and parseable.
        * The `name` field must be present in the YAML.
        * The `name` in the YAML must match the Terraform resource `name`.

        Invalid YAML or missing required fields will result in an error.

        ## Additional Information

        For more details about New Relic Workflow Automation, please refer to the [New Relic Workflow Automation documentation](https://docs.newrelic.com/docs/workflow-automation/).

        ### Versioning

        Each time you update the `definition` of a workflow automation, New Relic automatically increments the `version` attribute. This allows you to track changes to your workflow automation over time.

        ### Best Practices

        1. **Use Heredoc Syntax**: For multi-line YAML definitions, use the heredoc syntax (`<<-YAML ... YAML`) for better readability.

        2. **External YAML Files**: For complex workflows, consider storing your YAML in separate files and using Terraform's `file()` or `templatefile()` functions:

        3. **Version Control**: Store your workflow YAML definitions in version control alongside your Terraform configuration.

        4. **Testing**: Test workflow automation changes in a non-production account before applying to production.

        5. **Naming Conventions**: Use consistent naming conventions for your workflows to make them easier to manage and identify.

        ### Troubleshooting

        #### Name Mismatch Error

        If you receive an error like "name in resource configuration does not match name in YAML definition", ensure that:
        * The `name` attribute in your Terraform resource matches exactly with the `name` field in your YAML definition.
        * There are no extra spaces or different capitalization between the two names.

        #### Scope ID Format Error

        If you receive an error about invalid scope_id format for ACCOUNT scope:
        * Ensure your account ID is numeric (e.g., "1234567", not "account-1234567").
        * For ACCOUNT scope, the scope_id should be a string representation of your numeric account ID.

        #### Invalid YAML Error

        If you receive a YAML parsing error:
        * Validate your YAML syntax using a YAML validator.
        * Ensure proper indentation (YAML is indentation-sensitive).
        * Check that all required fields are present.

        ## See Also

        * [New Relic Workflow Automation Documentation](https://docs.newrelic.com/docs/workflow-automation/)

        ## Import

        Workflow automations can be imported using the composite ID format: `<scope_type>#<scope_id>#<workflow_name>`, e.g.

        ```sh
        $ pulumi import newrelic:index/workflowAutomation:WorkflowAutomation test_query ACCOUNT#1234567#test_query_workflow
        ```

        For workflows with complex names:

        ```sh
        $ pulumi import newrelic:index/workflowAutomation:WorkflowAutomation ccu_governance ACCOUNT#1234567#CCUGovernance
        ```

        For organization-scoped workflows:

        ```sh
        $ pulumi import newrelic:index/workflowAutomation:WorkflowAutomation org_query ORGANIZATION#org-id#org_query_workflow
        ```


        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] definition: The YAML definition of the workflow automation. This should be a valid YAML string that includes a `name` field matching the resource `name` argument, and defines the workflow steps and configuration.
        :param pulumi.Input[_builtins.str] name: The name of the workflow automation. This must match the `name` field in the YAML definition provided in the `definition` argument. **Important**: Changes to this field will force a new resource to be created.
        :param pulumi.Input[_builtins.str] scope_id: The scope ID for the workflow automation. For `ACCOUNT` scope, this should be your New Relic account ID (numeric). For `ORGANIZATION` scope, this should be your organization ID (string). **Important**: Changes to this field will force a new resource to be created.
        :param pulumi.Input[_builtins.str] scope_type: The scope type for the workflow automation. Must be either `ACCOUNT` or `ORGANIZATION`. **Important**: Changes to this field will force a new resource to be created.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: WorkflowAutomationArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Use this resource to create and manage New Relic Workflow Automation.

        Workflow Automation allows you to define automated workflows using YAML definitions. These workflows can be scoped to either an account or an organization and support various automation steps and configurations.

        ## Example Usage

        ### Basic Workflow Automation with ACCOUNT Scope

        ### Workflow Automation with ORGANIZATION Scope

        ### Advanced Workflow: CCU Governance and Monitoring

        This example demonstrates a production-grade workflow for monitoring and governing Compute Capacity Unit (CCU) consumption with input validation, email notifications, and event tracking:

        ## YAML Definition Structure

        The `definition` argument accepts a YAML string that defines the workflow automation. The YAML must include the following fields:

        ### Required Fields

        * `name` - (Required) The name of the workflow. This **must** match the `name` argument in the Terraform resource.
        * `description` - (Optional but recommended) A description of what the workflow automation does.
        * `steps` - (Required) An array of steps that define the workflow automation logic.

        ### Workflow Inputs

        Workflows can define inputs that can be passed when the workflow is executed:

        Inputs can reference secrets using the syntax: `${{ :secrets:secretName }}`

        #### Input Validation

        Workflow inputs support various validation types to ensure data integrity:

        **Regex Validation:**

        **Integer Range Validation:**

        **List Type:**

        ### Step Types

        Each step in the `steps` array can be of different types:

        #### Action Steps

        Action steps execute specific actions like querying NRDB, transforming data, or sending notifications:

        * `type: action` - Executes an action
          * `action` - The action to execute (e.g., `newrelic.nrdb.query`, `utils.transform.toCSV`, `slack.chat.postMessage`)
          * `version` - The version of the action to use
          * `inputs` - Input parameters for the action

        Common actions include:
        - `newrelic.nrdb.query` - Query New Relic database
        - `utils.transform.toCSV` - Transform data to CSV format
        - `slack.chat.postMessage` - Send messages to Slack
        - And many more...

        #### Wait Steps

        * `type: wait` - Pauses the workflow execution
          * `seconds` - Number of seconds to wait
          * `signals` - Optional array of signals to wait for
          * `next` - Optional next step name (use "end" to terminate)

        #### Switch Steps

        * `type: switch` - Conditional branching based on expressions
          * `switch` - Array of conditions to evaluate
            * `condition` - Expression to evaluate (uses JQ syntax)
            * `next` - Step to execute if condition is true
          * `next` - Default step if no conditions match

        #### Loop Steps

        * `type: loop` - Repeats a set of steps
          * `for.in` - Expression defining the iteration (e.g., `${{ [range(1; 30)] }}`)
          * `steps` - Array of steps to execute in each iteration
          * Steps can use `next: break` to exit the loop early

        ### Referencing Data in Workflows

        You can reference data from previous steps and inputs using template expressions:

        * Workflow inputs: `${{ .workflowInputs.inputName }}`
        * Step outputs: `${{ .steps.stepName.outputs.fieldName }}`
        * Secrets: `${{ :secrets:secretName }}`

        ### Example YAML Structure

        **Simple workflow with query and wait:**

        **Advanced workflow with inputs and multiple actions:**

        ## Important Notes

        ### Name Consistency

        The `name` field in the Terraform resource **must** match the `name` field in the YAML definition. If they don't match, Terraform will return an error during plan or apply.

        For example, this configuration is **correct**:

        This configuration is **incorrect** and will fail:

        ### Scope Types

        * **ACCOUNT** - The workflow automation is scoped to a specific New Relic account. Use your numeric account ID as the `scope_id`.
        * **ORGANIZATION** - The workflow automation is scoped to your entire New Relic organization. Use your organization ID string as the `scope_id`.

        ### ForceNew Attributes

        The following attributes will force a new resource to be created if changed:
        * `name` - Changing the workflow name creates a new workflow.
        * `scope_id` - Changing the scope ID creates a new workflow.
        * `scope_type` - Changing between ACCOUNT and ORGANIZATION creates a new workflow.

        ### YAML Validation

        The provider validates the YAML definition during plan and apply operations:
        * The YAML must be valid and parseable.
        * The `name` field must be present in the YAML.
        * The `name` in the YAML must match the Terraform resource `name`.

        Invalid YAML or missing required fields will result in an error.

        ## Additional Information

        For more details about New Relic Workflow Automation, please refer to the [New Relic Workflow Automation documentation](https://docs.newrelic.com/docs/workflow-automation/).

        ### Versioning

        Each time you update the `definition` of a workflow automation, New Relic automatically increments the `version` attribute. This allows you to track changes to your workflow automation over time.

        ### Best Practices

        1. **Use Heredoc Syntax**: For multi-line YAML definitions, use the heredoc syntax (`<<-YAML ... YAML`) for better readability.

        2. **External YAML Files**: For complex workflows, consider storing your YAML in separate files and using Terraform's `file()` or `templatefile()` functions:

        3. **Version Control**: Store your workflow YAML definitions in version control alongside your Terraform configuration.

        4. **Testing**: Test workflow automation changes in a non-production account before applying to production.

        5. **Naming Conventions**: Use consistent naming conventions for your workflows to make them easier to manage and identify.

        ### Troubleshooting

        #### Name Mismatch Error

        If you receive an error like "name in resource configuration does not match name in YAML definition", ensure that:
        * The `name` attribute in your Terraform resource matches exactly with the `name` field in your YAML definition.
        * There are no extra spaces or different capitalization between the two names.

        #### Scope ID Format Error

        If you receive an error about invalid scope_id format for ACCOUNT scope:
        * Ensure your account ID is numeric (e.g., "1234567", not "account-1234567").
        * For ACCOUNT scope, the scope_id should be a string representation of your numeric account ID.

        #### Invalid YAML Error

        If you receive a YAML parsing error:
        * Validate your YAML syntax using a YAML validator.
        * Ensure proper indentation (YAML is indentation-sensitive).
        * Check that all required fields are present.

        ## See Also

        * [New Relic Workflow Automation Documentation](https://docs.newrelic.com/docs/workflow-automation/)

        ## Import

        Workflow automations can be imported using the composite ID format: `<scope_type>#<scope_id>#<workflow_name>`, e.g.

        ```sh
        $ pulumi import newrelic:index/workflowAutomation:WorkflowAutomation test_query ACCOUNT#1234567#test_query_workflow
        ```

        For workflows with complex names:

        ```sh
        $ pulumi import newrelic:index/workflowAutomation:WorkflowAutomation ccu_governance ACCOUNT#1234567#CCUGovernance
        ```

        For organization-scoped workflows:

        ```sh
        $ pulumi import newrelic:index/workflowAutomation:WorkflowAutomation org_query ORGANIZATION#org-id#org_query_workflow
        ```


        :param str resource_name: The name of the resource.
        :param WorkflowAutomationArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(WorkflowAutomationArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 definition: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 scope_id: Optional[pulumi.Input[_builtins.str]] = None,
                 scope_type: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = WorkflowAutomationArgs.__new__(WorkflowAutomationArgs)

            if definition is None and not opts.urn:
                raise TypeError("Missing required property 'definition'")
            __props__.__dict__["definition"] = definition
            __props__.__dict__["name"] = name
            if scope_id is None and not opts.urn:
                raise TypeError("Missing required property 'scope_id'")
            __props__.__dict__["scope_id"] = scope_id
            if scope_type is None and not opts.urn:
                raise TypeError("Missing required property 'scope_type'")
            __props__.__dict__["scope_type"] = scope_type
            __props__.__dict__["definition_id"] = None
            __props__.__dict__["description"] = None
            __props__.__dict__["version"] = None
            __props__.__dict__["yaml"] = None
        super(WorkflowAutomation, __self__).__init__(
            'newrelic:index/workflowAutomation:WorkflowAutomation',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            definition: Optional[pulumi.Input[_builtins.str]] = None,
            definition_id: Optional[pulumi.Input[_builtins.str]] = None,
            description: Optional[pulumi.Input[_builtins.str]] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None,
            scope_id: Optional[pulumi.Input[_builtins.str]] = None,
            scope_type: Optional[pulumi.Input[_builtins.str]] = None,
            version: Optional[pulumi.Input[_builtins.int]] = None,
            yaml: Optional[pulumi.Input[_builtins.str]] = None) -> 'WorkflowAutomation':
        """
        Get an existing WorkflowAutomation resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] definition: The YAML definition of the workflow automation. This should be a valid YAML string that includes a `name` field matching the resource `name` argument, and defines the workflow steps and configuration.
        :param pulumi.Input[_builtins.str] definition_id: The ID of the workflow automation.
        :param pulumi.Input[_builtins.str] description: The description of the workflow automation, as defined in the YAML definition.
        :param pulumi.Input[_builtins.str] name: The name of the workflow automation. This must match the `name` field in the YAML definition provided in the `definition` argument. **Important**: Changes to this field will force a new resource to be created.
        :param pulumi.Input[_builtins.str] scope_id: The scope ID for the workflow automation. For `ACCOUNT` scope, this should be your New Relic account ID (numeric). For `ORGANIZATION` scope, this should be your organization ID (string). **Important**: Changes to this field will force a new resource to be created.
        :param pulumi.Input[_builtins.str] scope_type: The scope type for the workflow automation. Must be either `ACCOUNT` or `ORGANIZATION`. **Important**: Changes to this field will force a new resource to be created.
        :param pulumi.Input[_builtins.int] version: The current version number of the workflow automation.
        :param pulumi.Input[_builtins.str] yaml: The yaml of the workflow automation.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _WorkflowAutomationState.__new__(_WorkflowAutomationState)

        __props__.__dict__["definition"] = definition
        __props__.__dict__["definition_id"] = definition_id
        __props__.__dict__["description"] = description
        __props__.__dict__["name"] = name
        __props__.__dict__["scope_id"] = scope_id
        __props__.__dict__["scope_type"] = scope_type
        __props__.__dict__["version"] = version
        __props__.__dict__["yaml"] = yaml
        return WorkflowAutomation(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter
    def definition(self) -> pulumi.Output[_builtins.str]:
        """
        The YAML definition of the workflow automation. This should be a valid YAML string that includes a `name` field matching the resource `name` argument, and defines the workflow steps and configuration.
        """
        return pulumi.get(self, "definition")

    @_builtins.property
    @pulumi.getter(name="definitionId")
    def definition_id(self) -> pulumi.Output[_builtins.str]:
        """
        The ID of the workflow automation.
        """
        return pulumi.get(self, "definition_id")

    @_builtins.property
    @pulumi.getter
    def description(self) -> pulumi.Output[_builtins.str]:
        """
        The description of the workflow automation, as defined in the YAML definition.
        """
        return pulumi.get(self, "description")

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[_builtins.str]:
        """
        The name of the workflow automation. This must match the `name` field in the YAML definition provided in the `definition` argument. **Important**: Changes to this field will force a new resource to be created.
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter(name="scopeId")
    def scope_id(self) -> pulumi.Output[_builtins.str]:
        """
        The scope ID for the workflow automation. For `ACCOUNT` scope, this should be your New Relic account ID (numeric). For `ORGANIZATION` scope, this should be your organization ID (string). **Important**: Changes to this field will force a new resource to be created.
        """
        return pulumi.get(self, "scope_id")

    @_builtins.property
    @pulumi.getter(name="scopeType")
    def scope_type(self) -> pulumi.Output[_builtins.str]:
        """
        The scope type for the workflow automation. Must be either `ACCOUNT` or `ORGANIZATION`. **Important**: Changes to this field will force a new resource to be created.
        """
        return pulumi.get(self, "scope_type")

    @_builtins.property
    @pulumi.getter
    def version(self) -> pulumi.Output[_builtins.int]:
        """
        The current version number of the workflow automation.
        """
        return pulumi.get(self, "version")

    @_builtins.property
    @pulumi.getter
    def yaml(self) -> pulumi.Output[_builtins.str]:
        """
        The yaml of the workflow automation.
        """
        return pulumi.get(self, "yaml")

