@Generated(value="jsii-pacmak/1.30.0 (build adae23f)", date="2021-06-30T10:01:38.269Z") @Stability(value=Experimental) 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)
(experimental) Adds a rotation schedule to the secret.
|
AddToResourcePolicyResult |
addToResourcePolicy(PolicyStatement statement)
(experimental) Adds a statement to the IAM resource policy associated with this secret.
|
ISecret |
attach(ISecretAttachmentTarget target)
(experimental) Attach a target to this secret.
|
void |
denyAccountRootDelete()
(experimental) Denies the `DeleteSecret` action to all principals within the current account.
|
default IKey |
getEncryptionKey()
(experimental) The customer-managed encryption key that is used to encrypt this secret, if any.
|
String |
getSecretArn()
(experimental) The ARN of the secret in AWS Secrets Manager.
|
default String |
getSecretFullArn()
(experimental) The full ARN of the secret in AWS Secrets Manager, which is the ARN including the Secrets Manager-supplied 6-character suffix.
|
String |
getSecretName()
(experimental) The name of the secret.
|
SecretValue |
getSecretValue()
(experimental) Retrieve the value of the stored secret as a `SecretValue`.
|
Grant |
grantRead(IGrantable grantee)
(experimental) Grants reading the secret value to some role.
|
Grant |
grantRead(IGrantable grantee,
List<String> versionStages)
(experimental) Grants reading the secret value to some role.
|
Grant |
grantWrite(IGrantable grantee)
(experimental) Grants writing and updating the secret value to some role.
|
SecretValue |
secretValueFromJson(String key)
(experimental) Interpret the secret as a JSON object and return a field's value from it as a `SecretValue`.
|
@Stability(value=Experimental) @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=Experimental) @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=Experimental) @NotNull SecretValue getSecretValue()
@Stability(value=Experimental) @Nullable default IKey getEncryptionKey()
When not specified, the default KMS key for the account and region is being used.
@Stability(value=Experimental) @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=Experimental) @NotNull RotationSchedule addRotationSchedule(@NotNull String id, @NotNull RotationScheduleOptions options)
id
- This parameter is required.options
- This parameter is required.@Stability(value=Experimental) @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=Experimental) @NotNull ISecret attach(@NotNull ISecretAttachmentTarget target)
target
- The target to attach. This parameter is required.@Stability(value=Experimental) void denyAccountRootDelete()
@Stability(value=Experimental) @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=Experimental) @NotNull Grant grantRead(@NotNull IGrantable grantee)
grantee
- the principal being granted permission. This parameter is required.@Stability(value=Experimental) @NotNull Grant grantWrite(@NotNull IGrantable grantee)
grantee
- the principal being granted permission. This parameter is required.@Stability(value=Experimental) @NotNull SecretValue secretValueFromJson(@NotNull String key)
key
- This parameter is required.Copyright © 2021. All rights reserved.