You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
674B

  1. provider "ovh" {
  2. endpoint = "ovh-eu"
  3. }
  4. resource "ovh_cloud_user" "user" {
  5. project_id = "2044653399df4877a72b77333c25557e"
  6. description = "terraform user"
  7. }
  8. provider "openstack" {
  9. auth_url = "https://auth.cloud.ovh.net/v3"
  10. user_name = ovh_cloud_user.user.username
  11. password = ovh_cloud_user.user.password
  12. tenant_id = ovh_cloud_user.user.project_id
  13. }
  14. variable "ovh_regions" {
  15. type = list(string)
  16. default = [
  17. "DE1",
  18. "GRA7",
  19. "SBG5",
  20. ]
  21. }
  22. resource "openstack_compute_keypair_v2" "default" {
  23. name = "terraform-default"
  24. region = each.value
  25. public_key = file("~/.ssh/id_rsa.pub")
  26. for_each = toset(var.ovh_regions)
  27. }