@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:42.059Z") @Stability(value=Stable) public class SecretTargetAttachment extends Resource implements ISecretTargetAttachment, ISecret
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.secretsmanager.*;
Secret secret;
ISecretAttachmentTarget secretAttachmentTarget;
SecretTargetAttachment secretTargetAttachment = SecretTargetAttachment.Builder.create(this, "MySecretTargetAttachment")
.secret(secret)
.target(secretAttachmentTarget)
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
SecretTargetAttachment.Builder
A fluent builder for
SecretTargetAttachment. |
software.amazon.jsii.JsiiObject.InitializationModeISecretTargetAttachment.Jsii$Default, ISecretTargetAttachment.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
SecretTargetAttachment(software.constructs.Construct scope,
String id,
SecretTargetAttachmentProps props) |
protected |
SecretTargetAttachment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
SecretTargetAttachment(software.amazon.jsii.JsiiObjectRef objRef) |
| 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.
|
static ISecretTargetAttachment |
fromSecretTargetAttachmentSecretArn(software.constructs.Construct scope,
String id,
String secretTargetAttachmentSecretArn) |
protected String |
getArnForPolicies()
Provides an identifier for this secret for use in IAM policies.
|
protected Boolean |
getAutoCreatePolicy() |
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.
|
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.
|
String |
getSecretTargetAttachmentSecretArn()
Same as `secretArn`.
|
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 jsonField)
Interpret the secret as a JSON object and return a field's value from it as a `SecretValue`.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackprotected SecretTargetAttachment(software.amazon.jsii.JsiiObjectRef objRef)
protected SecretTargetAttachment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public SecretTargetAttachment(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
SecretTargetAttachmentProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public static ISecretTargetAttachment fromSecretTargetAttachmentSecretArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String secretTargetAttachmentSecretArn)
scope - This parameter is required.id - This parameter is required.secretTargetAttachmentSecretArn - This parameter is required.@Stability(value=Stable) @NotNull public RotationSchedule addRotationSchedule(@NotNull String id, @NotNull RotationScheduleOptions options)
addRotationSchedule in interface ISecretid - This parameter is required.options - This parameter is required.@Stability(value=Stable) @NotNull public 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.
addToResourcePolicy in interface ISecretstatement - This parameter is required.@Stability(value=Stable) @NotNull public ISecret attach(@NotNull ISecretAttachmentTarget target)
@Stability(value=Stable) public void denyAccountRootDelete()
denyAccountRootDelete in interface ISecret@Stability(value=Stable) @NotNull public Grant grantRead(@NotNull IGrantable grantee, @Nullable List<String> versionStages)
@Stability(value=Stable) @NotNull public Grant grantRead(@NotNull IGrantable grantee)
@Stability(value=Stable) @NotNull public Grant grantWrite(@NotNull IGrantable grantee)
grantWrite in interface ISecretgrantee - This parameter is required.@Stability(value=Stable) @NotNull public SecretValue secretValueFromJson(@NotNull String jsonField)
secretValueFromJson in interface ISecretjsonField - This parameter is required.@Stability(value=Stable) @NotNull protected String getArnForPolicies()
If there is a full ARN, this is just the ARN; if we have a partial ARN -- due to either importing by secret name or partial ARN -- then we need to add a suffix to capture the full ARN's format.
@Stability(value=Stable) @NotNull protected Boolean getAutoCreatePolicy()
@Stability(value=Stable) @NotNull public 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.
getSecretArn in interface ISecret@Stability(value=Stable) @NotNull public 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.
getSecretName in interface ISecret@Stability(value=Stable) @NotNull public String getSecretTargetAttachmentSecretArn()
getSecretTargetAttachmentSecretArn in interface ISecretTargetAttachment@Stability(value=Stable) @NotNull public SecretValue getSecretValue()
getSecretValue in interface ISecret@Stability(value=Stable) @Nullable public IKey getEncryptionKey()
When not specified, the default KMS key for the account and region is being used.
getEncryptionKey in interface ISecret@Stability(value=Stable) @Nullable public 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).
getSecretFullArn in interface ISecretCopyright © 2022. All rights reserved.