aws_sdk_appsync/client/
create_api_cache.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`CreateApiCache`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`api_id(impl Into<String>)`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::api_id) / [`set_api_id(Option<String>)`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::set_api_id):<br>required: **true**<br><p>The GraphQL API ID.</p><br>
7    ///   - [`ttl(i64)`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::ttl) / [`set_ttl(Option<i64>)`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::set_ttl):<br>required: **true**<br><p>TTL in seconds for cache entries.</p> <p>Valid values are 1–3,600 seconds.</p><br>
8    ///   - [`transit_encryption_enabled(bool)`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::transit_encryption_enabled) / [`set_transit_encryption_enabled(Option<bool>)`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::set_transit_encryption_enabled):<br>required: **false**<br><p>Transit encryption flag when connecting to cache. You cannot update this setting after creation.</p><br>
9    ///   - [`at_rest_encryption_enabled(bool)`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::at_rest_encryption_enabled) / [`set_at_rest_encryption_enabled(Option<bool>)`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::set_at_rest_encryption_enabled):<br>required: **false**<br><p>At-rest encryption flag for cache. You cannot update this setting after creation.</p><br>
10    ///   - [`api_caching_behavior(ApiCachingBehavior)`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::api_caching_behavior) / [`set_api_caching_behavior(Option<ApiCachingBehavior>)`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::set_api_caching_behavior):<br>required: **true**<br><p>Caching behavior.</p> <ul>  <li>   <p><b>FULL_REQUEST_CACHING</b>: All requests from the same user are cached. Individual resolvers are automatically cached. All API calls will try to return responses from the cache.</p></li>  <li>   <p><b>PER_RESOLVER_CACHING</b>: Individual resolvers that you specify are cached.</p></li>  <li>   <p><b>OPERATION_LEVEL_CACHING</b>: Full requests are cached together and returned without executing resolvers.</p></li> </ul><br>
11    ///   - [`r#type(ApiCacheType)`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::type) / [`set_type(Option<ApiCacheType>)`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::set_type):<br>required: **true**<br><p>The cache instance type. Valid values are</p> <ul>  <li>   <p><code>SMALL</code></p></li>  <li>   <p><code>MEDIUM</code></p></li>  <li>   <p><code>LARGE</code></p></li>  <li>   <p><code>XLARGE</code></p></li>  <li>   <p><code>LARGE_2X</code></p></li>  <li>   <p><code>LARGE_4X</code></p></li>  <li>   <p><code>LARGE_8X</code> (not available in all regions)</p></li>  <li>   <p><code>LARGE_12X</code></p></li> </ul> <p>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.</p> <p>The following legacy instance types are available, but their use is discouraged:</p> <ul>  <li>   <p><b>T2_SMALL</b>: A t2.small instance type.</p></li>  <li>   <p><b>T2_MEDIUM</b>: A t2.medium instance type.</p></li>  <li>   <p><b>R4_LARGE</b>: A r4.large instance type.</p></li>  <li>   <p><b>R4_XLARGE</b>: A r4.xlarge instance type.</p></li>  <li>   <p><b>R4_2XLARGE</b>: A r4.2xlarge instance type.</p></li>  <li>   <p><b>R4_4XLARGE</b>: A r4.4xlarge instance type.</p></li>  <li>   <p><b>R4_8XLARGE</b>: A r4.8xlarge instance type.</p></li> </ul><br>
12    ///   - [`health_metrics_config(CacheHealthMetricsConfig)`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::health_metrics_config) / [`set_health_metrics_config(Option<CacheHealthMetricsConfig>)`](crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::set_health_metrics_config):<br>required: **false**<br><p>Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:</p> <ul>  <li>   <p>NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.</p></li>  <li>   <p>EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for diagnosing bottlenecks in a cache configuration.</p></li> </ul> <p>Metrics will be recorded by API ID. You can set the value to <code>ENABLED</code> or <code>DISABLED</code>.</p><br>
13    /// - On success, responds with [`CreateApiCacheOutput`](crate::operation::create_api_cache::CreateApiCacheOutput) with field(s):
14    ///   - [`api_cache(Option<ApiCache>)`](crate::operation::create_api_cache::CreateApiCacheOutput::api_cache): <p>The <code>ApiCache</code> object.</p>
15    /// - On failure, responds with [`SdkError<CreateApiCacheError>`](crate::operation::create_api_cache::CreateApiCacheError)
16    pub fn create_api_cache(&self) -> crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder {
17        crate::operation::create_api_cache::builders::CreateApiCacheFluentBuilder::new(self.handle.clone())
18    }
19}