Skip to content

sacloud/terraform-provider-sakuracloud

Repository files navigation

Terraform Provider for SakuraCloud

Test Status Discord

Important

さくらのクラウド向けTerraformプロバイダーはv3が最新となります。
v3: https://github.com/sacloud/terraform-provider-sakura

v2は2026年12月末をもってメンテナンスを終了します。
2027年1月以降、新機能追加、不具合修正、既存リソースの改善対応は原則として行いません。
既存のバージョンが直ちに利用できなくなるわけではありませんが、今後のサービスの変更等により影響を受ける可能性があります。
継続的かつ安定した運用のためにはv3への移行をご検討ください。

詳細は以下を参照してください。

バージョン情報:

バージョン ステータス 説明
v3 現行バージョン 最新の機能追加・変更はここで行われます
v2 メンテナンス終了予定(2026年12月末) 2027年1月以降、原則として修正対応は行いません
v1 EOL サポート終了

Usage Example

# Configure the SakuraCloud Provider
terraform {
  required_providers {
    sakuracloud = {
      source = "sacloud/sakuracloud"

      # We recommend pinning to the specific version of the SakuraCloud Provider you're using
      # since new versions are released frequently
      version = "2.36.1"
      #version = "~> 2"
    }
  }
}
provider "sakuracloud" {
  # More information on the authentication methods supported by
  # the SakuraCloud Provider can be found here:
  # https://docs.usacloud.jp/terraform/provider/

  # profile = "..."
}

variable password {}

data "sakuracloud_archive" "ubuntu" {
  os_type = "ubuntu"
}

resource "sakuracloud_disk" "example" {
  name              = "example"
  source_archive_id = data.sakuracloud_archive.ubuntu.id

  # If you want to prevent re-creation of the disk
  # when archive id is changed, please uncomment this.
  # lifecycle {
  #   ignore_changes = [
  #     source_archive_id,
  #   ]
  # }
}

resource "sakuracloud_server" "example" {
  name        = "example"
  disks       = [sakuracloud_disk.example.id]
  core        = 1
  memory      = 2
  description = "description"
  tags        = ["app=web", "stage=staging"]

  network_interface {
    upstream = "shared"
  }

  disk_edit_parameter {
    hostname        = "example"
    password        = var.password
  }
}

Requirements

License

terraform-provider-sakuracloud Copyright (C) 2016-2023 terraform-provider-sakuracloud authors.

This project is published under Apache 2.0 License.

About

Terraform provider for SakuraCloud

Topics

Resources

License

Contributing

Security policy

Stars

95 stars

Watchers

8 watching

Forks

Packages

 
 
 

Contributors

Languages