Skip to content

sacloud/terraform-provider-sakuracloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2a3d9ea · Feb 27, 2025
Nov 28, 2024
Nov 11, 2022
Feb 13, 2025
Mar 7, 2024
Jan 8, 2025
Feb 26, 2025
Jan 8, 2025
Feb 13, 2025
Feb 26, 2025
Nov 27, 2024
Nov 11, 2022
Feb 13, 2025
Jun 29, 2022
Jun 29, 2022
Nov 12, 2019
Feb 13, 2025
Jan 8, 2025
Nov 12, 2019
Feb 13, 2025
Feb 26, 2025
Feb 26, 2025
Jan 8, 2025

Repository files navigation

Terraform Provider for SakuraCloud

Test Status Discord

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.26.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 = "ubuntu2004"
}

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-proivder-sakuracloud Copyright (C) 2016-2023 terraform-provider-sakuraclou authors.

This project is published under Apache 2.0 License.