1. Packages
  2. AWS
  3. API Docs
  4. secretsmanager
  5. getSecretRotation
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.secretsmanager.getSecretRotation

Explore with Pulumi AI

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,
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.secretsmanager.get_secret_rotation(secret_id=example_aws_secretsmanager_secret["id"])
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/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
	})
}
Copy
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,
    });

});
Copy
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());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: aws:secretsmanager:getSecretRotation
      arguments:
        secretId: ${exampleAwsSecretsmanagerSecret.id}
Copy

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>
Copy
def get_secret_rotation(secret_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetSecretRotationResult
def get_secret_rotation_output(secret_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetSecretRotationResult]
Copy
func LookupSecretRotation(ctx *Context, args *LookupSecretRotationArgs, opts ...InvokeOption) (*LookupSecretRotationResult, error)
func LookupSecretRotationOutput(ctx *Context, args *LookupSecretRotationOutputArgs, opts ...InvokeOption) LookupSecretRotationResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetSecretRotationResult> getSecretRotation(GetSecretRotationArgs args, InvokeOptions options)
public static Output<GetSecretRotationResult> getSecretRotation(GetSecretRotationArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:secretsmanager/getSecretRotation:getSecretRotation
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

SecretId This property is required. 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.
SecretId This property is required. 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.
secretId This property is required. 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.
secretId This property is required. 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.
secret_id This property is required. 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.
secretId This property is required. 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.

getSecretRotation Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
RotationEnabled bool
ARN of the secret.
RotationLambdaArn string
Decrypted part of the protected secret information that was originally provided as a string.
RotationRules List<GetSecretRotationRotationRule>
Decrypted part of the protected secret information that was originally provided as a binary. Base64 encoded.
SecretId string
Id string
The provider-assigned unique ID for this managed resource.
RotationEnabled bool
ARN of the secret.
RotationLambdaArn string
Decrypted part of the protected secret information that was originally provided as a string.
RotationRules []GetSecretRotationRotationRule
Decrypted part of the protected secret information that was originally provided as a binary. Base64 encoded.
SecretId string
id String
The provider-assigned unique ID for this managed resource.
rotationEnabled Boolean
ARN of the secret.
rotationLambdaArn String
Decrypted part of the protected secret information that was originally provided as a string.
rotationRules List<GetSecretRotationRotationRule>
Decrypted part of the protected secret information that was originally provided as a binary. Base64 encoded.
secretId String
id string
The provider-assigned unique ID for this managed resource.
rotationEnabled boolean
ARN of the secret.
rotationLambdaArn string
Decrypted part of the protected secret information that was originally provided as a string.
rotationRules GetSecretRotationRotationRule[]
Decrypted part of the protected secret information that was originally provided as a binary. Base64 encoded.
secretId string
id str
The provider-assigned unique ID for this managed resource.
rotation_enabled bool
ARN of the secret.
rotation_lambda_arn str
Decrypted part of the protected secret information that was originally provided as a string.
rotation_rules Sequence[GetSecretRotationRotationRule]
Decrypted part of the protected secret information that was originally provided as a binary. Base64 encoded.
secret_id str
id String
The provider-assigned unique ID for this managed resource.
rotationEnabled Boolean
ARN of the secret.
rotationLambdaArn String
Decrypted part of the protected secret information that was originally provided as a string.
rotationRules List<Property Map>
Decrypted part of the protected secret information that was originally provided as a binary. Base64 encoded.
secretId String

Supporting Types

GetSecretRotationRotationRule

AutomaticallyAfterDays This property is required. int
Duration This property is required. string
ScheduleExpression This property is required. string
AutomaticallyAfterDays This property is required. int
Duration This property is required. string
ScheduleExpression This property is required. string
automaticallyAfterDays This property is required. Integer
duration This property is required. String
scheduleExpression This property is required. String
automaticallyAfterDays This property is required. number
duration This property is required. string
scheduleExpression This property is required. string
automatically_after_days This property is required. int
duration This property is required. str
schedule_expression This property is required. str
automaticallyAfterDays This property is required. Number
duration This property is required. String
scheduleExpression This property is required. String

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.