Class: AWSCDK::AppMesh::TLSClientPolicy

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
app_mesh/tls_client_policy.rb

Overview

Represents the properties needed to define client policy.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(validation:, enforce: nil, mutual_tls_certificate: nil, ports: nil) ⇒ TLSClientPolicy

Returns a new instance of TLSClientPolicy.

Parameters:

  • validation (AWSCDK::AppMesh::TLSValidation)

    Represents the object for TLS validation context.

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

    Whether the policy is enforced.

  • mutual_tls_certificate (AWSCDK::AppMesh::MutualTLSCertificate, nil) (defaults to: nil)

    Represents a client TLS certificate.

  • ports (Array<Numeric>, nil) (defaults to: nil)

    TLS is enforced on the ports specified here.



11
12
13
14
15
16
17
18
19
20
# File 'app_mesh/tls_client_policy.rb', line 11

def initialize(validation:, enforce: nil, mutual_tls_certificate: nil, ports: nil)
  @validation = validation.is_a?(Hash) ? ::AWSCDK::AppMesh::TLSValidation.new(**validation.transform_keys(&:to_sym)) : validation
  Jsii::Type.check_type(@validation, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbWVzaC5UbHNWYWxpZGF0aW9uIn0=")), "validation")
  @enforce = enforce
  Jsii::Type.check_type(@enforce, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enforce") unless @enforce.nil?
  @mutual_tls_certificate = mutual_tls_certificate
  Jsii::Type.check_type(@mutual_tls_certificate, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbWVzaC5NdXR1YWxUbHNDZXJ0aWZpY2F0ZSJ9")), "mutualTlsCertificate") unless @mutual_tls_certificate.nil?
  @ports = ports
  Jsii::Type.check_type(@ports, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6Im51bWJlciJ9LCJraW5kIjoiYXJyYXkifX0=")), "ports") unless @ports.nil?
end

Instance Attribute Details

#enforceBoolean? (readonly)

Note:

Default: true

Whether the policy is enforced.

Returns:

  • (Boolean, nil)


30
31
32
# File 'app_mesh/tls_client_policy.rb', line 30

def enforce
  @enforce
end

#mutual_tls_certificateAWSCDK::AppMesh::MutualTLSCertificate? (readonly)

Note:

Default: - client TLS certificate is not provided

Represents a client TLS certificate.

The certificate will be sent only if the server requests it, enabling mutual TLS.



37
38
39
# File 'app_mesh/tls_client_policy.rb', line 37

def mutual_tls_certificate
  @mutual_tls_certificate
end

#portsArray<Numeric>? (readonly)

Note:

Default: - all ports

TLS is enforced on the ports specified here.

If no ports are specified, TLS will be enforced on all the ports.

Returns:

  • (Array<Numeric>, nil)


44
45
46
# File 'app_mesh/tls_client_policy.rb', line 44

def ports
  @ports
end

#validationAWSCDK::AppMesh::TLSValidation (readonly)

Represents the object for TLS validation context.



25
26
27
# File 'app_mesh/tls_client_policy.rb', line 25

def validation
  @validation
end

Class Method Details

.jsii_propertiesObject



46
47
48
49
50
51
52
53
# File 'app_mesh/tls_client_policy.rb', line 46

def self.jsii_properties
  {
    :validation => "validation",
    :enforce => "enforce",
    :mutual_tls_certificate => "mutualTlsCertificate",
    :ports => "ports",
  }
end

Instance Method Details

#to_jsiiObject



55
56
57
58
59
60
61
62
63
64
# File 'app_mesh/tls_client_policy.rb', line 55

def to_jsii
  result = {}
  result.merge!({
    "validation" => @validation,
    "enforce" => @enforce,
    "mutualTlsCertificate" => @mutual_tls_certificate,
    "ports" => @ports,
  })
  result.compact
end