{
  "typeName" : "AWS::Transfer::Agreement",
  "description" : "Resource Type definition for AWS::Transfer::Agreement",
  "definitions" : {
    "Tag" : {
      "description" : "Creates a key-value pair for a specific resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "description" : "The name assigned to the tag that you create.",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "description" : "Contains one or more values that you assigned to the key name you create.",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "Description" : {
      "description" : "A textual description for the agreement.",
      "type" : "string",
      "pattern" : "^[\\w\\- ]*$",
      "minLength" : 1,
      "maxLength" : 200
    },
    "ServerId" : {
      "description" : "A unique identifier for the server.",
      "type" : "string",
      "pattern" : "^s-([0-9a-f]{17})$",
      "minLength" : 19,
      "maxLength" : 19
    },
    "LocalProfileId" : {
      "description" : "A unique identifier for the local profile.",
      "type" : "string",
      "pattern" : "^p-([0-9a-f]{17})$",
      "minLength" : 19,
      "maxLength" : 19
    },
    "PartnerProfileId" : {
      "description" : "A unique identifier for the partner profile.",
      "type" : "string",
      "pattern" : "^p-([0-9a-f]{17})$",
      "minLength" : 19,
      "maxLength" : 19
    },
    "BaseDirectory" : {
      "description" : "Specifies the base directory for the agreement.",
      "type" : "string",
      "pattern" : "^$|/.*",
      "maxLength" : 1024
    },
    "AccessRole" : {
      "description" : "Specifies the access role for the agreement.",
      "type" : "string",
      "pattern" : "arn:.*role/.*",
      "minLength" : 20,
      "maxLength" : 2048
    },
    "Status" : {
      "description" : "Specifies the status of the agreement.",
      "type" : "string",
      "enum" : [ "ACTIVE", "INACTIVE" ]
    },
    "Tags" : {
      "description" : "Key-value pairs that can be used to group and search for agreements. Tags are metadata attached to agreements for any purpose.",
      "type" : "array",
      "maxItems" : 50,
      "uniqueItems" : true,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "AgreementId" : {
      "description" : "A unique identifier for the agreement.",
      "type" : "string",
      "pattern" : "^a-([0-9a-f]{17})$",
      "minLength" : 19,
      "maxLength" : 19
    },
    "Arn" : {
      "description" : "Specifies the unique Amazon Resource Name (ARN) for the agreement.",
      "type" : "string",
      "pattern" : "arn:.*",
      "minLength" : 20,
      "maxLength" : 1600
    }
  },
  "additionalProperties" : false,
  "required" : [ "ServerId", "LocalProfileId", "PartnerProfileId", "BaseDirectory", "AccessRole" ],
  "readOnlyProperties" : [ "/properties/AgreementId", "/properties/Arn" ],
  "createOnlyProperties" : [ "/properties/ServerId" ],
  "primaryIdentifier" : [ "/properties/AgreementId", "/properties/ServerId" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags"
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "transfer:CreateAgreement", "transfer:TagResource", "iam:PassRole" ]
    },
    "read" : {
      "permissions" : [ "transfer:DescribeAgreement" ]
    },
    "update" : {
      "permissions" : [ "transfer:UpdateAgreement", "transfer:UnTagResource", "transfer:TagResource", "iam:PassRole" ]
    },
    "delete" : {
      "permissions" : [ "transfer:DeleteAgreement" ]
    },
    "list" : {
      "permissions" : [ "transfer:ListAgreements" ]
    }
  }
}