{
  "typeName" : "AWS::CE::CostCategory",
  "description" : "Resource Type definition for AWS::CE::CostCategory. Cost Category enables you to map your cost and usage into meaningful categories. You can use Cost Category to organize your costs using a rule-based engine.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-cost-explorer.git",
  "definitions" : {
    "ZonedDateTime" : {
      "description" : "ISO 8601 date time with offset format",
      "type" : "string",
      "pattern" : "^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d(([+-]\\d\\d:\\d\\d)|Z)$",
      "minLength" : 20,
      "maxLength" : 25
    },
    "ResourceTag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The key name for the tag.",
          "pattern" : "^(?!aws:).*$",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "description" : "The value for the tag.",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ]
    }
  },
  "properties" : {
    "Arn" : {
      "description" : "Cost category ARN",
      "type" : "string",
      "pattern" : "^arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$"
    },
    "EffectiveStart" : {
      "$ref" : "#/definitions/ZonedDateTime"
    },
    "Name" : {
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 50
    },
    "RuleVersion" : {
      "type" : "string",
      "enum" : [ "CostCategoryExpression.v1" ]
    },
    "Rules" : {
      "type" : "string",
      "description" : "JSON array format of Expression in Billing and Cost Management API"
    },
    "SplitChargeRules" : {
      "type" : "string",
      "description" : "Json array format of CostCategorySplitChargeRule in Billing and Cost Management API"
    },
    "DefaultValue" : {
      "type" : "string",
      "description" : "The default value for the cost category",
      "minLength" : 1,
      "maxLength" : 50
    },
    "Tags" : {
      "type" : "array",
      "description" : "Tags to assign to the cost category.",
      "items" : {
        "$ref" : "#/definitions/ResourceTag"
      },
      "minItems" : 0,
      "maxItems" : 200,
      "insertionOrder" : false
    }
  },
  "additionalProperties" : false,
  "required" : [ "Name", "RuleVersion", "Rules" ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/EffectiveStart" ],
  "createOnlyProperties" : [ "/properties/Name" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "ce:CreateCostCategoryDefinition", "ce:TagResource" ]
    },
    "read" : {
      "permissions" : [ "ce:DescribeCostCategoryDefinition", "ce:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "ce:UpdateCostCategoryDefinition", "ce:TagResource", "ce:UntagResource" ]
    },
    "delete" : {
      "permissions" : [ "ce:DeleteCostCategoryDefinition" ]
    },
    "list" : {
      "permissions" : [ "ce:ListCostCategoryDefinitions" ]
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "ce:TagResource", "ce:UntagResource", "ce:ListTagsForResource" ]
  }
}