{
  "sourceUrl" : "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-timestream.git",
  "tagging" : {
    "permissions" : [ "timestream-influxdb:TagResource", "timestream-influxdb:ListTagsForResource", "timestream-influxdb:UntagResource" ],
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "tagProperty" : "/properties/Tags",
    "cloudFormationSystemTags" : true
  },
  "handlers" : {
    "read" : {
      "permissions" : [ "timestream-influxdb:GetDbInstance", "timestream-influxdb:ListTagsForResource" ],
      "timeoutInMinutes" : 2160
    },
    "create" : {
      "permissions" : [ "s3:ListBucket", "s3:GetBucketPolicy", "timestream-influxdb:GetDbInstance", "timestream-influxdb:ListDbInstances", "timestream-influxdb:CreateDbInstance", "timestream-influxdb:TagResource", "timestream-influxdb:ListTagsForResource", "ec2:DescribeSubnets", "ec2:DescribeVpcs", "ec2:DescribeNetworkInterfaces", "ec2:DescribeSecurityGroups", "ec2:CreateNetworkInterface", "iam:CreateServiceLinkedRole" ],
      "timeoutInMinutes" : 2160
    },
    "update" : {
      "permissions" : [ "s3:ListBucket", "s3:GetBucketPolicy", "timestream-influxdb:GetDbInstance", "timestream-influxdb:ListDbInstances", "timestream-influxdb:UpdateDbInstance", "timestream-influxdb:TagResource", "timestream-influxdb:UntagResource", "timestream-influxdb:ListTagsForResource", "ec2:DescribeSubnets", "ec2:DescribeVpcs" ],
      "timeoutInMinutes" : 2160
    },
    "list" : {
      "permissions" : [ "timestream-influxdb:ListDbInstances" ],
      "timeoutInMinutes" : 2160
    },
    "delete" : {
      "permissions" : [ "timestream-influxdb:GetDbInstance", "timestream-influxdb:ListDbInstances", "timestream-influxdb:DeleteDbInstance" ],
      "timeoutInMinutes" : 2160
    }
  },
  "typeName" : "AWS::Timestream::InfluxDBInstance",
  "readOnlyProperties" : [ "/properties/Status", "/properties/Arn", "/properties/Id", "/properties/AvailabilityZone", "/properties/Endpoint", "/properties/SecondaryAvailabilityZone", "/properties/InfluxAuthParametersSecretArn", "/properties/NextMaintenanceTime" ],
  "description" : "The AWS::Timestream::InfluxDBInstance resource creates an InfluxDB instance.",
  "writeOnlyProperties" : [ "/properties/Username", "/properties/Password", "/properties/Organization", "/properties/Bucket" ],
  "createOnlyProperties" : [ "/properties/Name", "/properties/Username", "/properties/Password", "/properties/Organization", "/properties/Bucket", "/properties/VpcSubnetIds", "/properties/VpcSecurityGroupIds", "/properties/PubliclyAccessible", "/properties/NetworkType" ],
  "additionalProperties" : false,
  "primaryIdentifier" : [ "/properties/Id" ],
  "definitions" : {
    "Tag" : {
      "description" : "A key-value pair to associate with a resource.",
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Value" : {
          "minLength" : 0,
          "description" : "The value for the tag. You can specify a value that is 0 to 256 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ",
          "type" : "string",
          "maxLength" : 256
        },
        "Key" : {
          "minLength" : 1,
          "description" : "The key name of the tag. You can specify a value that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. ",
          "type" : "string",
          "maxLength" : 128
        }
      },
      "required" : [ "Key" ]
    },
    "MaintenanceSchedule" : {
      "description" : "The maintenance schedule for the InfluxDB instance.",
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Timezone" : {
          "minLength" : 1,
          "pattern" : "^(UTC|[A-Za-z_]+/[A-Za-z0-9_]+(/[A-Za-z0-9_]+)?)$",
          "description" : "The IANA timezone identifier for the maintenance schedule.",
          "type" : "string",
          "maxLength" : 64
        },
        "PreferredMaintenanceWindow" : {
          "minLength" : 0,
          "pattern" : "^$|^(Mon|Tue|Wed|Thu|Fri|Sat|Sun):([01]\\d|2[0-3]):[0-5]\\d-(Mon|Tue|Wed|Thu|Fri|Sat|Sun):([01]\\d|2[0-3]):[0-5]\\d$",
          "description" : "The preferred maintenance window in format ddd:HH:MM-ddd:HH:MM.",
          "type" : "string",
          "maxLength" : 19
        }
      },
      "required" : [ "Timezone", "PreferredMaintenanceWindow" ]
    }
  },
  "properties" : {
    "Organization" : {
      "minLength" : 1,
      "description" : "The organization for the InfluxDB instance.",
      "type" : "string",
      "maxLength" : 64
    },
    "InfluxAuthParametersSecretArn" : {
      "pattern" : "^arn:[a-z]*:secretsmanager:[a-z\\-0-9]*:[0-9]*:secret:[a-zA-Z0-9\\-]*",
      "description" : "The Auth parameters secret Amazon Resource name (ARN) that is associated with the InfluxDB instance.",
      "type" : "string"
    },
    "Port" : {
      "maximum" : 65535,
      "description" : "The port number on which InfluxDB accepts connections.",
      "type" : "integer",
      "minimum" : 1024
    },
    "DbInstanceType" : {
      "description" : "The compute instance of the InfluxDB instance.",
      "type" : "string",
      "enum" : [ "db.influx.medium", "db.influx.large", "db.influx.xlarge", "db.influx.2xlarge", "db.influx.4xlarge", "db.influx.8xlarge", "db.influx.12xlarge", "db.influx.16xlarge", "db.influx.24xlarge" ]
    },
    "VpcSubnetIds" : {
      "minItems" : 1,
      "maxItems" : 3,
      "description" : "A list of EC2 subnet IDs for this InfluxDB instance.",
      "insertionOrder" : false,
      "type" : "array",
      "items" : {
        "type" : "string"
      }
    },
    "DeploymentType" : {
      "description" : "Deployment type of the InfluxDB Instance.",
      "type" : "string",
      "enum" : [ "SINGLE_AZ", "WITH_MULTIAZ_STANDBY" ]
    },
    "Name" : {
      "minLength" : 3,
      "pattern" : "^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9]+)*$",
      "description" : "The unique name that is associated with the InfluxDB instance.",
      "type" : "string",
      "maxLength" : 40
    },
    "Endpoint" : {
      "description" : "The connection endpoint for the InfluxDB instance.",
      "type" : "string"
    },
    "VpcSecurityGroupIds" : {
      "minItems" : 1,
      "maxItems" : 5,
      "description" : "A list of Amazon EC2 VPC security groups to associate with this InfluxDB instance.",
      "insertionOrder" : false,
      "type" : "array",
      "items" : {
        "type" : "string"
      }
    },
    "NetworkType" : {
      "description" : "Network type of the InfluxDB Instance.",
      "type" : "string",
      "enum" : [ "IPV4", "DUAL" ]
    },
    "NextMaintenanceTime" : {
      "format" : "date-time",
      "description" : "The timestamp of the next scheduled maintenance event.",
      "type" : "string"
    },
    "Tags" : {
      "minItems" : 1,
      "maxItems" : 200,
      "uniqueItems" : true,
      "description" : "An arbitrary set of tags (key-value pairs) for this DB instance.",
      "insertionOrder" : false,
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    },
    "Password" : {
      "minLength" : 8,
      "pattern" : "^[a-zA-Z0-9]+$",
      "description" : "The password for the InfluxDB instance.",
      "type" : "string",
      "maxLength" : 64
    },
    "DbParameterGroupIdentifier" : {
      "minLength" : 3,
      "pattern" : "^[a-zA-Z0-9]+$",
      "description" : "The name of an existing InfluxDB parameter group.",
      "type" : "string",
      "maxLength" : 64
    },
    "Status" : {
      "description" : "Status of the InfluxDB Instance.",
      "type" : "string",
      "enum" : [ "CREATING", "AVAILABLE", "DELETING", "MODIFYING", "MAINTENANCE", "UPDATING", "UPDATING_DEPLOYMENT_TYPE", "UPDATING_INSTANCE_TYPE", "REBOOTING", "REBOOT_FAILED", "DELETED", "FAILED" ]
    },
    "AvailabilityZone" : {
      "description" : "The Availability Zone (AZ) where the InfluxDB instance is created.",
      "type" : "string"
    },
    "AllocatedStorage" : {
      "maximum" : 16384,
      "description" : "The allocated storage for the InfluxDB instance.",
      "type" : "integer",
      "minimum" : 20
    },
    "DbStorageType" : {
      "description" : "The storage type of the InfluxDB instance.",
      "type" : "string",
      "enum" : [ "InfluxIOIncludedT1", "InfluxIOIncludedT2", "InfluxIOIncludedT3" ]
    },
    "LogDeliveryConfiguration" : {
      "description" : "Configuration for sending logs to customer account from the InfluxDB instance.",
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "S3Configuration" : {
          "description" : "S3 configuration for sending logs to customer account from the InfluxDB instance.",
          "additionalProperties" : false,
          "type" : "object",
          "properties" : {
            "BucketName" : {
              "minLength" : 3,
              "pattern" : "^[0-9a-z]+[0-9a-z\\.\\-]*[0-9a-z]+$",
              "description" : "The bucket name for logs to be sent from the InfluxDB instance",
              "type" : "string",
              "maxLength" : 63
            },
            "Enabled" : {
              "description" : "Specifies whether logging to customer specified bucket is enabled.",
              "type" : "boolean"
            }
          },
          "required" : [ "Enabled", "BucketName" ]
        }
      },
      "required" : [ "S3Configuration" ]
    },
    "Username" : {
      "minLength" : 1,
      "description" : "The username for the InfluxDB instance.",
      "type" : "string",
      "maxLength" : 64
    },
    "Bucket" : {
      "minLength" : 2,
      "pattern" : "^[^_][^\"]*$",
      "description" : "The bucket for the InfluxDB instance.",
      "type" : "string",
      "maxLength" : 64
    },
    "PubliclyAccessible" : {
      "default" : false,
      "description" : "Attach a public IP to the customer ENI.",
      "type" : "boolean"
    },
    "SecondaryAvailabilityZone" : {
      "description" : "The Secondary Availability Zone (AZ) where the InfluxDB instance is created, if DeploymentType is set as WITH_MULTIAZ_STANDBY.",
      "type" : "string"
    },
    "Id" : {
      "minLength" : 3,
      "pattern" : "^[a-zA-Z0-9]+$",
      "description" : "The service generated unique identifier for InfluxDB instance.",
      "type" : "string",
      "maxLength" : 64
    },
    "Arn" : {
      "minLength" : 1,
      "pattern" : "^arn:aws[a-z\\-]*:timestream\\-influxdb:[a-z0-9\\-]+:[0-9]{12}:(db\\-instance)/[a-zA-Z0-9]{3,64}$",
      "description" : "The Amazon Resource Name (ARN) that is associated with the InfluxDB instance.",
      "type" : "string",
      "maxLength" : 1011
    },
    "MaintenanceSchedule" : {
      "description" : "The maintenance schedule for the InfluxDB instance.",
      "$ref" : "#/definitions/MaintenanceSchedule"
    }
  }
}