@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:42.031Z") @Stability(value=Stable) public interface ISecret extends software.amazon.jsii.JsiiSerializable, IResource
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ISecret.Jsii$Default
Internal default implementation for
ISecret. |
static class |
ISecret.Jsii$Proxy
A proxy class which represents a concrete javascript instance of this type.
|
| Modifier and Type | Method and Description |
|---|---|
RotationSchedule |
addRotationSchedule(String id,
RotationScheduleOptions options)
Adds a rotation schedule to the secret.
|
AddToResourcePolicyResult |
addToResourcePolicy(PolicyStatement statement)
Adds a statement to the IAM resource policy associated with this secret.
|
ISecret |
attach(ISecretAttachmentTarget target)
Attach a target to this secret.
|
void |
denyAccountRootDelete()
Denies the `DeleteSecret` action to all principals within the current account.
|
default IKey |
getEncryptionKey()
The customer-managed encryption key that is used to encrypt this secret, if any.
|
String |
getSecretArn()
The ARN of the secret in AWS Secrets Manager.
|
default String |
getSecretFullArn()
The full ARN of the secret in AWS Secrets Manager, which is the ARN including the Secrets Manager-supplied 6-character suffix.
|
String |
getSecretName()
The name of the secret.
|
SecretValue |
getSecretValue()
Retrieve the value of the stored secret as a `SecretValue`.
|
Grant |
grantRead(IGrantable grantee)
Grants reading the secret value to some role.
|
Grant |
grantRead(IGrantable grantee,
List<String> versionStages)
Grants reading the secret value to some role.
|
Grant |
grantWrite(IGrantable grantee)
Grants writing and updating the secret value to some role.
|
SecretValue |
secretValueFromJson(String key)
Interpret the secret as a JSON object and return a field's value from it as a `SecretValue`.
|
applyRemovalPolicy, getEnv, getStack@Stability(value=Stable) @NotNull String getSecretArn()
Will return the full ARN if available, otherwise a partial arn.
For secrets imported by the deprecated fromSecretName, it will return the secretName.
@Stability(value=Stable) @NotNull String getSecretName()
For "owned" secrets, this will be the full resource name (secret name + suffix), unless the '@aws-cdk/aws-secretsmanager:parseOwnedSecretName' feature flag is set.
@Stability(value=Stable) @NotNull SecretValue getSecretValue()
@Stability(value=Stable) @Nullable default IKey getEncryptionKey()
When not specified, the default KMS key for the account and region is being used.
@Stability(value=Stable) @Nullable default String getSecretFullArn()
This is equal to secretArn in most cases, but is undefined when a full ARN is not available (e.g., secrets imported by name).
@Stability(value=Stable) @NotNull RotationSchedule addRotationSchedule(@NotNull String id, @NotNull RotationScheduleOptions options)
id - This parameter is required.options - This parameter is required.@Stability(value=Stable) @NotNull AddToResourcePolicyResult addToResourcePolicy(@NotNull PolicyStatement statement)
If this secret was created in this stack, a resource policy will be
automatically created upon the first call to addToResourcePolicy. If
the secret is imported, then this is a no-op.
statement - This parameter is required.@Stability(value=Stable) @NotNull ISecret attach(@NotNull ISecretAttachmentTarget target)
target - The target to attach. This parameter is required.@Stability(value=Stable) void denyAccountRootDelete()
@Stability(value=Stable) @NotNull Grant grantRead(@NotNull IGrantable grantee, @Nullable List<String> versionStages)
grantee - the principal being granted permission. This parameter is required.versionStages - the version stages the grant is limited to.@Stability(value=Stable) @NotNull Grant grantRead(@NotNull IGrantable grantee)
grantee - the principal being granted permission. This parameter is required.@Stability(value=Stable) @NotNull Grant grantWrite(@NotNull IGrantable grantee)
grantee - the principal being granted permission. This parameter is required.@Stability(value=Stable) @NotNull SecretValue secretValueFromJson(@NotNull String key)
key - This parameter is required.Copyright © 2022. All rights reserved.