azure-native.durabletask.RetentionPolicy
Explore with Pulumi AI
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:
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Scheduler
Name string - The name of the Scheduler
- Properties
Pulumi.
Azure Native. Durable Task. Inputs. Retention Policy Properties - The resource-specific properties for this resource.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Scheduler
Name string - The name of the Scheduler
- Properties
Retention
Policy Properties Args - The resource-specific properties for this resource.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- scheduler
Name String - The name of the Scheduler
- properties
Retention
Policy Properties - The resource-specific properties for this resource.
- resource
Group stringName - The name of the resource group. The name is case insensitive.
- scheduler
Name string - The name of the Scheduler
- properties
Retention
Policy Properties - The resource-specific properties for this resource.
- resource_
group_ strname - The name of the resource group. The name is case insensitive.
- scheduler_
name str - The name of the Scheduler
- properties
Retention
Policy Properties Args - The resource-specific properties for this resource.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- scheduler
Name 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:
- Azure
Api stringVersion - 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
- System
Data Pulumi.Azure Native. Durable Task. Outputs. System Data Response - 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 stringVersion - 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
- System
Data SystemData Response - 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 StringVersion - 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
- system
Data SystemData Response - 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 stringVersion - 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
- system
Data SystemData Response - 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_ strversion - 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 SystemData Response - 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"
- azure
Api StringVersion - 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
- system
Data 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
- Purgeable
Orchestration State Completed - CompletedThe orchestration is completed
- Purgeable
Orchestration State Failed - FailedThe orchestration is failed
- Purgeable
Orchestration State Terminated - TerminatedThe orchestration is terminated
- Purgeable
Orchestration State 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
- "Completed"
- CompletedThe orchestration is completed
- "Failed"
- FailedThe orchestration is failed
- "Terminated"
- TerminatedThe orchestration is terminated
- "Canceled"
- CanceledThe orchestration is canceled
RetentionPolicyDetails, RetentionPolicyDetailsArgs
- Retention
Period intIn Days - The retention period in days after which the orchestration will be purged automatically
- Orchestration
State string | Pulumi.Azure Native. Durable Task. Purgeable Orchestration State - The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
- Retention
Period intIn Days - The retention period in days after which the orchestration will be purged automatically
- Orchestration
State string | PurgeableOrchestration State - The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
- retention
Period IntegerIn Days - The retention period in days after which the orchestration will be purged automatically
- orchestration
State String | PurgeableOrchestration State - The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
- retention
Period numberIn Days - The retention period in days after which the orchestration will be purged automatically
- orchestration
State string | PurgeableOrchestration State - The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
- retention_
period_ intin_ days - The retention period in days after which the orchestration will be purged automatically
- orchestration_
state str | PurgeableOrchestration State - The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
- retention
Period NumberIn Days - The retention period in days after which the orchestration will be purged automatically
- orchestration
State 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
- Retention
Period intIn Days - The retention period in days after which the orchestration will be purged automatically
- Orchestration
State string - The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
- Retention
Period intIn Days - The retention period in days after which the orchestration will be purged automatically
- Orchestration
State string - The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
- retention
Period IntegerIn Days - The retention period in days after which the orchestration will be purged automatically
- orchestration
State String - The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
- retention
Period numberIn Days - The retention period in days after which the orchestration will be purged automatically
- orchestration
State string - The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
- retention_
period_ intin_ days - 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.
- retention
Period NumberIn Days - The retention period in days after which the orchestration will be purged automatically
- orchestration
State String - The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states.
RetentionPolicyProperties, RetentionPolicyPropertiesArgs
- Retention
Policies List<Pulumi.Azure Native. Durable Task. Inputs. Retention Policy Details> - The orchestration retention policies
- Retention
Policies []RetentionPolicy Details - The orchestration retention policies
- retention
Policies List<RetentionPolicy Details> - The orchestration retention policies
- retention
Policies RetentionPolicy Details[] - The orchestration retention policies
- retention_
policies Sequence[RetentionPolicy Details] - The orchestration retention policies
- retention
Policies List<Property Map> - The orchestration retention policies
RetentionPolicyPropertiesResponse, RetentionPolicyPropertiesResponseArgs
- Provisioning
State string - The status of the last operation
- Retention
Policies List<Pulumi.Azure Native. Durable Task. Inputs. Retention Policy Details Response> - The orchestration retention policies
- Provisioning
State string - The status of the last operation
- Retention
Policies []RetentionPolicy Details Response - The orchestration retention policies
- provisioning
State String - The status of the last operation
- retention
Policies List<RetentionPolicy Details Response> - The orchestration retention policies
- provisioning
State string - The status of the last operation
- retention
Policies RetentionPolicy Details Response[] - The orchestration retention policies
- provisioning_
state str - The status of the last operation
- retention_
policies Sequence[RetentionPolicy Details Response] - The orchestration retention policies
- provisioning
State String - The status of the last operation
- retention
Policies List<Property Map> - The orchestration retention policies
SystemDataResponse, SystemDataResponseArgs
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
- created
At string - The timestamp of resource creation (UTC).
- created
By string - The identity that created the resource.
- created
By stringType - The type of identity that created the resource.
- last
Modified stringAt - The timestamp of resource last modification (UTC)
- last
Modified stringBy - The identity that last modified the resource.
- last
Modified stringBy Type - 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_ strtype - The type of identity that created the resource.
- last_
modified_ strat - The timestamp of resource last modification (UTC)
- last_
modified_ strby - The identity that last modified the resource.
- last_
modified_ strby_ type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - 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