# DigitalOcean Provider 配置

terraform {
  required_providers {
    digitalocean = {
      source  = "digitalocean/digitalocean"
      version = "~> 2.0"
    }
  }
}

# DigitalOcean 提供者配置
provider "digitalocean" {
  token = var.do_config.token
}

# 创建 DigitalOcean Droplet 示例
resource "digitalocean_droplet" "web" {
  image  = "ubuntu-22-04-x64"
  name   = "web-1"
  region = var.do_config.region
  size   = "s-1vcpu-1gb"
  
  tags = ["web", "mgmt"]
}