Class Secret

    • 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.

        Specified by:
        envValue in interface ISecret
        Parameters:
        key - This parameter is required.
        options -
      • envValue

        @Stability(Stable)
        @NotNull
        public EnvValue envValue​(@NotNull
                                 String key)
        Returns EnvValue object from a secret's key.

        Specified by:
        envValue in interface ISecret
        Parameters:
        key - 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.
      • getImmutable

        @Stability(Stable)
        @NotNull
        public Boolean getImmutable()
        Whether or not the secret is immutable.