Secret Rotation
Provides a resource to manage AWS Secrets Manager secret rotation. To manage a secret, see the aws.secretsmanager.Secret
resource. To manage a secret value, see the aws.secretsmanager.SecretVersion
resource.
Example Usage
Basic
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.secretsmanager.SecretRotation;
import com.pulumi.aws.secretsmanager.SecretRotationArgs;
import com.pulumi.aws.secretsmanager.inputs.SecretRotationRotationRulesArgs;
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 example = new SecretRotation("example", SecretRotationArgs.builder()
.secretId(aws_secretsmanager_secret.example().id())
.rotationLambdaArn(aws_lambda_function.example().arn())
.rotationRules(SecretRotationRotationRulesArgs.builder()
.automaticallyAfterDays(30)
.build())
.build());
}
}
Content copied to clipboard
Import
Using pulumi import
, import aws_secretsmanager_secret_rotation
using the secret Amazon Resource Name (ARN). For example:
$ pulumi import aws:secretsmanager/secretRotation:SecretRotation example arn:aws:secretsmanager:us-east-1:123456789012:secret:example-123456
Content copied to clipboard