Interface SecretVersionInfo

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
SecretVersionInfo.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-06T23:25:18.741Z") @Stability(Experimental) public interface SecretVersionInfo extends software.amazon.jsii.JsiiSerializable
(experimental) Specify the secret's version id or version stage.

Example:

 import software.amazon.awscdk.services.secretsmanager.*;
 import software.amazon.awscdk.services.ssm.*;
 Stack stack;
 Secret secret = new Secret(stack, "Secret");
 IStringParameter parameter = StringParameter.fromSecureStringParameterAttributes(stack, "Parameter", SecureStringParameterAttributes.builder()
         .parameterName("/name")
         .version(1)
         .build());
 Service service = Service.Builder.create(stack, "Service")
         .source(Source.fromEcrPublic(EcrPublicProps.builder()
                 .imageConfiguration(ImageConfiguration.builder()
                         .port(8000)
                         .environmentSecrets(Map.of(
                                 "SECRET", Secret.fromSecretsManager(secret),
                                 "PARAMETER", Secret.fromSsmParameter(parameter),
                                 "SECRET_ID", Secret.fromSecretsManagerVersion(secret, SecretVersionInfo.builder().versionId("version-id").build()),
                                 "SECRET_STAGE", Secret.fromSecretsManagerVersion(secret, SecretVersionInfo.builder().versionStage("version-stage").build())))
                         .build())
                 .imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
                 .build()))
         .build();
 service.addSecret("LATER_SECRET", Secret.fromSecretsManager(secret, "field"));
 
  • Method Details

    • getVersionId

      @Stability(Experimental) @Nullable default String getVersionId()
      (experimental) version id of the secret.

      Default: - use default version id

    • getVersionStage

      @Stability(Experimental) @Nullable default String getVersionStage()
      (experimental) version stage of the secret.

      Default: - use default version stage

    • builder

      @Stability(Experimental) static SecretVersionInfo.Builder builder()
      Returns:
      a SecretVersionInfo.Builder of SecretVersionInfo