1. Registry
  2. Packages
  3. CAST AI
  4. API Docs
  5. CacheRule
Viewing docs for CAST AI v8.60.0
published on Wednesday, Aug 19, 2026 by CAST AI
castai logo
Viewing docs for CAST AI v8.60.0
published on Wednesday, Aug 19, 2026 by CAST AI

    Create CacheRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CacheRule(name: string, args: CacheRuleArgs, opts?: CustomResourceOptions);
    @overload
    def CacheRule(resource_name: str,
                  args: CacheRuleArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def CacheRule(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  cache_configuration_id: Optional[str] = None,
                  cache_group_id: Optional[str] = None,
                  mode: Optional[str] = None,
                  manual_ttl: Optional[int] = None,
                  table: Optional[str] = None,
                  template_hash: Optional[str] = None)
    func NewCacheRule(ctx *Context, name string, args CacheRuleArgs, opts ...ResourceOption) (*CacheRule, error)
    public CacheRule(string name, CacheRuleArgs args, CustomResourceOptions? opts = null)
    public CacheRule(String name, CacheRuleArgs args)
    public CacheRule(String name, CacheRuleArgs args, CustomResourceOptions options)
    
    type: castai:cache:CacheRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "castai_cache_rule" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args CacheRuleArgs
    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 CacheRuleArgs
    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 CacheRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CacheRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CacheRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    CacheRule 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 CacheRule resource accepts the following input properties:

    CacheConfigurationId string
    ID of the cache configuration this rule belongs to.
    CacheGroupId string
    ID of the cache group this rule belongs to.
    Mode string
    TTL mode for queries matching this rule. Valid values: Auto, DontCache, Manual.
    ManualTtl int
    TTL in seconds. Required when mode is Manual.
    Table string
    Database table name to apply this rule to. Either table or templateHash must be specified.
    TemplateHash string
    Hash of the query template. Either table or templateHash must be specified.
    CacheConfigurationId string
    ID of the cache configuration this rule belongs to.
    CacheGroupId string
    ID of the cache group this rule belongs to.
    Mode string
    TTL mode for queries matching this rule. Valid values: Auto, DontCache, Manual.
    ManualTtl int
    TTL in seconds. Required when mode is Manual.
    Table string
    Database table name to apply this rule to. Either table or templateHash must be specified.
    TemplateHash string
    Hash of the query template. Either table or templateHash must be specified.
    cache_configuration_id string
    ID of the cache configuration this rule belongs to.
    cache_group_id string
    ID of the cache group this rule belongs to.
    mode string
    TTL mode for queries matching this rule. Valid values: Auto, DontCache, Manual.
    manual_ttl number
    TTL in seconds. Required when mode is Manual.
    table string
    Database table name to apply this rule to. Either table or templateHash must be specified.
    template_hash string
    Hash of the query template. Either table or templateHash must be specified.
    cacheConfigurationId String
    ID of the cache configuration this rule belongs to.
    cacheGroupId String
    ID of the cache group this rule belongs to.
    mode String
    TTL mode for queries matching this rule. Valid values: Auto, DontCache, Manual.
    manualTtl Integer
    TTL in seconds. Required when mode is Manual.
    table String
    Database table name to apply this rule to. Either table or templateHash must be specified.
    templateHash String
    Hash of the query template. Either table or templateHash must be specified.
    cacheConfigurationId string
    ID of the cache configuration this rule belongs to.
    cacheGroupId string
    ID of the cache group this rule belongs to.
    mode string
    TTL mode for queries matching this rule. Valid values: Auto, DontCache, Manual.
    manualTtl number
    TTL in seconds. Required when mode is Manual.
    table string
    Database table name to apply this rule to. Either table or templateHash must be specified.
    templateHash string
    Hash of the query template. Either table or templateHash must be specified.
    cache_configuration_id str
    ID of the cache configuration this rule belongs to.
    cache_group_id str
    ID of the cache group this rule belongs to.
    mode str
    TTL mode for queries matching this rule. Valid values: Auto, DontCache, Manual.
    manual_ttl int
    TTL in seconds. Required when mode is Manual.
    table str
    Database table name to apply this rule to. Either table or templateHash must be specified.
    template_hash str
    Hash of the query template. Either table or templateHash must be specified.
    cacheConfigurationId String
    ID of the cache configuration this rule belongs to.
    cacheGroupId String
    ID of the cache group this rule belongs to.
    mode String
    TTL mode for queries matching this rule. Valid values: Auto, DontCache, Manual.
    manualTtl Number
    TTL in seconds. Required when mode is Manual.
    table String
    Database table name to apply this rule to. Either table or templateHash must be specified.
    templateHash String
    Hash of the query template. Either table or templateHash must be specified.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CacheRule 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 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 CacheRule Resource

    Get an existing CacheRule 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?: CacheRuleState, opts?: CustomResourceOptions): CacheRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cache_configuration_id: Optional[str] = None,
            cache_group_id: Optional[str] = None,
            manual_ttl: Optional[int] = None,
            mode: Optional[str] = None,
            table: Optional[str] = None,
            template_hash: Optional[str] = None) -> CacheRule
    func GetCacheRule(ctx *Context, name string, id IDInput, state *CacheRuleState, opts ...ResourceOption) (*CacheRule, error)
    public static CacheRule Get(string name, Input<string> id, CacheRuleState? state, CustomResourceOptions? opts = null)
    public static CacheRule get(String name, Output<String> id, CacheRuleState state, CustomResourceOptions options)
    resources:  _:    type: castai:cache:CacheRule    get:      id: ${id}
    import {
      to = castai_cache_rule.example
      id = "${id}"
    }
    
    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.
    The following state arguments are supported:
    CacheConfigurationId string
    ID of the cache configuration this rule belongs to.
    CacheGroupId string
    ID of the cache group this rule belongs to.
    ManualTtl int
    TTL in seconds. Required when mode is Manual.
    Mode string
    TTL mode for queries matching this rule. Valid values: Auto, DontCache, Manual.
    Table string
    Database table name to apply this rule to. Either table or templateHash must be specified.
    TemplateHash string
    Hash of the query template. Either table or templateHash must be specified.
    CacheConfigurationId string
    ID of the cache configuration this rule belongs to.
    CacheGroupId string
    ID of the cache group this rule belongs to.
    ManualTtl int
    TTL in seconds. Required when mode is Manual.
    Mode string
    TTL mode for queries matching this rule. Valid values: Auto, DontCache, Manual.
    Table string
    Database table name to apply this rule to. Either table or templateHash must be specified.
    TemplateHash string
    Hash of the query template. Either table or templateHash must be specified.
    cache_configuration_id string
    ID of the cache configuration this rule belongs to.
    cache_group_id string
    ID of the cache group this rule belongs to.
    manual_ttl number
    TTL in seconds. Required when mode is Manual.
    mode string
    TTL mode for queries matching this rule. Valid values: Auto, DontCache, Manual.
    table string
    Database table name to apply this rule to. Either table or templateHash must be specified.
    template_hash string
    Hash of the query template. Either table or templateHash must be specified.
    cacheConfigurationId String
    ID of the cache configuration this rule belongs to.
    cacheGroupId String
    ID of the cache group this rule belongs to.
    manualTtl Integer
    TTL in seconds. Required when mode is Manual.
    mode String
    TTL mode for queries matching this rule. Valid values: Auto, DontCache, Manual.
    table String
    Database table name to apply this rule to. Either table or templateHash must be specified.
    templateHash String
    Hash of the query template. Either table or templateHash must be specified.
    cacheConfigurationId string
    ID of the cache configuration this rule belongs to.
    cacheGroupId string
    ID of the cache group this rule belongs to.
    manualTtl number
    TTL in seconds. Required when mode is Manual.
    mode string
    TTL mode for queries matching this rule. Valid values: Auto, DontCache, Manual.
    table string
    Database table name to apply this rule to. Either table or templateHash must be specified.
    templateHash string
    Hash of the query template. Either table or templateHash must be specified.
    cache_configuration_id str
    ID of the cache configuration this rule belongs to.
    cache_group_id str
    ID of the cache group this rule belongs to.
    manual_ttl int
    TTL in seconds. Required when mode is Manual.
    mode str
    TTL mode for queries matching this rule. Valid values: Auto, DontCache, Manual.
    table str
    Database table name to apply this rule to. Either table or templateHash must be specified.
    template_hash str
    Hash of the query template. Either table or templateHash must be specified.
    cacheConfigurationId String
    ID of the cache configuration this rule belongs to.
    cacheGroupId String
    ID of the cache group this rule belongs to.
    manualTtl Number
    TTL in seconds. Required when mode is Manual.
    mode String
    TTL mode for queries matching this rule. Valid values: Auto, DontCache, Manual.
    table String
    Database table name to apply this rule to. Either table or templateHash must be specified.
    templateHash String
    Hash of the query template. Either table or templateHash must be specified.

    Package Details

    Repository
    castai castai/pulumi-castai
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the castai Terraform Provider.
    castai logo
    Viewing docs for CAST AI v8.60.0
    published on Wednesday, Aug 19, 2026 by CAST AI

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial