![JAR search and dependency download from the Maven repository](/logo.png)
org.cdk8s.plus.Secret Maven / Gradle / Ivy
Show all versions of cdk8s-plus Show documentation
package org.cdk8s.plus;
/**
* Kubernetes Secrets let you store and manage sensitive information, such as passwords, OAuth tokens, and ssh keys.
*
* Storing confidential information in a
* Secret is safer and more flexible than putting it verbatim in a Pod
* definition or in a container image.
*
* EXPERIMENTAL
*
* @see https://kubernetes.io/docs/concepts/configuration/secret
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.7.0 (build 179a3a5)", date = "2020-06-29T13:29:38.529Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = org.cdk8s.plus.$Module.class, fqn = "cdk8s-plus.Secret")
public class Secret extends org.cdk8s.plus.Resource implements org.cdk8s.plus.ISecret {
protected Secret(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected Secret(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* EXPERIMENTAL
*
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Secret(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.Nullable org.cdk8s.plus.SecretProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), props });
}
/**
* EXPERIMENTAL
*
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Secret(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required") });
}
/**
* Imports a secret from the cluster as a reference.
*
* EXPERIMENTAL
*
* @param name The name of the secret to reference. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull org.cdk8s.plus.ISecret fromSecretName(final @org.jetbrains.annotations.NotNull java.lang.String name) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.plus.Secret.class, "fromSecretName", org.cdk8s.plus.ISecret.class, new Object[] { java.util.Objects.requireNonNull(name, "name is required") });
}
/**
* Adds a string data field to the secert.
*
* EXPERIMENTAL
*
* @param key Key. This parameter is required.
* @param value Value. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public void addStringData(final @org.jetbrains.annotations.NotNull java.lang.String key, final @org.jetbrains.annotations.NotNull java.lang.String value) {
this.jsiiCall("addStringData", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(key, "key is required"), java.util.Objects.requireNonNull(value, "value is required") });
}
/**
* Gets a string data by key or undefined.
*
* EXPERIMENTAL
*
* @param key Key. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.Nullable java.lang.String getStringData(final @org.jetbrains.annotations.NotNull java.lang.String key) {
return this.jsiiCall("getStringData", java.lang.String.class, new Object[] { java.util.Objects.requireNonNull(key, "key is required") });
}
/**
* The underlying cdk8s API object.
*
* EXPERIMENTAL
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
protected @org.jetbrains.annotations.NotNull org.cdk8s.ApiObject getApiObject() {
return this.jsiiGet("apiObject", org.cdk8s.ApiObject.class);
}
/**
* A fluent builder for {@link org.cdk8s.plus.Secret}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* EXPERIMENTAL
*
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private org.cdk8s.plus.SecretProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
}
/**
* Metadata that all persisted resources must have, which includes all objects users must create.
*
* EXPERIMENTAL
*
* @return {@code this}
* @param metadata Metadata that all persisted resources must have, which includes all objects users must create. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder metadata(final org.cdk8s.ApiObjectMetadata metadata) {
this.props().metadata(metadata);
return this;
}
/**
* stringData allows specifying non-binary secret data in string form.
*
* It is
* provided as a write-only convenience method. All keys and values are merged
* into the data field on write, overwriting any existing values. It is never
* output when reading from the API.
*
* EXPERIMENTAL
*
* @return {@code this}
* @param stringData stringData allows specifying non-binary secret data in string form. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder stringData(final java.util.Map stringData) {
this.props().stringData(stringData);
return this;
}
/**
* @returns a newly built instance of {@link org.cdk8s.plus.Secret}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public org.cdk8s.plus.Secret build() {
return new org.cdk8s.plus.Secret(
this.scope,
this.id,
this.props != null ? this.props.build() : null
);
}
private org.cdk8s.plus.SecretProps.Builder props() {
if (this.props == null) {
this.props = new org.cdk8s.plus.SecretProps.Builder();
}
return this.props;
}
}
}