aws.appsync.ApiCache
Explore with Pulumi AI
Provides an AppSync API Cache.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.appsync.GraphQLApi("example", {
authenticationType: "API_KEY",
name: "example",
});
const exampleApiCache = new aws.appsync.ApiCache("example", {
apiId: example.id,
apiCachingBehavior: "FULL_REQUEST_CACHING",
type: "LARGE",
ttl: 900,
});
import pulumi
import pulumi_aws as aws
example = aws.appsync.GraphQLApi("example",
authentication_type="API_KEY",
name="example")
example_api_cache = aws.appsync.ApiCache("example",
api_id=example.id,
api_caching_behavior="FULL_REQUEST_CACHING",
type="LARGE",
ttl=900)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appsync"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := appsync.NewGraphQLApi(ctx, "example", &appsync.GraphQLApiArgs{
AuthenticationType: pulumi.String("API_KEY"),
Name: pulumi.String("example"),
})
if err != nil {
return err
}
_, err = appsync.NewApiCache(ctx, "example", &appsync.ApiCacheArgs{
ApiId: example.ID(),
ApiCachingBehavior: pulumi.String("FULL_REQUEST_CACHING"),
Type: pulumi.String("LARGE"),
Ttl: pulumi.Int(900),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.AppSync.GraphQLApi("example", new()
{
AuthenticationType = "API_KEY",
Name = "example",
});
var exampleApiCache = new Aws.AppSync.ApiCache("example", new()
{
ApiId = example.Id,
ApiCachingBehavior = "FULL_REQUEST_CACHING",
Type = "LARGE",
Ttl = 900,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.appsync.GraphQLApi;
import com.pulumi.aws.appsync.GraphQLApiArgs;
import com.pulumi.aws.appsync.ApiCache;
import com.pulumi.aws.appsync.ApiCacheArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new GraphQLApi("example", GraphQLApiArgs.builder()
.authenticationType("API_KEY")
.name("example")
.build());
var exampleApiCache = new ApiCache("exampleApiCache", ApiCacheArgs.builder()
.apiId(example.id())
.apiCachingBehavior("FULL_REQUEST_CACHING")
.type("LARGE")
.ttl(900)
.build());
}
}
resources:
example:
type: aws:appsync:GraphQLApi
properties:
authenticationType: API_KEY
name: example
exampleApiCache:
type: aws:appsync:ApiCache
name: example
properties:
apiId: ${example.id}
apiCachingBehavior: FULL_REQUEST_CACHING
type: LARGE
ttl: 900
Create ApiCache Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApiCache(name: string, args: ApiCacheArgs, opts?: CustomResourceOptions);
@overload
def ApiCache(resource_name: str,
args: ApiCacheArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApiCache(resource_name: str,
opts: Optional[ResourceOptions] = None,
api_caching_behavior: Optional[str] = None,
api_id: Optional[str] = None,
ttl: Optional[int] = None,
type: Optional[str] = None,
at_rest_encryption_enabled: Optional[bool] = None,
transit_encryption_enabled: Optional[bool] = None)
func NewApiCache(ctx *Context, name string, args ApiCacheArgs, opts ...ResourceOption) (*ApiCache, error)
public ApiCache(string name, ApiCacheArgs args, CustomResourceOptions? opts = null)
public ApiCache(String name, ApiCacheArgs args)
public ApiCache(String name, ApiCacheArgs args, CustomResourceOptions options)
type: aws:appsync:ApiCache
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ApiCacheArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ApiCacheArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ApiCacheArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApiCacheArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApiCacheArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var apiCacheResource = new Aws.AppSync.ApiCache("apiCacheResource", new()
{
ApiCachingBehavior = "string",
ApiId = "string",
Ttl = 0,
Type = "string",
AtRestEncryptionEnabled = false,
TransitEncryptionEnabled = false,
});
example, err := appsync.NewApiCache(ctx, "apiCacheResource", &appsync.ApiCacheArgs{
ApiCachingBehavior: pulumi.String("string"),
ApiId: pulumi.String("string"),
Ttl: pulumi.Int(0),
Type: pulumi.String("string"),
AtRestEncryptionEnabled: pulumi.Bool(false),
TransitEncryptionEnabled: pulumi.Bool(false),
})
var apiCacheResource = new ApiCache("apiCacheResource", ApiCacheArgs.builder()
.apiCachingBehavior("string")
.apiId("string")
.ttl(0)
.type("string")
.atRestEncryptionEnabled(false)
.transitEncryptionEnabled(false)
.build());
api_cache_resource = aws.appsync.ApiCache("apiCacheResource",
api_caching_behavior="string",
api_id="string",
ttl=0,
type="string",
at_rest_encryption_enabled=False,
transit_encryption_enabled=False)
const apiCacheResource = new aws.appsync.ApiCache("apiCacheResource", {
apiCachingBehavior: "string",
apiId: "string",
ttl: 0,
type: "string",
atRestEncryptionEnabled: false,
transitEncryptionEnabled: false,
});
type: aws:appsync:ApiCache
properties:
apiCachingBehavior: string
apiId: string
atRestEncryptionEnabled: false
transitEncryptionEnabled: false
ttl: 0
type: string
ApiCache Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ApiCache resource accepts the following input properties:
- Api
Caching stringBehavior - Caching behavior. Valid values are
FULL_REQUEST_CACHING
andPER_RESOLVER_CACHING
. - Api
Id string - GraphQL API ID.
- Ttl int
- TTL in seconds for cache entries.
- Type string
- Cache instance type. Valid values are
SMALL
,MEDIUM
,LARGE
,XLARGE
,LARGE_2X
,LARGE_4X
,LARGE_8X
,LARGE_12X
,T2_SMALL
,T2_MEDIUM
,R4_LARGE
,R4_XLARGE
,R4_2XLARGE
,R4_4XLARGE
,R4_8XLARGE
. - At
Rest boolEncryption Enabled - At-rest encryption flag for cache. You cannot update this setting after creation.
- Transit
Encryption boolEnabled - Transit encryption flag when connecting to cache. You cannot update this setting after creation.
- Api
Caching stringBehavior - Caching behavior. Valid values are
FULL_REQUEST_CACHING
andPER_RESOLVER_CACHING
. - Api
Id string - GraphQL API ID.
- Ttl int
- TTL in seconds for cache entries.
- Type string
- Cache instance type. Valid values are
SMALL
,MEDIUM
,LARGE
,XLARGE
,LARGE_2X
,LARGE_4X
,LARGE_8X
,LARGE_12X
,T2_SMALL
,T2_MEDIUM
,R4_LARGE
,R4_XLARGE
,R4_2XLARGE
,R4_4XLARGE
,R4_8XLARGE
. - At
Rest boolEncryption Enabled - At-rest encryption flag for cache. You cannot update this setting after creation.
- Transit
Encryption boolEnabled - Transit encryption flag when connecting to cache. You cannot update this setting after creation.
- api
Caching StringBehavior - Caching behavior. Valid values are
FULL_REQUEST_CACHING
andPER_RESOLVER_CACHING
. - api
Id String - GraphQL API ID.
- ttl Integer
- TTL in seconds for cache entries.
- type String
- Cache instance type. Valid values are
SMALL
,MEDIUM
,LARGE
,XLARGE
,LARGE_2X
,LARGE_4X
,LARGE_8X
,LARGE_12X
,T2_SMALL
,T2_MEDIUM
,R4_LARGE
,R4_XLARGE
,R4_2XLARGE
,R4_4XLARGE
,R4_8XLARGE
. - at
Rest BooleanEncryption Enabled - At-rest encryption flag for cache. You cannot update this setting after creation.
- transit
Encryption BooleanEnabled - Transit encryption flag when connecting to cache. You cannot update this setting after creation.
- api
Caching stringBehavior - Caching behavior. Valid values are
FULL_REQUEST_CACHING
andPER_RESOLVER_CACHING
. - api
Id string - GraphQL API ID.
- ttl number
- TTL in seconds for cache entries.
- type string
- Cache instance type. Valid values are
SMALL
,MEDIUM
,LARGE
,XLARGE
,LARGE_2X
,LARGE_4X
,LARGE_8X
,LARGE_12X
,T2_SMALL
,T2_MEDIUM
,R4_LARGE
,R4_XLARGE
,R4_2XLARGE
,R4_4XLARGE
,R4_8XLARGE
. - at
Rest booleanEncryption Enabled - At-rest encryption flag for cache. You cannot update this setting after creation.
- transit
Encryption booleanEnabled - Transit encryption flag when connecting to cache. You cannot update this setting after creation.
- api_
caching_ strbehavior - Caching behavior. Valid values are
FULL_REQUEST_CACHING
andPER_RESOLVER_CACHING
. - api_
id str - GraphQL API ID.
- ttl int
- TTL in seconds for cache entries.
- type str
- Cache instance type. Valid values are
SMALL
,MEDIUM
,LARGE
,XLARGE
,LARGE_2X
,LARGE_4X
,LARGE_8X
,LARGE_12X
,T2_SMALL
,T2_MEDIUM
,R4_LARGE
,R4_XLARGE
,R4_2XLARGE
,R4_4XLARGE
,R4_8XLARGE
. - at_
rest_ boolencryption_ enabled - At-rest encryption flag for cache. You cannot update this setting after creation.
- transit_
encryption_ boolenabled - Transit encryption flag when connecting to cache. You cannot update this setting after creation.
- api
Caching StringBehavior - Caching behavior. Valid values are
FULL_REQUEST_CACHING
andPER_RESOLVER_CACHING
. - api
Id String - GraphQL API ID.
- ttl Number
- TTL in seconds for cache entries.
- type String
- Cache instance type. Valid values are
SMALL
,MEDIUM
,LARGE
,XLARGE
,LARGE_2X
,LARGE_4X
,LARGE_8X
,LARGE_12X
,T2_SMALL
,T2_MEDIUM
,R4_LARGE
,R4_XLARGE
,R4_2XLARGE
,R4_4XLARGE
,R4_8XLARGE
. - at
Rest BooleanEncryption Enabled - At-rest encryption flag for cache. You cannot update this setting after creation.
- transit
Encryption BooleanEnabled - Transit encryption flag when connecting to cache. You cannot update this setting after creation.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiCache resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ApiCache Resource
Get an existing ApiCache resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ApiCacheState, opts?: CustomResourceOptions): ApiCache
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api_caching_behavior: Optional[str] = None,
api_id: Optional[str] = None,
at_rest_encryption_enabled: Optional[bool] = None,
transit_encryption_enabled: Optional[bool] = None,
ttl: Optional[int] = None,
type: Optional[str] = None) -> ApiCache
func GetApiCache(ctx *Context, name string, id IDInput, state *ApiCacheState, opts ...ResourceOption) (*ApiCache, error)
public static ApiCache Get(string name, Input<string> id, ApiCacheState? state, CustomResourceOptions? opts = null)
public static ApiCache get(String name, Output<String> id, ApiCacheState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Api
Caching stringBehavior - Caching behavior. Valid values are
FULL_REQUEST_CACHING
andPER_RESOLVER_CACHING
. - Api
Id string - GraphQL API ID.
- At
Rest boolEncryption Enabled - At-rest encryption flag for cache. You cannot update this setting after creation.
- Transit
Encryption boolEnabled - Transit encryption flag when connecting to cache. You cannot update this setting after creation.
- Ttl int
- TTL in seconds for cache entries.
- Type string
- Cache instance type. Valid values are
SMALL
,MEDIUM
,LARGE
,XLARGE
,LARGE_2X
,LARGE_4X
,LARGE_8X
,LARGE_12X
,T2_SMALL
,T2_MEDIUM
,R4_LARGE
,R4_XLARGE
,R4_2XLARGE
,R4_4XLARGE
,R4_8XLARGE
.
- Api
Caching stringBehavior - Caching behavior. Valid values are
FULL_REQUEST_CACHING
andPER_RESOLVER_CACHING
. - Api
Id string - GraphQL API ID.
- At
Rest boolEncryption Enabled - At-rest encryption flag for cache. You cannot update this setting after creation.
- Transit
Encryption boolEnabled - Transit encryption flag when connecting to cache. You cannot update this setting after creation.
- Ttl int
- TTL in seconds for cache entries.
- Type string
- Cache instance type. Valid values are
SMALL
,MEDIUM
,LARGE
,XLARGE
,LARGE_2X
,LARGE_4X
,LARGE_8X
,LARGE_12X
,T2_SMALL
,T2_MEDIUM
,R4_LARGE
,R4_XLARGE
,R4_2XLARGE
,R4_4XLARGE
,R4_8XLARGE
.
- api
Caching StringBehavior - Caching behavior. Valid values are
FULL_REQUEST_CACHING
andPER_RESOLVER_CACHING
. - api
Id String - GraphQL API ID.
- at
Rest BooleanEncryption Enabled - At-rest encryption flag for cache. You cannot update this setting after creation.
- transit
Encryption BooleanEnabled - Transit encryption flag when connecting to cache. You cannot update this setting after creation.
- ttl Integer
- TTL in seconds for cache entries.
- type String
- Cache instance type. Valid values are
SMALL
,MEDIUM
,LARGE
,XLARGE
,LARGE_2X
,LARGE_4X
,LARGE_8X
,LARGE_12X
,T2_SMALL
,T2_MEDIUM
,R4_LARGE
,R4_XLARGE
,R4_2XLARGE
,R4_4XLARGE
,R4_8XLARGE
.
- api
Caching stringBehavior - Caching behavior. Valid values are
FULL_REQUEST_CACHING
andPER_RESOLVER_CACHING
. - api
Id string - GraphQL API ID.
- at
Rest booleanEncryption Enabled - At-rest encryption flag for cache. You cannot update this setting after creation.
- transit
Encryption booleanEnabled - Transit encryption flag when connecting to cache. You cannot update this setting after creation.
- ttl number
- TTL in seconds for cache entries.
- type string
- Cache instance type. Valid values are
SMALL
,MEDIUM
,LARGE
,XLARGE
,LARGE_2X
,LARGE_4X
,LARGE_8X
,LARGE_12X
,T2_SMALL
,T2_MEDIUM
,R4_LARGE
,R4_XLARGE
,R4_2XLARGE
,R4_4XLARGE
,R4_8XLARGE
.
- api_
caching_ strbehavior - Caching behavior. Valid values are
FULL_REQUEST_CACHING
andPER_RESOLVER_CACHING
. - api_
id str - GraphQL API ID.
- at_
rest_ boolencryption_ enabled - At-rest encryption flag for cache. You cannot update this setting after creation.
- transit_
encryption_ boolenabled - Transit encryption flag when connecting to cache. You cannot update this setting after creation.
- ttl int
- TTL in seconds for cache entries.
- type str
- Cache instance type. Valid values are
SMALL
,MEDIUM
,LARGE
,XLARGE
,LARGE_2X
,LARGE_4X
,LARGE_8X
,LARGE_12X
,T2_SMALL
,T2_MEDIUM
,R4_LARGE
,R4_XLARGE
,R4_2XLARGE
,R4_4XLARGE
,R4_8XLARGE
.
- api
Caching StringBehavior - Caching behavior. Valid values are
FULL_REQUEST_CACHING
andPER_RESOLVER_CACHING
. - api
Id String - GraphQL API ID.
- at
Rest BooleanEncryption Enabled - At-rest encryption flag for cache. You cannot update this setting after creation.
- transit
Encryption BooleanEnabled - Transit encryption flag when connecting to cache. You cannot update this setting after creation.
- ttl Number
- TTL in seconds for cache entries.
- type String
- Cache instance type. Valid values are
SMALL
,MEDIUM
,LARGE
,XLARGE
,LARGE_2X
,LARGE_4X
,LARGE_8X
,LARGE_12X
,T2_SMALL
,T2_MEDIUM
,R4_LARGE
,R4_XLARGE
,R4_2XLARGE
,R4_4XLARGE
,R4_8XLARGE
.
Import
Using pulumi import
, import aws_appsync_api_cache
using the AppSync API ID. For example:
$ pulumi import aws:appsync/apiCache:ApiCache example xxxxx
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.