variable "instance_type" {
  description = "EC2 instance type"
  type        = string
  default     = "t3.large"
}

variable "subnet_id" {
  description = "ID of the private app subnet for the EC2 instance"
  type        = string
}

variable "security_group_id" {
  description = "ID of the security group to attach to the EC2 instance"
  type        = string
}

variable "project" {
  description = "Project name used for resource naming and tagging"
  type        = string
}

variable "environment" {
  description = "Environment name (e.g. dev, staging, prod)"
  type        = string
}

variable "key_name" {
  description = "Name of the EC2 key pair for SSH access (optional)"
  type        = string
  default     = null
}

variable "state_bucket_arn" {
  description = "ARN of the S3 bucket used for deploy assets"
  type        = string
}

variable "uploads_bucket_arn" {
  description = "ARN of the S3 bucket used for application uploads and self-service artifacts"
  type        = string

  validation {
    condition     = can(regex("^arn:[^:]+:s3:::[^/]+$", var.uploads_bucket_arn))
    error_message = "uploads_bucket_arn must be an S3 bucket ARN without an object suffix."
  }
}

variable "ecr_arns" {
  description = "ECR repository ARNs the application host may pull"
  type        = list(string)
}
