SecretVersionInfo

class aws_cdk.aws_apprunner_alpha.SecretVersionInfo(*, version_id=None, version_stage=None)

Bases: object

(experimental) Specify the secret’s version id or version stage.

Parameters:
  • version_id (Optional[str]) – (experimental) version id of the secret. Default: - use default version id

  • version_stage (Optional[str]) – (experimental) version stage of the secret. Default: - use default version stage

Stability:

experimental

ExampleMetadata:

infused

Example:

import aws_cdk.aws_secretsmanager as secretsmanager
import aws_cdk.aws_ssm as ssm

# stack: Stack


secret = secretsmanager.Secret(stack, "Secret")
parameter = ssm.StringParameter.from_secure_string_parameter_attributes(stack, "Parameter",
    parameter_name="/name",
    version=1
)

service = apprunner.Service(stack, "Service",
    source=apprunner.Source.from_ecr_public(
        image_configuration=apprunner.ImageConfiguration(
            port=8000,
            environment_secrets={
                "SECRET": apprunner.Secret.from_secrets_manager(secret),
                "PARAMETER": apprunner.Secret.from_ssm_parameter(parameter),
                "SECRET_ID": apprunner.Secret.from_secrets_manager_version(secret, version_id="version-id"),
                "SECRET_STAGE": apprunner.Secret.from_secrets_manager_version(secret, version_stage="version-stage")
            }
        ),
        image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
    )
)

service.add_secret("LATER_SECRET", apprunner.Secret.from_secrets_manager(secret, "field"))

Attributes

version_id

(experimental) version id of the secret.

Default:
  • use default version id

Stability:

experimental

version_stage

(experimental) version stage of the secret.

Default:
  • use default version stage

Stability:

experimental