-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a416d5
commit fe5209c
Showing
4 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
terraform { | ||
required_providers { | ||
nutanix = { | ||
source = "nutanix/nutanix" | ||
version = "2.1" | ||
} | ||
} | ||
} | ||
|
||
#defining nutanix configuration | ||
provider "nutanix" { | ||
username = var.nutanix_username | ||
password = var.nutanix_password | ||
endpoint = var.nutanix_endpoint | ||
port = 9440 | ||
insecure = true | ||
} | ||
|
||
// using cluster_location | ||
resource "nutanix_backup_target_v2" "example-1" { | ||
domain_manager_ext_id = "<domain_manager_uuid>" | ||
location { | ||
cluster_location { | ||
config { | ||
ext_id = "cluster uuid" | ||
} | ||
} | ||
} | ||
} | ||
|
||
// using object_store_location | ||
resource "nutanix_backup_target_v2" "example-2" { | ||
domain_manager_ext_id = "<domain_manager_uuid>" | ||
location { | ||
object_store_location { | ||
provider_config { | ||
bucket_name = "bucket name" | ||
region = "region" | ||
credentials { | ||
access_key_id = "id" | ||
secret_access_key = "key" | ||
} | ||
} | ||
backup_policy { | ||
rpo_in_minutes = 0 | ||
} | ||
} | ||
} | ||
} | ||
|
||
// list backup targets | ||
data "nutanix_backup_targets_v2" "backup-targets" { | ||
domain_manager_ext_id = "<domain_manager_uuid>" | ||
} | ||
|
||
// get backup target | ||
data "nutanix_backup_target_v2" "backup-target" { | ||
domain_manager_ext_id = "<domain_manager_uuid>" | ||
ext_id = "<backup_target_uuid>" | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#define values to the variables to be used in terraform file | ||
nutanix_username = "admin" | ||
nutanix_password = "password" | ||
nutanix_endpoint = "10.xx.xx.xx" | ||
nutanix_port = 9440 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#define the type of variables to be used in terraform file | ||
variable "nutanix_username" { | ||
type = string | ||
} | ||
variable "nutanix_password" { | ||
type = string | ||
} | ||
variable "nutanix_endpoint" { | ||
type = string | ||
} | ||
variable "nutanix_port" { | ||
type = string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters