1. Packages
  2. AWS
  3. API Docs
  4. secretsmanager
  5. getSecretRotation
AWS v7.5.0 published on Wednesday, Aug 20, 2025 by Pulumi

aws.secretsmanager.getSecretRotation

Explore with Pulumi AI

aws logo
AWS v7.5.0 published on Wednesday, Aug 20, 2025 by Pulumi

    Retrieve information about a Secrets Manager secret rotation. To retrieve secret metadata, see the aws.secretsmanager.Secret data source. To retrieve a secret value, see the aws.secretsmanager.SecretVersion data source.

    Example Usage

    Retrieve Secret Rotation Configuration

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.secretsmanager.getSecretRotation({
        secretId: exampleAwsSecretsmanagerSecret.id,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.secretsmanager.get_secret_rotation(secret_id=example_aws_secretsmanager_secret["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/secretsmanager"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := secretsmanager.LookupSecretRotation(ctx, &secretsmanager.LookupSecretRotationArgs{
    			SecretId: exampleAwsSecretsmanagerSecret.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.SecretsManager.GetSecretRotation.Invoke(new()
        {
            SecretId = exampleAwsSecretsmanagerSecret.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.secretsmanager.SecretsmanagerFunctions;
    import com.pulumi.aws.secretsmanager.inputs.GetSecretRotationArgs;
    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) {
            final var example = SecretsmanagerFunctions.getSecretRotation(GetSecretRotationArgs.builder()
                .secretId(exampleAwsSecretsmanagerSecret.id())
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: aws:secretsmanager:getSecretRotation
          arguments:
            secretId: ${exampleAwsSecretsmanagerSecret.id}
    

    Using getSecretRotation

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getSecretRotation(args: GetSecretRotationArgs, opts?: InvokeOptions): Promise<GetSecretRotationResult>
    function getSecretRotationOutput(args: GetSecretRotationOutputArgs, opts?: InvokeOptions): Output<GetSecretRotationResult>
    def get_secret_rotation(region: Optional[str] = None,
                            secret_id: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetSecretRotationResult
    def get_secret_rotation_output(region: Optional[pulumi.Input[str]] = None,
                            secret_id: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetSecretRotationResult]
    func LookupSecretRotation(ctx *Context, args *LookupSecretRotationArgs, opts ...InvokeOption) (*LookupSecretRotationResult, error)
    func LookupSecretRotationOutput(ctx *Context, args *LookupSecretRotationOutputArgs, opts ...InvokeOption) LookupSecretRotationResultOutput

    > Note: This function is named LookupSecretRotation in the Go SDK.

    public static class GetSecretRotation 
    {
        public static Task<GetSecretRotationResult> InvokeAsync(GetSecretRotationArgs args, InvokeOptions? opts = null)
        public static Output<GetSecretRotationResult> Invoke(GetSecretRotationInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSecretRotationResult> getSecretRotation(GetSecretRotationArgs args, InvokeOptions options)
    public static Output<GetSecretRotationResult> getSecretRotation(GetSecretRotationArgs args, InvokeOptions options)
    
    fn::invoke:
      function: aws:secretsmanager/getSecretRotation:getSecretRotation
      arguments:
        # arguments dictionary

    The following arguments are supported:

    SecretId string
    Specifies the secret containing the version that you want to retrieve. You can specify either the ARN or the friendly name of the secret.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    SecretId string
    Specifies the secret containing the version that you want to retrieve. You can specify either the ARN or the friendly name of the secret.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    secretId String
    Specifies the secret containing the version that you want to retrieve. You can specify either the ARN or the friendly name of the secret.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    secretId string
    Specifies the secret containing the version that you want to retrieve. You can specify either the ARN or the friendly name of the secret.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    secret_id str
    Specifies the secret containing the version that you want to retrieve. You can specify either the ARN or the friendly name of the secret.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    secretId String
    Specifies the secret containing the version that you want to retrieve. You can specify either the ARN or the friendly name of the secret.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.

    getSecretRotation Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    RotationEnabled bool
    Specifies whether automatic rotation is enabled for this secret.
    RotationLambdaArn string
    Amazon Resource Name (ARN) of the lambda function used for rotation.
    RotationRules List<GetSecretRotationRotationRule>
    Configuration block for rotation rules. See rotation_rules below.
    SecretId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Region string
    RotationEnabled bool
    Specifies whether automatic rotation is enabled for this secret.
    RotationLambdaArn string
    Amazon Resource Name (ARN) of the lambda function used for rotation.
    RotationRules []GetSecretRotationRotationRule
    Configuration block for rotation rules. See rotation_rules below.
    SecretId string
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    rotationEnabled Boolean
    Specifies whether automatic rotation is enabled for this secret.
    rotationLambdaArn String
    Amazon Resource Name (ARN) of the lambda function used for rotation.
    rotationRules List<GetSecretRotationRotationRule>
    Configuration block for rotation rules. See rotation_rules below.
    secretId String
    id string
    The provider-assigned unique ID for this managed resource.
    region string
    rotationEnabled boolean
    Specifies whether automatic rotation is enabled for this secret.
    rotationLambdaArn string
    Amazon Resource Name (ARN) of the lambda function used for rotation.
    rotationRules GetSecretRotationRotationRule[]
    Configuration block for rotation rules. See rotation_rules below.
    secretId string
    id str
    The provider-assigned unique ID for this managed resource.
    region str
    rotation_enabled bool
    Specifies whether automatic rotation is enabled for this secret.
    rotation_lambda_arn str
    Amazon Resource Name (ARN) of the lambda function used for rotation.
    rotation_rules Sequence[GetSecretRotationRotationRule]
    Configuration block for rotation rules. See rotation_rules below.
    secret_id str
    id String
    The provider-assigned unique ID for this managed resource.
    region String
    rotationEnabled Boolean
    Specifies whether automatic rotation is enabled for this secret.
    rotationLambdaArn String
    Amazon Resource Name (ARN) of the lambda function used for rotation.
    rotationRules List<Property Map>
    Configuration block for rotation rules. See rotation_rules below.
    secretId String

    Supporting Types

    GetSecretRotationRotationRule

    AutomaticallyAfterDays int
    Number of days between automatic scheduled rotations of the secret.
    Duration string
    Length of the rotation window in hours.
    ScheduleExpression string
    A cron() or rate() expression that defines the schedule for rotating the secret.
    AutomaticallyAfterDays int
    Number of days between automatic scheduled rotations of the secret.
    Duration string
    Length of the rotation window in hours.
    ScheduleExpression string
    A cron() or rate() expression that defines the schedule for rotating the secret.
    automaticallyAfterDays Integer
    Number of days between automatic scheduled rotations of the secret.
    duration String
    Length of the rotation window in hours.
    scheduleExpression String
    A cron() or rate() expression that defines the schedule for rotating the secret.
    automaticallyAfterDays number
    Number of days between automatic scheduled rotations of the secret.
    duration string
    Length of the rotation window in hours.
    scheduleExpression string
    A cron() or rate() expression that defines the schedule for rotating the secret.
    automatically_after_days int
    Number of days between automatic scheduled rotations of the secret.
    duration str
    Length of the rotation window in hours.
    schedule_expression str
    A cron() or rate() expression that defines the schedule for rotating the secret.
    automaticallyAfterDays Number
    Number of days between automatic scheduled rotations of the secret.
    duration String
    Length of the rotation window in hours.
    scheduleExpression String
    A cron() or rate() expression that defines the schedule for rotating the secret.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v7.5.0 published on Wednesday, Aug 20, 2025 by Pulumi