1. Packages
  2. Packages
  3. HashiCorp Vault Provider
  4. API Docs
  5. RotationPolicy
Viewing docs for HashiCorp Vault v7.11.0
published on Wednesday, Jul 22, 2026 by Pulumi
vault logo vault logo
Viewing docs for HashiCorp Vault v7.11.0
published on Wednesday, Jul 22, 2026 by Pulumi

    Provides a resource to manage Rotation Policies.

    Note this feature is available only in Vault Enterprise 2.0+.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vault from "@pulumi/vault";
    
    const example = new vault.RotationPolicy("example", {
        name: "database-admin-retry-policy",
        maxRetriesPerCycle: 6,
        maxRetryCycles: 3,
    });
    
    import pulumi
    import pulumi_vault as vault
    
    example = vault.RotationPolicy("example",
        name="database-admin-retry-policy",
        max_retries_per_cycle=6,
        max_retry_cycles=3)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-vault/sdk/v7/go/vault"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vault.NewRotationPolicy(ctx, "example", &vault.RotationPolicyArgs{
    			Name:               pulumi.String("database-admin-retry-policy"),
    			MaxRetriesPerCycle: pulumi.Int(6),
    			MaxRetryCycles:     pulumi.Int(3),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Vault.RotationPolicy("example", new()
        {
            Name = "database-admin-retry-policy",
            MaxRetriesPerCycle = 6,
            MaxRetryCycles = 3,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vault.RotationPolicy;
    import com.pulumi.vault.RotationPolicyArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 example = new RotationPolicy("example", RotationPolicyArgs.builder()
                .name("database-admin-retry-policy")
                .maxRetriesPerCycle(6)
                .maxRetryCycles(3)
                .build());
    
        }
    }
    
    resources:
      example:
        type: vault:RotationPolicy
        properties:
          name: database-admin-retry-policy
          maxRetriesPerCycle: 6
          maxRetryCycles: 3
    
    pulumi {
      required_providers {
        vault = {
          source = "pulumi/vault"
        }
      }
    }
    
    resource "vault_rotationpolicy" "example" {
      name                  = "database-admin-retry-policy"
      max_retries_per_cycle = 6
      max_retry_cycles      = 3
    }
    

    Create RotationPolicy Resource

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

    Constructor syntax

    new RotationPolicy(name: string, args: RotationPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def RotationPolicy(resource_name: str,
                       args: RotationPolicyArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def RotationPolicy(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       max_retries_per_cycle: Optional[int] = None,
                       max_retry_cycles: Optional[int] = None,
                       name: Optional[str] = None,
                       namespace: Optional[str] = None)
    func NewRotationPolicy(ctx *Context, name string, args RotationPolicyArgs, opts ...ResourceOption) (*RotationPolicy, error)
    public RotationPolicy(string name, RotationPolicyArgs args, CustomResourceOptions? opts = null)
    public RotationPolicy(String name, RotationPolicyArgs args)
    public RotationPolicy(String name, RotationPolicyArgs args, CustomResourceOptions options)
    
    type: vault:RotationPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "vault_rotation_policy" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args RotationPolicyArgs
    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 RotationPolicyArgs
    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 RotationPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RotationPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RotationPolicyArgs
    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 rotationPolicyResource = new Vault.RotationPolicy("rotationPolicyResource", new()
    {
        MaxRetriesPerCycle = 0,
        MaxRetryCycles = 0,
        Name = "string",
        Namespace = "string",
    });
    
    example, err := vault.NewRotationPolicy(ctx, "rotationPolicyResource", &vault.RotationPolicyArgs{
    	MaxRetriesPerCycle: pulumi.Int(0),
    	MaxRetryCycles:     pulumi.Int(0),
    	Name:               pulumi.String("string"),
    	Namespace:          pulumi.String("string"),
    })
    
    resource "vault_rotation_policy" "rotationPolicyResource" {
      lifecycle {
        create_before_destroy = true
      }
      max_retries_per_cycle = 0
      max_retry_cycles      = 0
      name                  = "string"
      namespace             = "string"
    }
    
    var rotationPolicyResource = new RotationPolicy("rotationPolicyResource", RotationPolicyArgs.builder()
        .maxRetriesPerCycle(0)
        .maxRetryCycles(0)
        .name("string")
        .namespace("string")
        .build());
    
    rotation_policy_resource = vault.RotationPolicy("rotationPolicyResource",
        max_retries_per_cycle=0,
        max_retry_cycles=0,
        name="string",
        namespace="string")
    
    const rotationPolicyResource = new vault.RotationPolicy("rotationPolicyResource", {
        maxRetriesPerCycle: 0,
        maxRetryCycles: 0,
        name: "string",
        namespace: "string",
    });
    
    type: vault:RotationPolicy
    properties:
        maxRetriesPerCycle: 0
        maxRetryCycles: 0
        name: string
        namespace: string
    

    RotationPolicy 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 RotationPolicy resource accepts the following input properties:

    MaxRetriesPerCycle int
    Maximum retries per cycle for this rotation policy.
    MaxRetryCycles int
    Maximum retry cycles for this rotation policy.
    Name string
    The name of the rotation policy.
    Namespace string
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    MaxRetriesPerCycle int
    Maximum retries per cycle for this rotation policy.
    MaxRetryCycles int
    Maximum retry cycles for this rotation policy.
    Name string
    The name of the rotation policy.
    Namespace string
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    max_retries_per_cycle number
    Maximum retries per cycle for this rotation policy.
    max_retry_cycles number
    Maximum retry cycles for this rotation policy.
    name string
    The name of the rotation policy.
    namespace string
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    maxRetriesPerCycle Integer
    Maximum retries per cycle for this rotation policy.
    maxRetryCycles Integer
    Maximum retry cycles for this rotation policy.
    name String
    The name of the rotation policy.
    namespace String
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    maxRetriesPerCycle number
    Maximum retries per cycle for this rotation policy.
    maxRetryCycles number
    Maximum retry cycles for this rotation policy.
    name string
    The name of the rotation policy.
    namespace string
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    max_retries_per_cycle int
    Maximum retries per cycle for this rotation policy.
    max_retry_cycles int
    Maximum retry cycles for this rotation policy.
    name str
    The name of the rotation policy.
    namespace str
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    maxRetriesPerCycle Number
    Maximum retries per cycle for this rotation policy.
    maxRetryCycles Number
    Maximum retry cycles for this rotation policy.
    name String
    The name of the rotation policy.
    namespace String
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing RotationPolicy Resource

    Get an existing RotationPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: RotationPolicyState, opts?: CustomResourceOptions): RotationPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            max_retries_per_cycle: Optional[int] = None,
            max_retry_cycles: Optional[int] = None,
            name: Optional[str] = None,
            namespace: Optional[str] = None) -> RotationPolicy
    func GetRotationPolicy(ctx *Context, name string, id IDInput, state *RotationPolicyState, opts ...ResourceOption) (*RotationPolicy, error)
    public static RotationPolicy Get(string name, Input<string> id, RotationPolicyState? state, CustomResourceOptions? opts = null)
    public static RotationPolicy get(String name, Output<String> id, RotationPolicyState state, CustomResourceOptions options)
    resources:  _:    type: vault:RotationPolicy    get:      id: ${id}
    import {
      to = vault_rotation_policy.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    MaxRetriesPerCycle int
    Maximum retries per cycle for this rotation policy.
    MaxRetryCycles int
    Maximum retry cycles for this rotation policy.
    Name string
    The name of the rotation policy.
    Namespace string
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    MaxRetriesPerCycle int
    Maximum retries per cycle for this rotation policy.
    MaxRetryCycles int
    Maximum retry cycles for this rotation policy.
    Name string
    The name of the rotation policy.
    Namespace string
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    max_retries_per_cycle number
    Maximum retries per cycle for this rotation policy.
    max_retry_cycles number
    Maximum retry cycles for this rotation policy.
    name string
    The name of the rotation policy.
    namespace string
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    maxRetriesPerCycle Integer
    Maximum retries per cycle for this rotation policy.
    maxRetryCycles Integer
    Maximum retry cycles for this rotation policy.
    name String
    The name of the rotation policy.
    namespace String
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    maxRetriesPerCycle number
    Maximum retries per cycle for this rotation policy.
    maxRetryCycles number
    Maximum retry cycles for this rotation policy.
    name string
    The name of the rotation policy.
    namespace string
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    max_retries_per_cycle int
    Maximum retries per cycle for this rotation policy.
    max_retry_cycles int
    Maximum retry cycles for this rotation policy.
    name str
    The name of the rotation policy.
    namespace str
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
    maxRetriesPerCycle Number
    Maximum retries per cycle for this rotation policy.
    maxRetryCycles Number
    Maximum retry cycles for this rotation policy.
    name String
    The name of the rotation policy.
    namespace String
    The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.

    Import

    Rotation policies can be imported using the name, e.g.

    $ pulumi import vault:index/rotationPolicy:RotationPolicy example database-admin-retry-policy
    

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

    Package Details

    Repository
    Vault pulumi/pulumi-vault
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vault Terraform Provider.
    vault logo vault logo
    Viewing docs for HashiCorp Vault v7.11.0
    published on Wednesday, Jul 22, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial