Class Secret

  • All Implemented Interfaces:
    IResource, ISecret, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

    @Generated(value="jsii-pacmak/1.54.0 (build b1b977a)",
               date="2022-03-07T02:28:27.972Z")
    @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 for Secret.
      • Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

        software.amazon.jsii.JsiiObject.InitializationMode
      • Nested classes/interfaces inherited from interface software.constructs.IConstruct

        software.constructs.IConstruct.Jsii$Default
    • 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)  
    • 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
                                             String name)
        Imports a secret from the cluster as a reference.

        Parameters:
        name - The name of the secret to reference. 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.
      • 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 class Resource
        See Also:
        base.Resource.apiObject