{
  "typeName" : "AWS::CE::CostCategory",
  "description" : "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
    }
  },
  "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
    }
  },
  "additionalProperties" : false,
  "required" : [ "Name", "RuleVersion", "Rules" ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/EffectiveStart" ],
  "createOnlyProperties" : [ "/properties/Name" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "ce:CreateCostCategoryDefinition" ]
    },
    "read" : {
      "permissions" : [ "ce:DescribeCostCategoryDefinition" ]
    },
    "update" : {
      "permissions" : [ "ce:UpdateCostCategoryDefinition" ]
    },
    "delete" : {
      "permissions" : [ "ce:DeleteCostCategoryDefinition" ]
    },
    "list" : {
      "permissions" : [ "ce:ListCostCategoryDefinitions" ]
    }
  }
}