Class: CDK8sPlus25::K8S::KubeSecretProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
k8_s/kube_secret_props.rb

Overview

Secret holds secret data of a certain type.

The total bytes of the values in the Data field must be less than MaxSecretSize bytes.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data: nil, immutable: nil, metadata: nil, string_data: nil, type: nil) ⇒ KubeSecretProps

Returns a new instance of KubeSecretProps.

Parameters:

  • data (Hash{String => String}, nil) (defaults to: nil)

    Data contains the secret data.

  • immutable (Boolean, nil) (defaults to: nil)

    Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified).

  • metadata (CDK8sPlus25::K8S::ObjectMeta, nil) (defaults to: nil)

    Standard object's metadata.

  • string_data (Hash{String => String}, nil) (defaults to: nil)

    stringData allows specifying non-binary secret data in string form.

  • type (String, nil) (defaults to: nil)

    Used to facilitate programmatic handling of secret data.



14
15
16
17
18
19
20
21
22
23
24
25
# File 'k8_s/kube_secret_props.rb', line 14

def initialize(data: nil, immutable: nil, metadata: nil, string_data: nil, type: nil)
  @data = data
  Jsii::Type.check_type(@data, "eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19", "data") unless @data.nil?
  @immutable = immutable
  Jsii::Type.check_type(@immutable, "eyJwcmltaXRpdmUiOiJib29sZWFuIn0=", "immutable") unless @immutable.nil?
  @metadata = .is_a?(Hash) ? ::CDK8sPlus25::K8S::ObjectMeta.new(**.transform_keys(&:to_sym)) : 
  Jsii::Type.check_type(@metadata, "eyJmcW4iOiJjZGs4cy1wbHVzLTI1Lms4cy5PYmplY3RNZXRhIn0=", "metadata") unless @metadata.nil?
  @string_data = string_data
  Jsii::Type.check_type(@string_data, "eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19", "stringData") unless @string_data.nil?
  @type = type
  Jsii::Type.check_type(@type, "eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==", "type") unless @type.nil?
end

Instance Attribute Details

#dataHash{String => String}? (readonly)

Data contains the secret data.

Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4

Returns:

  • (Hash{String => String}, nil)


32
33
34
# File 'k8_s/kube_secret_props.rb', line 32

def data
  @data
end

#immutableBoolean? (readonly)

Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified).

If not set to true, the field can be modified at any time. Defaulted to nil.

Returns:

  • (Boolean, nil)


38
39
40
# File 'k8_s/kube_secret_props.rb', line 38

def immutable
  @immutable
end

#metadataCDK8sPlus25::K8S::ObjectMeta? (readonly)



44
45
46
# File 'k8_s/kube_secret_props.rb', line 44

def 
  @metadata
end

#string_dataHash{String => String}? (readonly)

stringData allows specifying non-binary secret data in string form.

It is provided as a write-only input field for convenience. All keys and values are merged into the data field on write, overwriting any existing values. The stringData field is never output when reading from the API.

Returns:

  • (Hash{String => String}, nil)


50
51
52
# File 'k8_s/kube_secret_props.rb', line 50

def string_data
  @string_data
end

#typeString? (readonly)

Used to facilitate programmatic handling of secret data.

More info: https://kubernetes.io/docs/concepts/configuration/secret/#secret-types

Returns:

  • (String, nil)


56
57
58
# File 'k8_s/kube_secret_props.rb', line 56

def type
  @type
end

Class Method Details

.jsii_propertiesObject



58
59
60
61
62
63
64
65
66
# File 'k8_s/kube_secret_props.rb', line 58

def self.jsii_properties
  {
    :data => "data",
    :immutable => "immutable",
    :metadata => "metadata",
    :string_data => "stringData",
    :type => "type",
  }
end

Instance Method Details

#to_jsiiObject



68
69
70
71
72
73
74
75
76
77
78
# File 'k8_s/kube_secret_props.rb', line 68

def to_jsii
  result = {}
  result.merge!({
    "data" => @data,
    "immutable" => @immutable,
    "metadata" => @metadata,
    "stringData" => @string_data,
    "type" => @type,
  })
  result.compact
end