{
  "typeName" : "AWS::Transfer::WebApp",
  "description" : "Resource Type definition for AWS::Transfer::WebApp",
  "definitions" : {
    "EndpointDetails" : {
      "type" : "object",
      "properties" : {
        "Vpc" : {
          "$ref" : "#/definitions/Vpc"
        }
      },
      "additionalProperties" : false
    },
    "Vpc" : {
      "type" : "object",
      "description" : "You can provide a structure that contains the details for the VPC endpoint to use with your web app.",
      "properties" : {
        "SubnetIds" : {
          "type" : "array",
          "maxItems" : 10,
          "insertionOrder" : true,
          "items" : {
            "type" : "string",
            "maxLength" : 24,
            "minLength" : 15,
            "pattern" : "^subnet-[0-9a-f]{8,17}$"
          }
        },
        "VpcId" : {
          "type" : "string",
          "maxLength" : 21,
          "minLength" : 12,
          "pattern" : "^vpc-[0-9a-f]{8,17}$"
        },
        "SecurityGroupIds" : {
          "type" : "array",
          "maxItems" : 10,
          "insertionOrder" : false,
          "items" : {
            "type" : "string",
            "maxLength" : 20,
            "minLength" : 11,
            "pattern" : "^sg-[0-9a-f]{8,17}$"
          }
        },
        "IpAddressType" : {
          "type" : "string",
          "description" : "The IP address type for the VPC endpoint used by the web app.",
          "enum" : [ "IPV4", "DUALSTACK" ]
        }
      },
      "additionalProperties" : false
    },
    "IdentityProviderDetails" : {
      "type" : "object",
      "description" : "You can provide a structure that contains the details for the identity provider to use with your web app.",
      "properties" : {
        "ApplicationArn" : {
          "type" : "string",
          "maxLength" : 1224,
          "minLength" : 10,
          "pattern" : "^arn:[\\w-]+:sso::\\d{12}:application/(sso)?ins-[a-zA-Z0-9-.]{16}/apl-[a-zA-Z0-9]{16}$"
        },
        "InstanceArn" : {
          "type" : "string",
          "description" : "The Amazon Resource Name (ARN) for the IAM Identity Center used for the web app.",
          "maxLength" : 1224,
          "minLength" : 10,
          "pattern" : "^arn:[\\w-]+:sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}$"
        },
        "Role" : {
          "type" : "string",
          "description" : "The IAM role in IAM Identity Center used for the web app.",
          "maxLength" : 2048,
          "minLength" : 20,
          "pattern" : "^arn:[a-z-]+:iam::[0-9]{12}:role[:/]\\S+$"
        }
      },
      "additionalProperties" : false
    },
    "Tag" : {
      "type" : "object",
      "description" : "Key-value pair that can be used to group and search for web apps.",
      "properties" : {
        "Key" : {
          "type" : "string",
          "maxLength" : 128,
          "minLength" : 0
        },
        "Value" : {
          "type" : "string",
          "maxLength" : 256,
          "minLength" : 0
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "WebAppCustomization" : {
      "type" : "object",
      "properties" : {
        "Title" : {
          "description" : "Specifies a title to display on the web app.",
          "type" : "string",
          "maxLength" : 100,
          "minLength" : 0
        },
        "LogoFile" : {
          "description" : "Specifies a logo to display on the web app.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 51200
        },
        "FaviconFile" : {
          "description" : "Specifies a favicon to display in the browser tab.",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 20960
        }
      },
      "additionalProperties" : false
    },
    "WebAppEndpointPolicy" : {
      "type" : "string",
      "enum" : [ "STANDARD", "FIPS" ]
    },
    "WebAppUnits" : {
      "oneOf" : [ {
        "type" : "object",
        "description" : "A union that contains the value for number of concurrent connections or the user sessions on your web app.",
        "title" : "Provisioned",
        "properties" : {
          "Provisioned" : {
            "type" : "integer",
            "minimum" : 1
          }
        },
        "required" : [ "Provisioned" ],
        "additionalProperties" : false
      } ]
    }
  },
  "properties" : {
    "Arn" : {
      "description" : "Specifies the unique Amazon Resource Name (ARN) for the web app.",
      "type" : "string",
      "pattern" : "arn:.*",
      "minLength" : 20,
      "maxLength" : 1600
    },
    "WebAppId" : {
      "description" : "A unique identifier for the web app.",
      "type" : "string",
      "pattern" : "^webapp-([0-9a-f]{17})$",
      "minLength" : 24,
      "maxLength" : 24
    },
    "IdentityProviderDetails" : {
      "$ref" : "#/definitions/IdentityProviderDetails"
    },
    "EndpointDetails" : {
      "$ref" : "#/definitions/EndpointDetails"
    },
    "AccessEndpoint" : {
      "description" : "The AccessEndpoint is the URL that you provide to your users for them to interact with the Transfer Family web app. You can specify a custom URL or use the default value.",
      "type" : "string",
      "minLength" : 1,
      "maxLength" : 1024
    },
    "VpcEndpointId" : {
      "type" : "string",
      "maxLength" : 22,
      "minLength" : 13,
      "pattern" : "^vpce-[0-9a-f]{8,17}$"
    },
    "WebAppUnits" : {
      "$ref" : "#/definitions/WebAppUnits"
    },
    "WebAppCustomization" : {
      "$ref" : "#/definitions/WebAppCustomization"
    },
    "WebAppEndpointPolicy" : {
      "$ref" : "#/definitions/WebAppEndpointPolicy"
    },
    "Tags" : {
      "type" : "array",
      "description" : "Key-value pairs that can be used to group and search for web apps.",
      "maxItems" : 50,
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "additionalProperties" : false,
  "required" : [ "IdentityProviderDetails" ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/WebAppId", "/properties/IdentityProviderDetails/ApplicationArn", "/properties/VpcEndpointId" ],
  "createOnlyProperties" : [ "/properties/WebAppEndpointPolicy", "/properties/IdentityProviderDetails/InstanceArn", "/properties/EndpointDetails/Vpc/VpcId", "/properties/EndpointDetails/Vpc/SecurityGroupIds" ],
  "writeOnlyProperties" : [ "/properties/EndpointDetails/Vpc/SecurityGroupIds", "/properties/EndpointDetails/Vpc/IpAddressType" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "additionalIdentifiers" : [ [ "/properties/WebAppId" ] ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "transfer:TagResource", "transfer:UnTagResource", "transfer:ListTagsForResource" ]
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "transfer:CreateWebApp", "transfer:DescribeWebApp", "transfer:DescribeWebAppCustomization", "transfer:TagResource", "transfer:UpdateWebAppCustomization", "iam:PassRole", "sso:CreateApplication", "sso:DescribeApplication", "sso:ListApplications", "sso:PutApplicationGrant", "sso:GetApplicationGrant", "sso:ListApplicationGrants", "sso:PutApplicationAuthenticationMethod", "sso:GetApplicationAuthenticationMethod", "sso:ListApplicationAuthenticationMethods", "sso:PutApplicationAccessScope", "sso:GetApplicationAccessScope", "sso:ListApplicationAccessScopes", "ec2:CreateVpcEndpoint", "ec2:DescribeVpcEndpoints" ]
    },
    "read" : {
      "permissions" : [ "transfer:DescribeWebApp", "transfer:DescribeWebAppCustomization" ]
    },
    "update" : {
      "permissions" : [ "transfer:DescribeWebApp", "transfer:DescribeWebAppCustomization", "transfer:UpdateWebApp", "transfer:UpdateWebAppCustomization", "transfer:DeleteWebAppCustomization", "transfer:UnTagResource", "transfer:TagResource", "iam:PassRole", "sso:PutApplicationGrant", "sso:GetApplicationGrant", "sso:ListApplicationGrants", "sso:UpdateApplication", "sso:DescribeApplication", "sso:ListApplications", "ec2:DescribeVpcEndpoints", "ec2:ModifyVpcEndpoint" ]
    },
    "delete" : {
      "permissions" : [ "transfer:DeleteWebApp", "sso:DescribeApplication", "sso:DeleteApplication", "ec2:DescribeVpcEndpoints", "ec2:DeleteVpcEndpoints" ]
    },
    "list" : {
      "permissions" : [ "transfer:ListWebApps" ]
    }
  }
}