Package org.cdk8s.plus24
Class Secret
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- software.constructs.Construct
-
- org.cdk8s.plus24.Resource
-
- org.cdk8s.plus24.Secret
-
- All Implemented Interfaces:
IApiEndpoint
,IApiResource
,IResource
,ISecret
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
- Direct Known Subclasses:
BasicAuthSecret
,DockerConfigSecret
,ServiceAccountTokenSecret
,SshAuthSecret
,TlsSecret
@Generated(value="jsii-pacmak/1.79.0 (build b22f628)", date="2023-03-31T02:28:41.684Z") @Stability(Stable) public class Secret extends Resource implements ISecret
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Secret.Builder
A fluent builder forSecret
.-
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Nested classes/interfaces inherited from interface org.cdk8s.plus24.IApiEndpoint
IApiEndpoint.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus24.IApiResource
IApiResource.Jsii$Default
-
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus24.IResource
IResource.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus24.ISecret
ISecret.Jsii$Default, ISecret.Jsii$Proxy
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Secret(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
protected
Secret(software.amazon.jsii.JsiiObjectRef objRef)
Secret(software.constructs.Construct scope, String id)
Secret(software.constructs.Construct scope, String id, SecretProps props)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addStringData(String key, String value)
Adds a string data field to the secert.EnvValue
envValue(String key)
Returns EnvValue object from a secret's key.EnvValue
envValue(String key, EnvValueFromSecretOptions options)
Returns EnvValue object from a secret's key.static ISecret
fromSecretName(software.constructs.Construct scope, String id, String name)
Imports a secret from the cluster as a reference.protected org.cdk8s.ApiObject
getApiObject()
The underlying cdk8s API object.Boolean
getImmutable()
Whether or not the secret is immutable.String
getResourceType()
The name of a resource type as it appears in the relevant API endpoint.String
getStringData(String key)
Gets a string data by key or undefined.-
Methods inherited from class org.cdk8s.plus24.Resource
asApiResource, asNonApiResource, getApiGroup, getApiVersion, getKind, getMetadata, getName, getPermissions, getResourceName
-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.cdk8s.plus24.IApiResource
getApiGroup, getResourceName
-
Methods inherited from interface org.cdk8s.plus24.IResource
getApiVersion, getKind, getName
-
-
-
-
Constructor Detail
-
Secret
protected Secret(software.amazon.jsii.JsiiObjectRef objRef)
-
Secret
protected Secret(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
Secret
@Stability(Stable) public Secret(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable SecretProps props)
- Parameters:
scope
- This parameter is required.id
- This parameter is required.props
-
-
Secret
@Stability(Stable) public Secret(@NotNull software.constructs.Construct scope, @NotNull String id)
- Parameters:
scope
- This parameter is required.id
- This parameter is required.
-
-
Method Detail
-
fromSecretName
@Stability(Stable) @NotNull public static ISecret fromSecretName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String name)
Imports a secret from the cluster as a reference.- Parameters:
scope
- This parameter is required.id
- This parameter is required.name
- This parameter is required.
-
addStringData
@Stability(Stable) public void addStringData(@NotNull String key, @NotNull String value)
Adds a string data field to the secert.- Parameters:
key
- Key. This parameter is required.value
- Value. This parameter is required.
-
envValue
@Stability(Stable) @NotNull public EnvValue envValue(@NotNull String key, @Nullable EnvValueFromSecretOptions options)
Returns EnvValue object from a secret's key.
-
envValue
@Stability(Stable) @NotNull public EnvValue envValue(@NotNull String key)
Returns EnvValue object from a secret's key.
-
getStringData
@Stability(Stable) @Nullable public String getStringData(@NotNull String key)
Gets a string data by key or undefined.- Parameters:
key
- Key. This parameter is required.
-
getApiObject
@Stability(Stable) @NotNull protected org.cdk8s.ApiObject getApiObject()
The underlying cdk8s API object.- Specified by:
getApiObject
in classResource
- See Also:
- base.Resource.apiObject
-
getImmutable
@Stability(Stable) @NotNull public Boolean getImmutable()
Whether or not the secret is immutable.
-
getResourceType
@Stability(Stable) @NotNull public String getResourceType()
The name of a resource type as it appears in the relevant API endpoint.- Specified by:
getResourceType
in interfaceIApiResource
- Specified by:
getResourceType
in classResource
- See Also:
- https://kubernetes.io/docs/reference/access-authn-authz/rbac/#referring-to-resources
-
-