@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.743Z") @Stability(value=Stable) public abstract class Secret extends software.amazon.jsii.JsiiObject
Example:
Secret secret;
StringParameter parameter;
Ec2TaskDefinition taskDefinition = new Ec2TaskDefinition(this, "TaskDef");
taskDefinition.addContainer("TheContainer", ContainerDefinitionOptions.builder()
.image(ContainerImage.fromRegistry("example-image"))
.memoryLimitMiB(256)
.logging(LogDrivers.firelens(FireLensLogDriverProps.builder()
.options(Map.of())
.secretOptions(Map.of( // Retrieved from AWS Secrets Manager or AWS Systems Manager Parameter Store
"apikey", Secret.fromSecretsManager(secret),
"host", Secret.fromSsmParameter(parameter)))
.build()))
.build());
| Modifier | Constructor and Description |
|---|---|
protected |
Secret() |
protected |
Secret(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Secret(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static Secret |
fromSecretsManager(ISecret secret)
Creates a environment variable value from a secret stored in AWS Secrets Manager.
|
static Secret |
fromSecretsManager(ISecret secret,
String field)
Creates a environment variable value from a secret stored in AWS Secrets Manager.
|
static Secret |
fromSecretsManagerVersion(ISecret secret,
SecretVersionInfo versionInfo)
Creates a environment variable value from a secret stored in AWS Secrets Manager.
|
static Secret |
fromSecretsManagerVersion(ISecret secret,
SecretVersionInfo versionInfo,
String field)
Creates a environment variable value from a secret stored in AWS Secrets Manager.
|
static Secret |
fromSsmParameter(IParameter parameter)
Creates an environment variable value from a parameter stored in AWS Systems Manager Parameter Store.
|
abstract String |
getArn()
The ARN of the secret.
|
abstract Boolean |
getHasField()
Whether this secret uses a specific JSON field.
|
abstract Grant |
grantRead(IGrantable grantee)
Grants reading the secret to a principal.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Secret(software.amazon.jsii.JsiiObjectRef objRef)
protected Secret(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) protected Secret()
@Stability(value=Stable) @NotNull public static Secret fromSecretsManager(@NotNull ISecret secret, @Nullable String field)
secret - the secret stored in AWS Secrets Manager. This parameter is required.field - the name of the field with the value that you want to set as the environment variable value.@Stability(value=Stable) @NotNull public static Secret fromSecretsManager(@NotNull ISecret secret)
secret - the secret stored in AWS Secrets Manager. This parameter is required.@Stability(value=Stable) @NotNull public static Secret fromSecretsManagerVersion(@NotNull ISecret secret, @NotNull SecretVersionInfo versionInfo, @Nullable String field)
secret - the secret stored in AWS Secrets Manager. This parameter is required.versionInfo - the version information to reference the secret. This parameter is required.field - the name of the field with the value that you want to set as the environment variable value.@Stability(value=Stable) @NotNull public static Secret fromSecretsManagerVersion(@NotNull ISecret secret, @NotNull SecretVersionInfo versionInfo)
secret - the secret stored in AWS Secrets Manager. This parameter is required.versionInfo - the version information to reference the secret. This parameter is required.@Stability(value=Stable) @NotNull public static Secret fromSsmParameter(@NotNull IParameter parameter)
parameter - This parameter is required.@Stability(value=Stable) @NotNull public abstract Grant grantRead(@NotNull IGrantable grantee)
grantee - This parameter is required.@Stability(value=Stable) @NotNull public abstract String getArn()
@Stability(value=Stable) @Nullable public abstract Boolean getHasField()
Copyright © 2022. All rights reserved.