AWS Classic
getSecretRotation
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
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Aws.SecretsManager.GetSecretRotation.InvokeAsync(new Aws.SecretsManager.GetSecretRotationArgs
{
SecretId = data.Aws_secretsmanager_secret.Example.Id,
}));
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/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: data.Aws_secretsmanager_secret.Example.Id,
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = Output.of(SecretsmanagerFunctions.getSecretRotation(GetSecretRotationArgs.builder()
.secretId(data.aws_secretsmanager_secret().example().id())
.build()));
}
}
import pulumi
import pulumi_aws as aws
example = aws.secretsmanager.get_secret_rotation(secret_id=data["aws_secretsmanager_secret"]["example"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.secretsmanager.getSecretRotation({
secretId: data.aws_secretsmanager_secret.example.id,
});
variables:
example:
Fn::Invoke:
Function: aws:secretsmanager:getSecretRotation
Arguments:
secretId: ${data.aws_secretsmanager_secret.example.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(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]
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)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: aws:secretsmanager/getSecretRotation:getSecretRotation
Arguments:
# Arguments dictionary
The following arguments are supported:
- Secret
Id string Specifies the secret containing the version that you want to retrieve. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.
- Secret
Id string Specifies the secret containing the version that you want to retrieve. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.
- secret
Id String Specifies the secret containing the version that you want to retrieve. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.
- secret
Id string Specifies the secret containing the version that you want to retrieve. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.
- secret_
id str Specifies the secret containing the version that you want to retrieve. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.
- secret
Id String Specifies the secret containing the version that you want to retrieve. You can specify either the Amazon Resource Name (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.
- Rotation
Enabled bool The ARN of the secret.
- Rotation
Lambda stringArn The decrypted part of the protected secret information that was originally provided as a string.
- Rotation
Rules List<GetSecret Rotation Rotation Rule> The decrypted part of the protected secret information that was originally provided as a binary. Base64 encoded.
- Secret
Id string
- Id string
The provider-assigned unique ID for this managed resource.
- Rotation
Enabled bool The ARN of the secret.
- Rotation
Lambda stringArn The decrypted part of the protected secret information that was originally provided as a string.
- Rotation
Rules []GetSecret Rotation Rotation Rule The decrypted part of the protected secret information that was originally provided as a binary. Base64 encoded.
- Secret
Id string
- id String
The provider-assigned unique ID for this managed resource.
- rotation
Enabled Boolean The ARN of the secret.
- rotation
Lambda StringArn The decrypted part of the protected secret information that was originally provided as a string.
- rotation
Rules List<GetSecret Rotation Rotation Rule> The decrypted part of the protected secret information that was originally provided as a binary. Base64 encoded.
- secret
Id String
- id string
The provider-assigned unique ID for this managed resource.
- rotation
Enabled boolean The ARN of the secret.
- rotation
Lambda stringArn The decrypted part of the protected secret information that was originally provided as a string.
- rotation
Rules GetSecret Rotation Rotation Rule[] The decrypted part of the protected secret information that was originally provided as a binary. Base64 encoded.
- secret
Id string
- id str
The provider-assigned unique ID for this managed resource.
- rotation_
enabled bool The ARN of the secret.
- rotation_
lambda_ strarn The decrypted part of the protected secret information that was originally provided as a string.
- rotation_
rules Sequence[GetSecret Rotation Rotation Rule] The 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.
- rotation
Enabled Boolean The ARN of the secret.
- rotation
Lambda StringArn The decrypted part of the protected secret information that was originally provided as a string.
- rotation
Rules List<Property Map> The decrypted part of the protected secret information that was originally provided as a binary. Base64 encoded.
- secret
Id String
Supporting Types
GetSecretRotationRotationRule
- automatically
After IntegerDays
- automatically
After numberDays
- automatically
After NumberDays
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.