{
  "typeName" : "AWS::PCS::Queue",
  "description" : "AWS::PCS::Queue resource creates an AWS PCS queue.",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-pcs.git",
  "definitions" : {
    "ComputeNodeGroupConfiguration" : {
      "type" : "object",
      "description" : "The compute node group configuration for a queue.",
      "properties" : {
        "ComputeNodeGroupId" : {
          "type" : "string",
          "description" : "The compute node group ID for the compute node group configuration."
        }
      },
      "additionalProperties" : false
    },
    "ErrorInfo" : {
      "type" : "object",
      "description" : "An error that occurred during resource provisioning.",
      "properties" : {
        "Code" : {
          "type" : "string",
          "description" : "The short-form error code."
        },
        "Message" : {
          "type" : "string",
          "description" : "The detailed error information."
        }
      },
      "additionalProperties" : false
    },
    "SlurmCustomSetting" : {
      "type" : "object",
      "description" : "Additional settings that directly map to Slurm settings.",
      "properties" : {
        "ParameterName" : {
          "type" : "string",
          "description" : "AWS PCS supports configuration of the Slurm parameters for queues:."
        },
        "ParameterValue" : {
          "type" : "string",
          "description" : "The value for the configured Slurm setting."
        }
      },
      "additionalProperties" : false,
      "required" : [ "ParameterName", "ParameterValue" ]
    }
  },
  "properties" : {
    "Arn" : {
      "type" : "string",
      "description" : "The unique Amazon Resource Name (ARN) of the queue.",
      "pattern" : "^(.*?)"
    },
    "ClusterId" : {
      "type" : "string",
      "description" : "The ID of the cluster of the queue."
    },
    "ComputeNodeGroupConfigurations" : {
      "type" : "array",
      "description" : "The list of compute node group configurations associated with the queue. Queues assign jobs to associated compute node groups.",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/ComputeNodeGroupConfiguration"
      }
    },
    "ErrorInfo" : {
      "type" : "array",
      "description" : "The list of errors that occurred during queue provisioning.",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/ErrorInfo"
      }
    },
    "Id" : {
      "type" : "string",
      "description" : "The generated unique ID of the queue."
    },
    "Name" : {
      "type" : "string",
      "description" : "The name that identifies the queue."
    },
    "SlurmConfiguration" : {
      "type" : "object",
      "description" : "The Slurm configuration for the queue.",
      "properties" : {
        "SlurmCustomSettings" : {
          "type" : "array",
          "description" : "Custom Slurm parameters that directly map to Slurm configuration settings.",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/SlurmCustomSetting"
          }
        }
      },
      "additionalProperties" : false
    },
    "Status" : {
      "type" : "string",
      "description" : "The provisioning status of the queue. The provisioning status doesn't indicate the overall health of the queue.",
      "enum" : [ "CREATING", "ACTIVE", "UPDATING", "DELETING", "CREATE_FAILED", "DELETE_FAILED", "UPDATE_FAILED" ]
    },
    "Tags" : {
      "type" : "object",
      "description" : "1 or more tags added to the resource. Each tag consists of a tag key and tag value. The tag value is optional and can be an empty string.",
      "patternProperties" : {
        "^.+$" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    }
  },
  "required" : [ "ClusterId" ],
  "additionalProperties" : false,
  "primaryIdentifier" : [ "/properties/Arn" ],
  "createOnlyProperties" : [ "/properties/Name", "/properties/ClusterId" ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/ErrorInfo", "/properties/Id", "/properties/Status" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "ec2:CreateNetworkInterface", "ec2:DescribeVpcs", "ec2:DescribeSubnets", "ec2:DescribeSecurityGroups", "ec2:GetSecurityGroupsForVpc", "iam:CreateServiceLinkedRole", "secretsmanager:CreateSecret", "secretsmanager:TagResource", "pcs:CreateQueue", "pcs:GetQueue", "pcs:ListTagsForResource", "pcs:TagResource" ],
      "timeoutInMinutes" : 60
    },
    "read" : {
      "permissions" : [ "pcs:GetQueue", "pcs:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "pcs:GetQueue", "pcs:UpdateQueue", "pcs:ListTagsForResource", "pcs:TagResource", "pcs:UntagResource" ],
      "timeoutInMinutes" : 60
    },
    "delete" : {
      "permissions" : [ "pcs:DeleteQueue", "pcs:GetQueue" ],
      "timeoutInMinutes" : 60
    },
    "list" : {
      "handlerSchema" : {
        "properties" : {
          "ClusterId" : {
            "$ref" : "resource-schema.json#/properties/ClusterId"
          }
        },
        "required" : [ "ClusterId" ]
      },
      "permissions" : [ "pcs:ListClusters", "pcs:ListQueues" ]
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "pcs:TagResource", "pcs:ListTagsForResource", "pcs:UntagResource" ]
  }
}