Class: AWSCDK::AppSync::CachingConfig

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
app_sync/caching_config.rb

Overview

CachingConfig for AppSync resolvers.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ttl:, caching_keys: nil) ⇒ CachingConfig

Returns a new instance of CachingConfig.

Parameters:

  • ttl (AWSCDK::Duration)

    The TTL in seconds for a resolver that has caching enabled.

  • caching_keys (Array<String>, nil) (defaults to: nil)

    The caching keys for a resolver that has caching enabled.



9
10
11
12
13
14
# File 'app_sync/caching_config.rb', line 9

def initialize(ttl:, caching_keys: nil)
  @ttl = ttl
  Jsii::Type.check_type(@ttl, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "ttl")
  @caching_keys = caching_keys
  Jsii::Type.check_type(@caching_keys, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "cachingKeys") unless @caching_keys.nil?
end

Instance Attribute Details

#caching_keysArray<String>? (readonly)

Note:

Default: - No caching keys

The caching keys for a resolver that has caching enabled.

Valid values are entries from the $context.arguments, $context.source, and $context.identity maps.

Returns:

  • (Array<String>, nil)


28
29
30
# File 'app_sync/caching_config.rb', line 28

def caching_keys
  @caching_keys
end

#ttlAWSCDK::Duration (readonly)

The TTL in seconds for a resolver that has caching enabled.

Valid values are between 1 and 3600 seconds.

Returns:



21
22
23
# File 'app_sync/caching_config.rb', line 21

def ttl
  @ttl
end

Class Method Details

.jsii_propertiesObject



30
31
32
33
34
35
# File 'app_sync/caching_config.rb', line 30

def self.jsii_properties
  {
    :ttl => "ttl",
    :caching_keys => "cachingKeys",
  }
end

Instance Method Details

#to_jsiiObject



37
38
39
40
41
42
43
44
# File 'app_sync/caching_config.rb', line 37

def to_jsii
  result = {}
  result.merge!({
    "ttl" => @ttl,
    "cachingKeys" => @caching_keys,
  })
  result.compact
end