Skip to content

giuseppe-trisciuoglio/developer-kit / plugins/developer-kit-java/skills/aws-sdk-java-v2-secrets-manager

aws-sdk-java-v2-secrets-manager

Verified

Provides AWS Secrets Manager patterns for AWS SDK for Java 2.x, including secret retrieval, caching, rotation-aware access, and Spring Boot integration. Use when storing or reading secrets in Java services, replacing hardcoded credentials, or wiring secret-backed configuration into applications.

references/api-reference.md

View on GitHub
# AWS Secrets Manager API Reference

## Overview
AWS Secrets Manager provides a service to enable you to store, manage, and retrieve secrets with API version 2017-10-17.

## Core Classes

### SecretsManagerClient
- **Purpose**: Synchronous client for AWS Secrets Manager
- **Location**: `software.amazon.awssdk.services.secretsmanager.SecretsManagerClient`
- **Builder**: `SecretsManagerClient.builder()`

### SecretsManagerAsyncClient
- **Purpose**: Asynchronous client for AWS Secrets Manager
- **Location**: `software.amazon.awssdk.services.secretsmanager.SecretsManagerAsyncClient`
- **Builder**: `SecretsManagerAsyncClient.builder()`

## Configuration Classes

### SecretsManagerClientBuilder
- Methods:
  - `region(Region region)` - Set AWS region
  - `credentialsProvider(AwsCredentialsProvider credentialsProvider)` - Set credentials
  - `build()` - Create client instance

### SecretsManagerServiceClientConfiguration
- Service client settings and configuration

## Request Types

### CreateSecretRequest
- **Fields**:
  - `name(String name)` - Secret name (required)
  - `secretString(String secretString)` - Secret value
  - `secretBinary(SdkBytes secretBinary)` - Binary secret value
  - `description(String description)` - Secret description
  - `kmsKeyId(String kmsKeyId)` - KMS key for encryption
  - `tags(List<Tag> tags)` - Tags for organization

### GetSecretValueRequest
- **Fields**:
  - `secretId(String secretId)` - Secret name or ARN
  - `versionId(String versionId)` - Specific version ID
  - `versionStage(String versionStage)` - Version stage (e.g., "AWSCURRENT")

### UpdateSecretRequest
- **Fields**:
  - `secretId(String secretId)` - Secret name or ARN
  - `secretString(String secretString)` - New secret value
  - `secretBinary(SdkBytes secretBinary)` - New binary secret value
  - `kmsKeyId(String kmsKeyId)` - KMS key for encryption

### DeleteSecretRequest
- **Fields**:
  - `secretId(String secretId)` - Secret name or ARN
  - `recoveryWindowInDays(Long recoveryWindowInDays)` - Recovery period
  - `forceDeleteWithoutRecovery(Boolean forceDeleteWithoutRecovery)` - Immediate deletion

### RotateSecretRequest
- **Fields**:
  - `secretId(String secretId)` - Secret name or ARN
  - `rotationLambdaArn(String rotationLambdaArn)` - Lambda ARN for rotation
  - `rotationRules(RotationRulesType rotationRules)` - Rotation configuration
  - `rotationSchedule(RotationScheduleType rotationSchedule)` - Schedule configuration

## Response Types

### CreateSecretResponse
- **Fields**:
  - `arn()` - Secret ARN
  - `name()` - Secret name
  - `versionId()` - Version ID

### GetSecretValueResponse
- **Fields**:
  - `arn()` - Secret ARN
  - `name()` - Secret name
  - `versionId()` - Version ID
  - `secretString()` - Secret value as string
  - `secretBinary()` - Secret value as binary
  - `versionStages()` - Version stages

### UpdateSecretResponse
- **Fields**:
  - `arn()` - Secret ARN
  - `name()` - Secret name
  - `versionId()` - New version ID

### DeleteSecretResponse
- **Fields**:
  - `arn()` - Secret ARN
  - `name()` - Secret name
  - `deletionDate()` - Deletion date/time

### RotateSecretResponse
- **Fields**:
  - `arn()` - Secret ARN
  - `name()` - Secret name
  - `versionId()` - New version ID

## Paginated Operations

### ListSecretsRequest
- **Fields**:
  - `maxResults(Integer maxResults)` - Maximum results per page
  - `nextToken(String nextToken)` - Token for next page
  - `filter(String filter)` - Filter criteria

### ListSecretsResponse
- **Fields**:
  - `secretList()` - List of secrets
  - `nextToken()` - Token for next page

## Error Handling

### SecretsManagerException
- Common error codes:
  - `ResourceNotFoundException` - Secret not found
  - `InvalidParameterException` - Invalid parameters
  - `MalformedPolicyDocumentException` - Invalid policy document
  - `InternalServiceErrorException` - Internal service error
  - `InvalidRequestException` - Invalid request
  - `DecryptionFailure` - Decryption failed
  - `ResourceExistsException` - Resource already exists
  - `ResourceConflictException` - Resource conflict
  - `ValidationException` - Validation failed
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 466kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 193kUpdated Claude CodeCodexVerifiedInstall