1. Packages
  2. Azure Native
  3. API Docs
  4. durabletask
  5. RetentionPolicy
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.3.0 published on Monday, Apr 28, 2025 by Pulumi

azure-native.durabletask.RetentionPolicy

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.3.0 published on Monday, Apr 28, 2025 by Pulumi

    A retention policy resource belonging to the scheduler

    Uses Azure REST API version 2025-04-01-preview.

    Example Usage

    RetentionPolicies_CreateOrReplace_MaximumSet

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var retentionPolicy = new AzureNative.DurableTask.RetentionPolicy("retentionPolicy", new()
        {
            Properties = new AzureNative.DurableTask.Inputs.RetentionPolicyPropertiesArgs
            {
                RetentionPolicies = new[]
                {
                    new AzureNative.DurableTask.Inputs.RetentionPolicyDetailsArgs
                    {
                        RetentionPeriodInDays = 30,
                    },
                    new AzureNative.DurableTask.Inputs.RetentionPolicyDetailsArgs
                    {
                        OrchestrationState = AzureNative.DurableTask.PurgeableOrchestrationState.Failed,
                        RetentionPeriodInDays = 10,
                    },
                },
            },
            ResourceGroupName = "rgdurabletask",
            SchedulerName = "testscheduler",
        });
    
    });
    
    package main
    
    import (
    	durabletask "github.com/pulumi/pulumi-azure-native-sdk/durabletask/v3"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := durabletask.NewRetentionPolicy(ctx, "retentionPolicy", &durabletask.RetentionPolicyArgs{
    			Properties: &durabletask.RetentionPolicyPropertiesArgs{
    				RetentionPolicies: durabletask.RetentionPolicyDetailsArray{
    					&durabletask.RetentionPolicyDetailsArgs{
    						RetentionPeriodInDays: pulumi.Int(30),
    					},
    					&durabletask.RetentionPolicyDetailsArgs{
    						OrchestrationState:    pulumi.String(durabletask.PurgeableOrchestrationStateFailed),
    						RetentionPeriodInDays: pulumi.Int(10),
    					},
    				},
    			},
    			ResourceGroupName: pulumi.String("rgdurabletask"),
    			SchedulerName:     pulumi.String("testscheduler"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.durabletask.RetentionPolicy;
    import com.pulumi.azurenative.durabletask.RetentionPolicyArgs;
    import com.pulumi.azurenative.durabletask.inputs.RetentionPolicyPropertiesArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var retentionPolicy = new RetentionPolicy("retentionPolicy", RetentionPolicyArgs.builder()
                .properties(RetentionPolicyPropertiesArgs.builder()
                    .retentionPolicies(                
                        RetentionPolicyDetailsArgs.builder()
                            .retentionPeriodInDays(30)
                            .build(),
                        RetentionPolicyDetailsArgs.builder()
                            .orchestrationState("Failed")
                            .retentionPeriodInDays(10)
                            .build())
                    .build())
                .resourceGroupName("rgdurabletask")
                .schedulerName("testscheduler")
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const retentionPolicy = new azure_native.durabletask.RetentionPolicy("retentionPolicy", {
        properties: {
            retentionPolicies: [
                {
                    retentionPeriodInDays: 30,
                },
                {
                    orchestrationState: azure_native.durabletask.PurgeableOrchestrationState.Failed,
                    retentionPeriodInDays: 10,
                },
            ],
        },
        resourceGroupName: "rgdurabletask",
        schedulerName: "testscheduler",
    });
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    retention_policy = azure_native.durabletask.RetentionPolicy("retentionPolicy",
        properties={
            "retention_policies": [
                {
                    "retention_period_in_days": 30,
                },
                {
                    "orchestration_state": azure_native.durabletask.PurgeableOrchestrationState.FAILED,
                    "retention_period_in_days": 10,
                },
            ],
        },
        resource_group_name="rgdurabletask",
        scheduler_name="testscheduler")
    
    resources:
      retentionPolicy:
        type: azure-native:durabletask:RetentionPolicy
        properties:
          properties:
            retentionPolicies:
              - retentionPeriodInDays: 30
              - orchestrationState: Failed
                retentionPeriodInDays: 10
          resourceGroupName: rgdurabletask
          schedulerName: testscheduler
    

    Create RetentionPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new RetentionPolicy(name: string, args: RetentionPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def RetentionPolicy(resource_name: str,
                        args: RetentionPolicyArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def RetentionPolicy(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        resource_group_name: Optional[str] = None,
                        scheduler_name: Optional[str] = None,
                        properties: Optional[RetentionPolicyPropertiesArgs] = None)
    func NewRetentionPolicy(ctx *Context, name string, args RetentionPolicyArgs, opts ...ResourceOption) (*RetentionPolicy, error)
    public RetentionPolicy(string name, RetentionPolicyArgs args, CustomResourceOptions? opts = null)
    public RetentionPolicy(String name, RetentionPolicyArgs args)
    public RetentionPolicy(String name, RetentionPolicyArgs args, CustomResourceOptions options)
    
    type: azure-native:durabletask:RetentionPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args RetentionPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args RetentionPolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args RetentionPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RetentionPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RetentionPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var retentionPolicyResource = new AzureNative.DurableTask.RetentionPolicy("retentionPolicyResource", new()
    {
        ResourceGroupName = "string",
        SchedulerName = "string",
        Properties = new AzureNative.DurableTask.Inputs.RetentionPolicyPropertiesArgs
        {
            RetentionPolicies = new[]
            {
                new AzureNative.DurableTask.Inputs.RetentionPolicyDetailsArgs
                {
                    RetentionPeriodInDays = 0,
                    OrchestrationState = "string",
                },
            },
        },
    });
    
    example, err := durabletask.NewRetentionPolicy(ctx, "retentionPolicyResource", &durabletask.RetentionPolicyArgs{
    	ResourceGroupName: pulumi.String("string"),
    	SchedulerName:     pulumi.String("string"),
    	Properties: &durabletask.RetentionPolicyPropertiesArgs{
    		RetentionPolicies: durabletask.RetentionPolicyDetailsArray{
    			&durabletask.RetentionPolicyDetailsArgs{
    				RetentionPeriodInDays: pulumi.Int(0),
    				OrchestrationState:    pulumi.String("string"),
    			},
    		},
    	},
    })
    
    var retentionPolicyResource = new RetentionPolicy("retentionPolicyResource", RetentionPolicyArgs.builder()
        .resourceGroupName("string")
        .schedulerName("string")
        .properties(RetentionPolicyPropertiesArgs.builder()
            .retentionPolicies(RetentionPolicyDetailsArgs.builder()
                .retentionPeriodInDays(0)
                .orchestrationState("string")
                .build())
            .build())
        .build());
    
    retention_policy_resource = azure_native.durabletask.RetentionPolicy("retentionPolicyResource",
        resource_group_name="string",
        scheduler_name="string",
        properties={
            "retention_policies": [{
                "retention_period_in_days": 0,
                "orchestration_state": "string",
            }],
        })
    
    const retentionPolicyResource = new azure_native.durabletask.RetentionPolicy("retentionPolicyResource", {
        resourceGroupName: "string",
        schedulerName: "string",
        properties: {
            retentionPolicies: [{
                retentionPeriodInDays: 0,
                orchestrationState: "string",
            }],
        },
    });
    
    type: azure-native:durabletask:RetentionPolicy
    properties:
        properties:
            retentionPolicies:
                - orchestrationState: string
                  retentionPeriodInDays: 0
        resourceGroupName: string
        schedulerName: string
    

    RetentionPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The RetentionPolicy resource accepts the following input properties:

    ResourceGroupName string
    The name of the resource group. The name is case insensitive.
    SchedulerName string
    The name of the Scheduler
    Properties Pulumi.AzureNative.DurableTask.Inputs.RetentionPolicyProperties
    The resource-specific properties for this resource.
    ResourceGroupName string
    The name of the resource group. The name is case insensitive.
    SchedulerName string
    The name of the Scheduler
    Properties RetentionPolicyPropertiesArgs
    The resource-specific properties for this resource.
    resourceGroupName String
    The name of the resource group. The name is case insensitive.
    schedulerName String
    The name of the Scheduler
    properties RetentionPolicyProperties
    The resource-specific properties for this resource.
    resourceGroupName string
    The name of the resource group. The name is case insensitive.
    schedulerName string
    The name of the Scheduler
    properties RetentionPolicyProperties
    The resource-specific properties for this resource.
    resource_group_name str
    The name of the resource group. The name is case insensitive.
    scheduler_name str
    The name of the Scheduler
    properties RetentionPolicyPropertiesArgs
    The resource-specific properties for this resource.
    resourceGroupName String
    The name of the resource group. The name is case insensitive.
    schedulerName String
    The name of the Scheduler
    properties Property Map
    The resource-specific properties for this resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RetentionPolicy resource produces the following output properties:

    AzureApiVersion string
    The Azure API version of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the resource
    SystemData Pulumi.AzureNative.DurableTask.Outputs.SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    Type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    AzureApiVersion string
    The Azure API version of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the resource
    SystemData SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    Type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    azureApiVersion String
    The Azure API version of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the resource
    systemData SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    type String
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    azureApiVersion string
    The Azure API version of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the resource
    systemData SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    azure_api_version str
    The Azure API version of the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the resource
    system_data SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    type str
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    azureApiVersion String
    The Azure API version of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the resource
    systemData Property Map
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    type String
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

    Supporting Types

    PurgeableOrchestrationState, PurgeableOrchestrationStateArgs

    Completed
    CompletedThe orchestration is completed
    Failed
    FailedThe orchestration is failed
    Terminated
    TerminatedThe orchestration is terminated
    Canceled
    CanceledThe orchestration is canceled
    PurgeableOrchestrationStateCompleted
    CompletedThe orchestration is completed
    PurgeableOrchestrationStateFailed
    FailedThe orchestration is failed
    PurgeableOrchestrationStateTerminated
    TerminatedThe orchestration is terminated
    PurgeableOrchestrationStateCanceled
    CanceledThe orchestration is canceled
    Completed
    CompletedThe orchestration is completed
    Failed
    FailedThe orchestration is failed
    Terminated
    TerminatedThe orchestration is terminated
    Canceled
    CanceledThe orchestration is canceled
    Completed
    CompletedThe orchestration is completed
    Failed
    FailedThe orchestration is failed
    Terminated
    TerminatedThe orchestration is terminated
    Canceled
    CanceledThe orchestration is canceled
    COMPLETED
    CompletedThe orchestration is completed
    FAILED
    FailedThe orchestration is failed
    TERMINATED
    TerminatedThe orchestration is terminated
    CANCELED
    CanceledThe orchestration is canceled
    "Completed"
    CompletedThe orchestration is completed
    "Failed"
    FailedThe orchestration is failed
    "Terminated"
    TerminatedThe orchestration is terminated
    "Canceled"
    CanceledThe orchestration is canceled

    RetentionPolicyDetails, RetentionPolicyDetailsArgs

    RetentionPeriodInDays int
    The retention period in days after which the orchestration will be purged automatically
    OrchestrationState string | Pulumi.AzureNative.DurableTask.PurgeableOrchestrationState
    The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
    RetentionPeriodInDays int
    The retention period in days after which the orchestration will be purged automatically
    OrchestrationState string | PurgeableOrchestrationState
    The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
    retentionPeriodInDays Integer
    The retention period in days after which the orchestration will be purged automatically
    orchestrationState String | PurgeableOrchestrationState
    The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
    retentionPeriodInDays number
    The retention period in days after which the orchestration will be purged automatically
    orchestrationState string | PurgeableOrchestrationState
    The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
    retention_period_in_days int
    The retention period in days after which the orchestration will be purged automatically
    orchestration_state str | PurgeableOrchestrationState
    The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
    retentionPeriodInDays Number
    The retention period in days after which the orchestration will be purged automatically
    orchestrationState String | "Completed" | "Failed" | "Terminated" | "Canceled"
    The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.

    RetentionPolicyDetailsResponse, RetentionPolicyDetailsResponseArgs

    RetentionPeriodInDays int
    The retention period in days after which the orchestration will be purged automatically
    OrchestrationState string
    The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
    RetentionPeriodInDays int
    The retention period in days after which the orchestration will be purged automatically
    OrchestrationState string
    The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
    retentionPeriodInDays Integer
    The retention period in days after which the orchestration will be purged automatically
    orchestrationState String
    The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
    retentionPeriodInDays number
    The retention period in days after which the orchestration will be purged automatically
    orchestrationState string
    The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
    retention_period_in_days int
    The retention period in days after which the orchestration will be purged automatically
    orchestration_state str
    The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
    retentionPeriodInDays Number
    The retention period in days after which the orchestration will be purged automatically
    orchestrationState String
    The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.

    RetentionPolicyProperties, RetentionPolicyPropertiesArgs

    RetentionPolicies []RetentionPolicyDetails
    The orchestration retention policies
    retentionPolicies List<RetentionPolicyDetails>
    The orchestration retention policies
    retentionPolicies RetentionPolicyDetails[]
    The orchestration retention policies
    retention_policies Sequence[RetentionPolicyDetails]
    The orchestration retention policies
    retentionPolicies List<Property Map>
    The orchestration retention policies

    RetentionPolicyPropertiesResponse, RetentionPolicyPropertiesResponseArgs

    ProvisioningState string
    The status of the last operation
    RetentionPolicies List<Pulumi.AzureNative.DurableTask.Inputs.RetentionPolicyDetailsResponse>
    The orchestration retention policies
    ProvisioningState string
    The status of the last operation
    RetentionPolicies []RetentionPolicyDetailsResponse
    The orchestration retention policies
    provisioningState String
    The status of the last operation
    retentionPolicies List<RetentionPolicyDetailsResponse>
    The orchestration retention policies
    provisioningState string
    The status of the last operation
    retentionPolicies RetentionPolicyDetailsResponse[]
    The orchestration retention policies
    provisioning_state str
    The status of the last operation
    retention_policies Sequence[RetentionPolicyDetailsResponse]
    The orchestration retention policies
    provisioningState String
    The status of the last operation
    retentionPolicies List<Property Map>
    The orchestration retention policies

    SystemDataResponse, SystemDataResponseArgs

    CreatedAt string
    The timestamp of resource creation (UTC).
    CreatedBy string
    The identity that created the resource.
    CreatedByType string
    The type of identity that created the resource.
    LastModifiedAt string
    The timestamp of resource last modification (UTC)
    LastModifiedBy string
    The identity that last modified the resource.
    LastModifiedByType string
    The type of identity that last modified the resource.
    CreatedAt string
    The timestamp of resource creation (UTC).
    CreatedBy string
    The identity that created the resource.
    CreatedByType string
    The type of identity that created the resource.
    LastModifiedAt string
    The timestamp of resource last modification (UTC)
    LastModifiedBy string
    The identity that last modified the resource.
    LastModifiedByType string
    The type of identity that last modified the resource.
    createdAt String
    The timestamp of resource creation (UTC).
    createdBy String
    The identity that created the resource.
    createdByType String
    The type of identity that created the resource.
    lastModifiedAt String
    The timestamp of resource last modification (UTC)
    lastModifiedBy String
    The identity that last modified the resource.
    lastModifiedByType String
    The type of identity that last modified the resource.
    createdAt string
    The timestamp of resource creation (UTC).
    createdBy string
    The identity that created the resource.
    createdByType string
    The type of identity that created the resource.
    lastModifiedAt string
    The timestamp of resource last modification (UTC)
    lastModifiedBy string
    The identity that last modified the resource.
    lastModifiedByType string
    The type of identity that last modified the resource.
    created_at str
    The timestamp of resource creation (UTC).
    created_by str
    The identity that created the resource.
    created_by_type str
    The type of identity that created the resource.
    last_modified_at str
    The timestamp of resource last modification (UTC)
    last_modified_by str
    The identity that last modified the resource.
    last_modified_by_type str
    The type of identity that last modified the resource.
    createdAt String
    The timestamp of resource creation (UTC).
    createdBy String
    The identity that created the resource.
    createdByType String
    The type of identity that created the resource.
    lastModifiedAt String
    The timestamp of resource last modification (UTC)
    lastModifiedBy String
    The identity that last modified the resource.
    lastModifiedByType String
    The type of identity that last modified the resource.

    Import

    An existing resource can be imported using its type token, name, and identifier, e.g.

    $ pulumi import azure-native:durabletask:RetentionPolicy default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/retentionPolicies/default 
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
    Azure Native v3.3.0 published on Monday, Apr 28, 2025 by Pulumi