This is a Terraform based project for the deployment of Debian and CentOS servers, for the purposes of my LPI classes. Scaleway is used at the provider in this scenario.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

42 行
958B

  1. provider "scaleway" {
  2. organization = "${var.organization}"
  3. token = "${var.token}"
  4. region = "${var.region}"
  5. }
  6. resource "scaleway_ip" "debian_ip" {
  7. count = "${var.count}"
  8. server = "${element(scaleway_server.debian.*.id, count.index)}"
  9. }
  10. resource "scaleway_ip" "centos_ip" {
  11. count = "${var.count}"
  12. server = "${element(scaleway_server.centos.*.id, count.index)}"
  13. }
  14. resource "scaleway_server" "debian" {
  15. count = "${var.count}"
  16. name = "${var.server_name["debian"]}-${count.index}.theo-andreou.org"
  17. image = "${var.images["debian"]}"
  18. type = "${var.type}"
  19. tags = [ "lpi", "debian" ]
  20. volume {
  21. size_in_gb = 50
  22. type = "l_ssd"
  23. }
  24. }
  25. resource "scaleway_server" "centos" {
  26. count = "${var.count}"
  27. name = "${var.server_name["centos"]}-${count.index}.theo-andreou.org"
  28. image = "${var.images["centos"]}"
  29. type = "${var.type}"
  30. tags = [ "lpi", "centos" ]
  31. volume {
  32. size_in_gb = 50
  33. type = "l_ssd"
  34. }
  35. }