<gh_stars>0// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace PiersKarsenbarg.Octopusdeploy
{
    /// <summary>
    /// This resource manages deployment processes in Octopus Deploy.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using System.Linq;
    /// using Pulumi;
    /// using Octopusdeploy = PiersKarsenbarg.Octopusdeploy;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     // basic deployment process with 2 run a script steps
    ///     var example = new Octopusdeploy.DeploymentProcess("example", new()
    ///     {
    ///         ProjectId = "Projects-123",
    ///         Steps = new[]
    ///         {
    ///             new Octopusdeploy.Inputs.DeploymentProcessStepArgs
    ///             {
    ///                 Condition = "Success",
    ///                 Name = "Hello world (using PowerShell)",
    ///                 PackageRequirement = "LetOctopusDecide",
    ///                 RunScriptActions = new[]
    ///                 {
    ///                     new Octopusdeploy.Inputs.DeploymentProcessStepRunScriptActionArgs
    ///                     {
    ///                         CanBeUsedForProjectVersioning = false,
    ///                         Condition = "Success",
    ///                         IsDisabled = false,
    ///                         IsRequired = true,
    ///                         Name = "Hello world (using PowerShell)",
    ///                         RunOnServer = true,
    ///                         ScriptBody = @"  Write-Host 'Hello world, using PowerShell'
    ///   #TODO: Experiment with steps of your own :)
    ///   Write-Host '[Learn more about the types of steps available in Octopus](https://g.octopushq.com/OnboardingAddStepsLearnMore)'
    /// 
    /// ",
    ///                     },
    ///                 },
    ///                 StartTrigger = "StartAfterPrevious",
    ///             },
    ///             new Octopusdeploy.Inputs.DeploymentProcessStepArgs
    ///             {
    ///                 Condition = "Success",
    ///                 Name = "Hello world (using Bash)",
    ///                 PackageRequirement = "LetOctopusDecide",
    ///                 RunScriptActions = new[]
    ///                 {
    ///                     new Octopusdeploy.Inputs.DeploymentProcessStepRunScriptActionArgs
    ///                     {
    ///                         CanBeUsedForProjectVersioning = false,
    ///                         Condition = "Success",
    ///                         IsDisabled = false,
    ///                         IsRequired = true,
    ///                         Name = "Hello world (using Bash)",
    ///                         RunOnServer = true,
    ///                         ScriptBody = @"  echo 'Hello world, using Bash'
    ///   #TODO: Experiment with steps of your own :)
    ///   echo '[Learn more about the types of steps available in Octopus](https://g.octopushq.com/OnboardingAddStepsLearnMore)'
    /// 
    /// ",
    ///                     },
    ///                 },
    ///                 StartTrigger = "StartWithPrevious",
    ///             },
    ///         },
    ///     });
    /// 
    ///     // basic deployment process with 2 run a script steps as child steps
    ///     var childStepExample = new Octopusdeploy.DeploymentProcess("childStepExample", new()
    ///     {
    ///         ProjectId = "Projects-123",
    ///         Steps = new[]
    ///         {
    ///             new Octopusdeploy.Inputs.DeploymentProcessStepArgs
    ///             {
    ///                 Condition = "Success",
    ///                 Name = "Hello world (using PowerShell)",
    ///                 PackageRequirement = "LetOctopusDecide",
    ///                 RunScriptActions = new[]
    ///                 {
    ///                     new Octopusdeploy.Inputs.DeploymentProcessStepRunScriptActionArgs
    ///                     {
    ///                         CanBeUsedForProjectVersioning = false,
    ///                         Condition = "Success",
    ///                         IsDisabled = false,
    ///                         IsRequired = true,
    ///                         Name = "Hello world (using PowerShell)",
    ///                         ScriptBody = @"  Write-Host 'Hello world, using PowerShell'
    ///   #TODO: Experiment with steps of your own :)
    ///   Write-Host '[Learn more about the types of steps available in Octopus](https://g.octopushq.com/OnboardingAddStepsLearnMore)'
    /// 
    /// ",
    ///                     },
    ///                     new Octopusdeploy.Inputs.DeploymentProcessStepRunScriptActionArgs
    ///                     {
    ///                         CanBeUsedForProjectVersioning = false,
    ///                         Condition = "Success",
    ///                         IsDisabled = false,
    ///                         IsRequired = true,
    ///                         Name = "Hello world (using Bash)",
    ///                         ScriptBody = @"  echo 'Hello world, using Bash'
    ///   #TODO: Experiment with steps of your own :)
    ///   echo '[Learn more about the types of steps available in Octopus](https://g.octopushq.com/OnboardingAddStepsLearnMore)'
    /// 
    /// ",
    ///                     },
    ///                 },
    ///                 StartTrigger = "StartAfterPrevious",
    ///                 TargetRoles = new[]
    ///                 {
    ///                     "hello-world",
    ///                 },
    ///             },
    ///         },
    ///     });
    /// 
    ///     // rolling deployment process with a step with 2 run a script steps as child steps deploying to 2 targets in parallel
    ///     var childStepRollingDeploymentExample = new Octopusdeploy.DeploymentProcess("childStepRollingDeploymentExample", new()
    ///     {
    ///         ProjectId = "Projects-123",
    ///         Steps = new[]
    ///         {
    ///             new Octopusdeploy.Inputs.DeploymentProcessStepArgs
    ///             {
    ///                 Condition = "Success",
    ///                 Name = "Hello world (using PowerShell)",
    ///                 PackageRequirement = "LetOctopusDecide",
    ///                 RunScriptActions = new[]
    ///                 {
    ///                     new Octopusdeploy.Inputs.DeploymentProcessStepRunScriptActionArgs
    ///                     {
    ///                         CanBeUsedForProjectVersioning = false,
    ///                         Condition = "Success",
    ///                         IsDisabled = false,
    ///                         IsRequired = true,
    ///                         Name = "Hello world (using PowerShell)",
    ///                         ScriptBody = @"  Write-Host 'Hello world, using PowerShell'
    ///   #TODO: Experiment with steps of your own :)
    ///   Write-Host '[Learn more about the types of steps available in Octopus](https://g.octopushq.com/OnboardingAddStepsLearnMore)'
    /// 
    /// ",
    ///                     },
    ///                     new Octopusdeploy.Inputs.DeploymentProcessStepRunScriptActionArgs
    ///                     {
    ///                         CanBeUsedForProjectVersioning = false,
    ///                         Condition = "Success",
    ///                         IsDisabled = false,
    ///                         IsRequired = true,
    ///                         Name = "Hello world (using Bash)",
    ///                         ScriptBody = @"  echo 'Hello world, using Bash'
    ///   #TODO: Experiment with steps of your own :)
    ///   echo '[Learn more about the types of steps available in Octopus](https://g.octopushq.com/OnboardingAddStepsLearnMore)'
    /// 
    /// ",
    ///                     },
    ///                 },
    ///                 StartTrigger = "StartAfterPrevious",
    ///                 TargetRoles = new[]
    ///                 {
    ///                     "hello-world",
    ///                 },
    ///                 WindowSize = "2",
    ///             },
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// ```sh
    ///  $ pulumi import octopusdeploy:index/deploymentProcess:DeploymentProcess [options] octopusdeploy_deployment_process.&lt;name&gt; &lt;deployment-process-id&gt;
    /// ```
    /// </summary>
    [OctopusdeployResourceType("octopusdeploy:index/deploymentProcess:DeploymentProcess")]
    public partial class DeploymentProcess : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The branch name associated with this deployment process (i.e. `main`). This value is optional and only applies to associated projects that are stored in version control.
        /// </summary>
        [Output("branch")]
        public Output<string> Branch { get; private set; } = null!;

        [Output("lastSnapshotId")]
        public Output<string?> LastSnapshotId { get; private set; } = null!;

        /// <summary>
        /// The project ID associated with this deployment process.
        /// </summary>
        [Output("projectId")]
        public Output<string> ProjectId { get; private set; } = null!;

        /// <summary>
        /// The space ID associated with this resource.
        /// </summary>
        [Output("spaceId")]
        public Output<string> SpaceId { get; private set; } = null!;

        [Output("steps")]
        public Output<ImmutableArray<Outputs.DeploymentProcessStep>> Steps { get; private set; } = null!;

        /// <summary>
        /// The version number of this deployment process.
        /// </summary>
        [Output("version")]
        public Output<int> Version { get; private set; } = null!;


        /// <summary>
        /// Create a DeploymentProcess resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public DeploymentProcess(string name, DeploymentProcessArgs args, CustomResourceOptions? options = null)
            : base("octopusdeploy:index/deploymentProcess:DeploymentProcess", name, args ?? new DeploymentProcessArgs(), MakeResourceOptions(options, ""))
        {
        }

        private DeploymentProcess(string name, Input<string> id, DeploymentProcessState? state = null, CustomResourceOptions? options = null)
            : base("octopusdeploy:index/deploymentProcess:DeploymentProcess", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing DeploymentProcess resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static DeploymentProcess Get(string name, Input<string> id, DeploymentProcessState? state = null, CustomResourceOptions? options = null)
        {
            return new DeploymentProcess(name, id, state, options);
        }
    }

    public sealed class DeploymentProcessArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The branch name associated with this deployment process (i.e. `main`). This value is optional and only applies to associated projects that are stored in version control.
        /// </summary>
        [Input("branch")]
        public Input<string>? Branch { get; set; }

        [Input("lastSnapshotId")]
        public Input<string>? LastSnapshotId { get; set; }

        /// <summary>
        /// The project ID associated with this deployment process.
        /// </summary>
        [Input("projectId", required: true)]
        public Input<string> ProjectId { get; set; } = null!;

        /// <summary>
        /// The space ID associated with this resource.
        /// </summary>
        [Input("spaceId")]
        public Input<string>? SpaceId { get; set; }

        [Input("steps")]
        private InputList<Inputs.DeploymentProcessStepArgs>? _steps;
        public InputList<Inputs.DeploymentProcessStepArgs> Steps
        {
            get => _steps ?? (_steps = new InputList<Inputs.DeploymentProcessStepArgs>());
            set => _steps = value;
        }

        /// <summary>
        /// The version number of this deployment process.
        /// </summary>
        [Input("version")]
        public Input<int>? Version { get; set; }

        public DeploymentProcessArgs()
        {
        }
        public static new DeploymentProcessArgs Empty => new DeploymentProcessArgs();
    }

    public sealed class DeploymentProcessState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The branch name associated with this deployment process (i.e. `main`). This value is optional and only applies to associated projects that are stored in version control.
        /// </summary>
        [Input("branch")]
        public Input<string>? Branch { get; set; }

        [Input("lastSnapshotId")]
        public Input<string>? LastSnapshotId { get; set; }

        /// <summary>
        /// The project ID associated with this deployment process.
        /// </summary>
        [Input("projectId")]
        public Input<string>? ProjectId { get; set; }

        /// <summary>
        /// The space ID associated with this resource.
        /// </summary>
        [Input("spaceId")]
        public Input<string>? SpaceId { get; set; }

        [Input("steps")]
        private InputList<Inputs.DeploymentProcessStepGetArgs>? _steps;
        public InputList<Inputs.DeploymentProcessStepGetArgs> Steps
        {
            get => _steps ?? (_steps = new InputList<Inputs.DeploymentProcessStepGetArgs>());
            set => _steps = value;
        }

        /// <summary>
        /// The version number of this deployment process.
        /// </summary>
        [Input("version")]
        public Input<int>? Version { get; set; }

        public DeploymentProcessState()
        {
        }
        public static new DeploymentProcessState Empty => new DeploymentProcessState();
    }
}
