
software.amazon.awscdk.services.secretsmanager.ISecret Maven / Gradle / Ivy
package software.amazon.awscdk.services.secretsmanager;
/**
* A secret in AWS Secrets Manager.
*/
@javax.annotation.Generated(value = "jsii-pacmak/0.22.0 (build 14afdde)", date = "2020-03-03T11:43:14.070Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.secretsmanager.$Module.class, fqn = "@aws-cdk/aws-secretsmanager.ISecret")
@software.amazon.jsii.Jsii.Proxy(ISecret.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface ISecret extends software.amazon.jsii.JsiiSerializable, software.amazon.awscdk.core.IResource {
/**
* The ARN of the secret in AWS Secrets Manager.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
java.lang.String getSecretArn();
/**
* Retrieve the value of the stored secret as a `SecretValue`.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
software.amazon.awscdk.core.SecretValue getSecretValue();
/**
* The customer-managed encryption key that is used to encrypt this secret, if any.
*
* When not specified, the default
* KMS key for the account and region is being used.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default software.amazon.awscdk.services.kms.IKey getEncryptionKey() {
return null;
}
/**
* Adds a rotation schedule to the secret.
*
* @param id This parameter is required.
* @param options This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
software.amazon.awscdk.services.secretsmanager.RotationSchedule addRotationSchedule(final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.secretsmanager.RotationScheduleOptions options);
/**
* Adds a statement to the IAM resource policy associated with this secret.
*
* 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.
*
* @param statement This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
void addToResourcePolicy(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iam.PolicyStatement statement);
/**
* Denies the `DeleteSecret` action to all principals within the current account.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
void denyAccountRootDelete();
/**
* Grants reading the secret value to some role.
*
* @param grantee the principal being granted permission. This parameter is required.
* @param versionStages the version stages the grant is limited to.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
software.amazon.awscdk.services.iam.Grant grantRead(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iam.IGrantable grantee, final @org.jetbrains.annotations.Nullable java.util.List versionStages);
/**
* Grants reading the secret value to some role.
*
* @param grantee the principal being granted permission. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
software.amazon.awscdk.services.iam.Grant grantRead(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iam.IGrantable grantee);
/**
* Interpret the secret as a JSON object and return a field's value from it as a `SecretValue`.
*
* @param key This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
software.amazon.awscdk.core.SecretValue secretValueFromJson(final @org.jetbrains.annotations.NotNull java.lang.String key);
/**
* A proxy class which represents a concrete javascript instance of this type.
*/
final static class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.services.secretsmanager.ISecret {
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
/**
* The ARN of the secret in AWS Secrets Manager.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.String getSecretArn() {
return this.jsiiGet("secretArn", java.lang.String.class);
}
/**
* Retrieve the value of the stored secret as a `SecretValue`.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.SecretValue getSecretValue() {
return this.jsiiGet("secretValue", software.amazon.awscdk.core.SecretValue.class);
}
/**
* The customer-managed encryption key that is used to encrypt this secret, if any.
*
* When not specified, the default
* KMS key for the account and region is being used.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.kms.IKey getEncryptionKey() {
return this.jsiiGet("encryptionKey", software.amazon.awscdk.services.kms.IKey.class);
}
/**
* The stack in which this resource is defined.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.Stack getStack() {
return this.jsiiGet("stack", software.amazon.awscdk.core.Stack.class);
}
/**
* The construct node in the tree.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.ConstructNode getNode() {
return this.jsiiGet("node", software.amazon.awscdk.core.ConstructNode.class);
}
/**
* Adds a rotation schedule to the secret.
*
* @param id This parameter is required.
* @param options This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.secretsmanager.RotationSchedule addRotationSchedule(final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.secretsmanager.RotationScheduleOptions options) {
return this.jsiiCall("addRotationSchedule", software.amazon.awscdk.services.secretsmanager.RotationSchedule.class, new Object[] { java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(options, "options is required") });
}
/**
* Adds a statement to the IAM resource policy associated with this secret.
*
* 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.
*
* @param statement This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public void addToResourcePolicy(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iam.PolicyStatement statement) {
this.jsiiCall("addToResourcePolicy", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(statement, "statement is required") });
}
/**
* Denies the `DeleteSecret` action to all principals within the current account.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public void denyAccountRootDelete() {
this.jsiiCall("denyAccountRootDelete", software.amazon.jsii.NativeType.VOID);
}
/**
* Grants reading the secret value to some role.
*
* @param grantee the principal being granted permission. This parameter is required.
* @param versionStages the version stages the grant is limited to.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iam.Grant grantRead(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iam.IGrantable grantee, final @org.jetbrains.annotations.Nullable java.util.List versionStages) {
return this.jsiiCall("grantRead", software.amazon.awscdk.services.iam.Grant.class, new Object[] { java.util.Objects.requireNonNull(grantee, "grantee is required"), versionStages });
}
/**
* Grants reading the secret value to some role.
*
* @param grantee the principal being granted permission. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iam.Grant grantRead(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iam.IGrantable grantee) {
return this.jsiiCall("grantRead", software.amazon.awscdk.services.iam.Grant.class, new Object[] { java.util.Objects.requireNonNull(grantee, "grantee is required") });
}
/**
* Interpret the secret as a JSON object and return a field's value from it as a `SecretValue`.
*
* @param key This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.SecretValue secretValueFromJson(final @org.jetbrains.annotations.NotNull java.lang.String key) {
return this.jsiiCall("secretValueFromJson", software.amazon.awscdk.core.SecretValue.class, new Object[] { java.util.Objects.requireNonNull(key, "key is required") });
}
}
}