{
  "typeName" : "AWS::S3Files::AccessPoint",
  "description" : "Resource Type definition for AWS::S3Files::AccessPoint",
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
  "definitions" : {
    "AccessPointTag" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "type" : "string",
          "maxLength" : 256
        }
      },
      "additionalProperties" : false
    },
    "CreationPermissions" : {
      "type" : "object",
      "properties" : {
        "OwnerUid" : {
          "type" : "string",
          "description" : "Specifies the POSIX user ID to apply to the RootDirectory. Accepts values from 0 to 2^32 (4294967295).",
          "pattern" : "^[0-9]+$"
        },
        "OwnerGid" : {
          "type" : "string",
          "description" : "Specifies the POSIX group ID to apply to the RootDirectory. Accepts values from 0 to 2^32 (4294967295).",
          "pattern" : "^[0-9]+$"
        },
        "Permissions" : {
          "type" : "string",
          "description" : "Specifies the POSIX permissions to apply to the RootDirectory, in the format of an octal number representing the file's mode bits.",
          "pattern" : "^[0-7]{3,4}$"
        }
      },
      "required" : [ "OwnerUid", "OwnerGid", "Permissions" ],
      "additionalProperties" : false
    },
    "RootDirectory" : {
      "type" : "object",
      "properties" : {
        "Path" : {
          "type" : "string",
          "description" : "Specifies the path on the EFS file system to expose as the root directory to NFS clients using the access point to access the EFS file system. A path can have up to four subdirectories. If the specified path does not exist, you are required to provide the CreationPermissions.",
          "minLength" : 1,
          "maxLength" : 100,
          "pattern" : "^(\\/|(\\/(?!\\.)+[^$#<>;;`|&?{}^*/\\n]+){1,4})$"
        },
        "CreationPermissions" : {
          "description" : "(Optional) Specifies the POSIX IDs and permissions to apply to the access point's RootDirectory. If the RootDirectory>Path specified does not exist, EFS creates the root directory using the CreationPermissions settings when a client connects to an access point. When specifying the CreationPermissions, you must provide values for all properties.   If you do not provide CreationPermissions and the specified RootDirectory>Path does not exist, attempts to mount the file system using the access point will fail. ",
          "$ref" : "#/definitions/CreationPermissions"
        }
      },
      "additionalProperties" : false
    },
    "PosixUser" : {
      "type" : "object",
      "properties" : {
        "Uid" : {
          "type" : "string",
          "description" : "The POSIX user ID used for all file system operations using this access point.",
          "pattern" : "^[0-9]+$"
        },
        "Gid" : {
          "type" : "string",
          "description" : "The POSIX group ID used for all file system operations using this access point.",
          "pattern" : "^[0-9]+$"
        },
        "SecondaryGids" : {
          "type" : "array",
          "description" : "Secondary POSIX group IDs used for all file system operations using this access point.",
          "items" : {
            "type" : "string",
            "pattern" : "^[0-9]+$"
          }
        }
      },
      "required" : [ "Uid", "Gid" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "AccessPointId" : {
      "type" : "string",
      "pattern" : "^(arn:aws[-a-z]*:s3files:[0-9a-z-:]+:file-system/fs-[0-9a-f]{17,40}/access-point/fsap-[0-9a-f]{17,40}|fsap-[0-9a-f]{17,40})$",
      "maxLength" : 256
    },
    "AccessPointArn" : {
      "type" : "string",
      "maxLength" : 256,
      "pattern" : "^arn:aws[-a-z]*:s3files:[0-9a-z-:]+:file-system/fs-[0-9a-f]{17,40}/access-point/fsap-[0-9a-f]{17,40}$"
    },
    "ClientToken" : {
      "description" : "(optional) A string of up to 64 ASCII characters that Amazon EFS uses to ensure idempotent creation.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 64,
      "pattern" : "^(.+)$"
    },
    "Tags" : {
      "type" : "array",
      "insertionOrder" : false,
      "uniqueItems" : true,
      "maxItems" : 50,
      "items" : {
        "$ref" : "#/definitions/AccessPointTag"
      }
    },
    "FileSystemId" : {
      "description" : "The ID of the S3 Files file system that the access point provides access to.",
      "type" : "string",
      "pattern" : "^(arn:aws[-a-z]*:s3files:[0-9a-z-:]+:file-system/fs-[0-9a-f]{17,40}|fs-[0-9a-f]{17,40})$",
      "maxLength" : 128
    },
    "PosixUser" : {
      "description" : "The operating system user and group applied to all compute drive requests made using the access point.",
      "$ref" : "#/definitions/PosixUser"
    },
    "RootDirectory" : {
      "description" : "Specifies the directory on the Amazon EFS file system that the access point exposes as the root directory of your file system to NFS clients using the access point. The clients using the access point can only access the root directory and below. If the RootDirectory>Path specified does not exist, EFS creates it and applies the CreationPermissions settings when a client connects to an access point. When specifying a RootDirectory, you need to provide the Path, and the CreationPermissions is optional.",
      "$ref" : "#/definitions/RootDirectory"
    },
    "Status" : {
      "type" : "string",
      "enum" : [ "available", "creating", "updating", "deleting", "deleted", "error" ]
    },
    "OwnerId" : {
      "type" : "string",
      "maxLength" : 12,
      "pattern" : "^((\\d{12})|(\\d{4}-\\d{4}-\\d{4}))$"
    }
  },
  "additionalProperties" : false,
  "required" : [ "FileSystemId" ],
  "primaryIdentifier" : [ "/properties/AccessPointId" ],
  "createOnlyProperties" : [ "/properties/FileSystemId", "/properties/ClientToken", "/properties/PosixUser", "/properties/PosixUser/Uid", "/properties/PosixUser/Gid", "/properties/PosixUser/SecondaryGids", "/properties/RootDirectory", "/properties/RootDirectory/Path", "/properties/RootDirectory/CreationPermissions", "/properties/RootDirectory/CreationPermissions/OwnerUid", "/properties/RootDirectory/CreationPermissions/OwnerGid", "/properties/RootDirectory/CreationPermissions/Permissions" ],
  "readOnlyProperties" : [ "/properties/AccessPointId", "/properties/AccessPointArn", "/properties/Status", "/properties/OwnerId" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "s3files:TagResource", "s3files:ListTagsForResource", "s3files:UntagResource" ]
  },
  "propertyTransform" : {
    "/properties/FileSystemId" : "$split(FileSystemId, \"/\")[-1] $OR FileSystemId"
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "s3files:CreateAccessPoint", "s3files:TagResource", "s3files:GetAccessPoint" ]
    },
    "read" : {
      "permissions" : [ "s3files:GetAccessPoint", "s3files:ListTagsForResource" ]
    },
    "delete" : {
      "permissions" : [ "s3files:DeleteAccessPoint", "s3files:GetAccessPoint" ]
    },
    "list" : {
      "handlerSchema" : {
        "properties" : {
          "FileSystemId" : {
            "$ref" : "resource-schema.json#/properties/FileSystemId"
          }
        },
        "required" : [ "FileSystemId" ]
      },
      "permissions" : [ "s3files:ListAccessPoints" ]
    },
    "update" : {
      "permissions" : [ "s3files:GetAccessPoint", "s3files:ListTagsForResource", "s3files:TagResource", "s3files:UntagResource" ]
    }
  }
}