Class CfnTemplate

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITemplateRef, IEnvironmentAware, ITaggableV2, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.125.0 (build fdbe357)", date="2026-01-09T10:20:13.562Z") @Stability(Stable) public class CfnTemplate extends CfnResource implements IInspectable, ITemplateRef, ITaggableV2
Creates a template in the Cases domain.

This template is used to define the case object model (that is, to define what data can be captured on cases) in a Cases domain. A template must have a unique name within a domain, and it must reference existing field IDs and layout IDs. Additionally, multiple fields with same IDs are not allowed within the same Template. A template can be either Active or Inactive, as indicated by its status. Inactive templates cannot be used to create cases.

Other template APIs are:

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.cases.*;
 CfnTemplate cfnTemplate = CfnTemplate.Builder.create(this, "MyCfnTemplate")
         .name("name")
         // the properties below are optional
         .description("description")
         .domainId("domainId")
         .layoutConfiguration(LayoutConfigurationProperty.builder()
                 .defaultLayout("defaultLayout")
                 .build())
         .requiredFields(List.of(RequiredFieldProperty.builder()
                 .fieldId("fieldId")
                 .build()))
         .rules(List.of(TemplateRuleProperty.builder()
                 .caseRuleId("caseRuleId")
                 // the properties below are optional
                 .fieldId("fieldId")
                 .build()))
         .status("status")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnTemplate

      protected CfnTemplate(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnTemplate

      protected CfnTemplate(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnTemplate

      @Stability(Stable) public CfnTemplate(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnTemplateProps props)
      Create a new AWS::Cases::Template.

      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • arnForTemplate

      @Stability(Stable) @NotNull public static String arnForTemplate(@NotNull ITemplateRef resource)
      Parameters:
      resource - This parameter is required.
    • isCfnTemplate

      @Stability(Stable) @NotNull public static Boolean isCfnTemplate(@NotNull Object x)
      Checks whether the given object is a CfnTemplate.

      Parameters:
      x - This parameter is required.
    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrCreatedTime

      @Stability(Stable) @NotNull public String getAttrCreatedTime()
      Timestamp at which the resource was created.
    • getAttrLastModifiedTime

      @Stability(Stable) @NotNull public String getAttrLastModifiedTime()
      Timestamp at which the resource was created or last modified.
    • getAttrTemplateArn

      @Stability(Stable) @NotNull public String getAttrTemplateArn()
      The Amazon Resource Name (ARN) of the template.
    • getAttrTemplateId

      @Stability(Stable) @NotNull public String getAttrTemplateId()
      A unique identifier of a template.
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTemplateRef

      @Stability(Stable) @NotNull public TemplateReference getTemplateRef()
      A reference to a Template resource.
      Specified by:
      getTemplateRef in interface ITemplateRef
    • getName

      @Stability(Stable) @NotNull public String getName()
      The template name.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      The template name.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      A brief description of the template.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      A brief description of the template.
    • getDomainId

      @Stability(Stable) @Nullable public String getDomainId()
      The unique identifier of the Cases domain.
    • setDomainId

      @Stability(Stable) public void setDomainId(@Nullable String value)
      The unique identifier of the Cases domain.
    • getLayoutConfiguration

      @Stability(Stable) @Nullable public Object getLayoutConfiguration()
      Object to store configuration of layouts associated to the template.

      Returns union: either IResolvable or CfnTemplate.LayoutConfigurationProperty

    • setLayoutConfiguration

      @Stability(Stable) public void setLayoutConfiguration(@Nullable IResolvable value)
      Object to store configuration of layouts associated to the template.
    • setLayoutConfiguration

      @Stability(Stable) public void setLayoutConfiguration(@Nullable CfnTemplate.LayoutConfigurationProperty value)
      Object to store configuration of layouts associated to the template.
    • getRequiredFields

      @Stability(Stable) @Nullable public Object getRequiredFields()
      A list of fields that must contain a value for a case to be successfully created with this template.

      Returns union: either IResolvable or Listinvalid input: '<'either IResolvable or CfnTemplate.RequiredFieldProperty>

    • setRequiredFields

      @Stability(Stable) public void setRequiredFields(@Nullable IResolvable value)
      A list of fields that must contain a value for a case to be successfully created with this template.
    • setRequiredFields

      @Stability(Stable) public void setRequiredFields(@Nullable List<Object> value)
      A list of fields that must contain a value for a case to be successfully created with this template.
    • getRules

      @Stability(Stable) @Nullable public Object getRules()
      A list of case rules (also known as case field conditions ) on a template.

      Returns union: either IResolvable or Listinvalid input: '<'either IResolvable or CfnTemplate.TemplateRuleProperty>

    • setRules

      @Stability(Stable) public void setRules(@Nullable IResolvable value)
      A list of case rules (also known as case field conditions ) on a template.
    • setRules

      @Stability(Stable) public void setRules(@Nullable List<Object> value)
      A list of case rules (also known as case field conditions ) on a template.
    • getStatus

      @Stability(Stable) @Nullable public String getStatus()
      The status of the template.
    • setStatus

      @Stability(Stable) public void setStatus(@Nullable String value)
      The status of the template.
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      An array of key-value pairs to apply to this resource.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      An array of key-value pairs to apply to this resource.