Skip to content
v2.278.0

CfnApiCacheProps Struct ​

Properties for defining a CfnApiCache.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appsync as appsync } from 'aws-cdk-lib';
const cfnApiCacheProps: appsync.CfnApiCacheProps = {
  apiCachingBehavior: 'apiCachingBehavior',
  apiId: 'apiId',
  ttl: 123,
  type: 'type',

  // the properties below are optional
  atRestEncryptionEnabled: false,
  healthMetricsConfig: 'healthMetricsConfig',
  transitEncryptionEnabled: false,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appsync as appsync

cfn_api_cache_props = appsync.CfnApiCacheProps(
    api_caching_behavior="apiCachingBehavior",
    api_id="apiId",
    ttl=123,
    type="type",

    # the properties below are optional
    at_rest_encryption_enabled=False,
    health_metrics_config="healthMetricsConfig",
    transit_encryption_enabled=False
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.appsync.*;

CfnApiCacheProps cfnApiCacheProps = CfnApiCacheProps.builder()
        .apiCachingBehavior("apiCachingBehavior")
        .apiId("apiId")
        .ttl(123)
        .type("type")

        // the properties below are optional
        .atRestEncryptionEnabled(false)
        .healthMetricsConfig("healthMetricsConfig")
        .transitEncryptionEnabled(false)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AppSync;

var cfnApiCacheProps = new CfnApiCacheProps {
    ApiCachingBehavior = "apiCachingBehavior",
    ApiId = "apiId",
    Ttl = 123,
    Type = "type",

    // the properties below are optional
    AtRestEncryptionEnabled = false,
    HealthMetricsConfig = "healthMetricsConfig",
    TransitEncryptionEnabled = false
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnApiCacheProps := &CfnApiCacheProps{
	ApiCachingBehavior: jsii.String("apiCachingBehavior"),
	ApiId: jsii.String("apiId"),
	Ttl: jsii.Number(123),
	Type: jsii.String("type"),

	// the properties below are optional
	AtRestEncryptionEnabled: jsii.Boolean(false),
	HealthMetricsConfig: jsii.String("healthMetricsConfig"),
	TransitEncryptionEnabled: jsii.Boolean(false),
}

Properties ​

apiCachingBehaviorstringapi_caching_behaviorstrapiCachingBehaviorStringApiCachingBehaviorstringApiCachingBehavior*string required #
Caching behavior.
notes
  • FULL_REQUEST_CACHING : All requests from the same user are cached. Individual resolvers are automatically cached. All API calls will try to return responses from the cache.
  • PER_RESOLVER_CACHING : Individual resolvers that you specify are cached.
  • OPERATION_LEVEL_CACHING : Full requests are cached together and returned without executing resolvers.
apiIdstringapi_idstrapiIdStringApiIdstringApiId*string required #
The GraphQL API ID.
atRestEncryptionEnabledoptionalboolean | IResolvableat_rest_encryption_enabledoptionaltyping.Union[bool, IResolvable]atRestEncryptionEnabledoptionalBooleanAtRestEncryptionEnabledoptionalboolAtRestEncryptionEnabledoptionalinterface{} #
*This parameter has been deprecated* .

At-rest encryption flag for cache. You cannot update this setting after creation.

healthMetricsConfigoptionalstringhealth_metrics_configoptionalstrhealthMetricsConfigoptionalStringHealthMetricsConfigoptionalstringHealthMetricsConfigoptional*string #
Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:.
notes
  • NetworkBandwidthOutAllowanceExceeded : The network packets dropped because the throughput exceeded the aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.
  • EngineCPUUtilization : The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.

Metrics will be recorded by API ID. You can set the value to ENABLED or DISABLED .

transitEncryptionEnabledoptionalboolean | IResolvabletransit_encryption_enabledoptionaltyping.Union[bool, IResolvable]transitEncryptionEnabledoptionalBooleanTransitEncryptionEnabledoptionalboolTransitEncryptionEnabledoptionalinterface{} #
*This parameter has been deprecated* .

Transit encryption flag when connecting to cache. You cannot update this setting after creation.

ttlnumberttlint | floatttlNumberTtldoubleTtl*float64 required #
TTL in seconds for cache entries.

Valid values are 1–3,600 seconds.

typestringtypestrtypeStringTypestringType*string required #
The cache instance type. Valid values are.
notes
  • SMALL
  • MEDIUM
  • LARGE
  • XLARGE
  • LARGE_2X
  • LARGE_4X
  • LARGE_8X (not available in all regions)
  • LARGE_12X

Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the generic identifiers above should be used.

The following legacy instance types are available, but their use is discouraged:

  • T2_SMALL : A t2.small instance type.
  • T2_MEDIUM : A t2.medium instance type.
  • R4_LARGE : A r4.large instance type.
  • R4_XLARGE : A r4.xlarge instance type.
  • R4_2XLARGE : A r4.2xlarge instance type.
  • R4_4XLARGE : A r4.4xlarge instance type.
  • R4_8XLARGE : A r4.8xlarge instance type.