{
  "typeName" : "AWS::DirectoryService::SimpleAD",
  "description" : "Resource Type definition for AWS::DirectoryService::SimpleAD",
  "documentationUrl" : "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-directoryservice-simplead.html",
  "additionalProperties" : false,
  "definitions" : {
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "type" : "object",
      "properties" : {
        "Key" : {
          "description" : "The key name of the tag",
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128
        },
        "Value" : {
          "description" : "The value for the tag.",
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    },
    "VpcSettings" : {
      "$comment" : "Contains VPC information",
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "SubnetIds" : {
          "description" : "The identifiers of the subnets for the directory servers. The two subnets must be in different Availability Zones. AWS Directory Service specifies a directory server and a DNS server in each of these subnets.",
          "type" : "array",
          "uniqueItems" : true,
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        },
        "VpcId" : {
          "description" : "The identifier of the VPC in which to create the directory.",
          "type" : "string"
        }
      },
      "required" : [ "VpcId", "SubnetIds" ]
    }
  },
  "properties" : {
    "DirectoryId" : {
      "description" : "The unique identifier for a directory.",
      "type" : "string"
    },
    "Alias" : {
      "description" : "The alias for a directory.",
      "type" : "string"
    },
    "DnsIpAddresses" : {
      "description" : "The IP addresses of the DNS servers for the directory, such as [ \"172.31.3.154\", \"172.31.63.203\" ].",
      "type" : "array",
      "uniqueItems" : false,
      "insertionOrder" : false,
      "items" : {
        "type" : "string"
      }
    },
    "CreateAlias" : {
      "description" : "The name of the configuration set.",
      "type" : "boolean"
    },
    "Description" : {
      "description" : "Description for the directory.",
      "type" : "string"
    },
    "EnableSso" : {
      "description" : "Whether to enable single sign-on for a Simple Active Directory in AWS.",
      "type" : "boolean"
    },
    "Name" : {
      "description" : "The fully qualified domain name for the AWS Managed Simple AD directory.",
      "type" : "string"
    },
    "Password" : {
      "description" : "The password for the default administrative user named Admin.",
      "type" : "string"
    },
    "ShortName" : {
      "description" : "The NetBIOS name for your domain.",
      "type" : "string"
    },
    "Size" : {
      "description" : "The size of the directory.",
      "type" : "string"
    },
    "VpcSettings" : {
      "description" : "VPC settings of the Simple AD directory server in AWS.",
      "$ref" : "#/definitions/VpcSettings"
    },
    "Tags" : {
      "type" : "array",
      "insertionOrder" : false,
      "uniqueItems" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "required" : [ "VpcSettings", "Size", "Name" ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : false,
    "tagProperty" : "/properties/Tags",
    "permissions" : [ "ds:AddTagsToResource", "ds:RemoveTagsFromResource", "ds:ListTagsForResource" ]
  },
  "readOnlyProperties" : [ "/properties/Alias", "/properties/DnsIpAddresses", "/properties/DirectoryId" ],
  "createOnlyProperties" : [ "/properties/Size", "/properties/VpcSettings", "/properties/Name", "/properties/Password", "/properties/ShortName", "/properties/Description", "/properties/CreateAlias" ],
  "writeOnlyProperties" : [ "/properties/Password" ],
  "primaryIdentifier" : [ "/properties/DirectoryId" ],
  "handlers" : {
    "create" : {
      "permissions" : [ "ds:CreateDirectory", "ds:CreateAlias", "ds:EnableSso", "ds:DescribeDirectories", "ds:AddTagsToResource", "ds:ListTagsForResource", "ec2:DescribeSubnets", "ec2:DescribeVpcs", "ec2:CreateSecurityGroup", "ec2:CreateNetworkInterface", "ec2:DescribeNetworkInterfaces", "ec2:AuthorizeSecurityGroupIngress", "ec2:AuthorizeSecurityGroupEgress", "ec2:CreateTags", "ec2:DescribeTags", "ec2:RevokeSecurityGroupIngress", "ec2:RevokeSecurityGroupEgress" ],
      "timeoutInMinutes" : 60
    },
    "read" : {
      "permissions" : [ "ds:DescribeDirectories", "ds:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "ds:EnableSso", "ds:DisableSso", "ds:DescribeDirectories", "ds:AddTagsToResource", "ds:RemoveTagsFromResource", "ds:ListTagsForResource", "ec2:CreateTags", "ec2:DeleteTags", "ec2:DescribeTags" ]
    },
    "delete" : {
      "permissions" : [ "ds:DeleteDirectory", "ds:DescribeDirectories", "ec2:DescribeNetworkInterfaces", "ec2:DeleteSecurityGroup", "ec2:DeleteNetworkInterface", "ec2:RevokeSecurityGroupIngress", "ec2:RevokeSecurityGroupEgress", "ec2:DeleteTags" ],
      "timeoutInMinutes" : 100
    },
    "list" : {
      "permissions" : [ "ds:DescribeDirectories" ]
    }
  }
}