File tree Expand file tree Collapse file tree 7 files changed +146
-0
lines changed Expand file tree Collapse file tree 7 files changed +146
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Instructions
2
+
3
+ - Enable Flow within Prism Central
4
+ - Rename * terraform.tfvars-example* to * terraform.tfvars* and edit to match your environment
5
+ - terraform init
6
+ - terraform plan
7
+ - terraform apply -auto-approve
Original file line number Diff line number Diff line change
1
+ resource "nutanix_image" "image" {
2
+ name = " Arch Linux"
3
+ description = " Arch-Linux-x86_64-basic-20210401.18564"
4
+ source_uri = var. image_uri
5
+ }
Original file line number Diff line number Diff line change
1
+ terraform {
2
+ required_providers {
3
+ nutanix = {
4
+ source = " nutanix/nutanix"
5
+ version = " 1.2.0"
6
+ }
7
+ }
8
+ }
9
+
10
+ provider "nutanix" {
11
+ username = var. user
12
+ password = var. password
13
+ endpoint = var. endpoint
14
+ insecure = true
15
+ wait_timeout = 60
16
+ }
17
+
18
+ data "nutanix_cluster" "cluster" {
19
+ name = var. cluster_name
20
+ }
21
+ data "nutanix_subnet" "subnet" {
22
+ subnet_name = var. subnet_name
23
+ }
Original file line number Diff line number Diff line change
1
+ resource "nutanix_network_security_rule" "isolation" {
2
+ name = " example-isolation-rule"
3
+ description = " Isolation Rule Example"
4
+
5
+ isolation_rule_action = " MONITOR"
6
+
7
+ isolation_rule_first_entity_filter_kind_list = [" vm" ]
8
+ isolation_rule_first_entity_filter_type = " CATEGORIES_MATCH_ALL"
9
+ isolation_rule_first_entity_filter_params {
10
+ name = " Environment"
11
+ values = [" Dev" ]
12
+ }
13
+
14
+ isolation_rule_second_entity_filter_kind_list = [" vm" ]
15
+ isolation_rule_second_entity_filter_type = " CATEGORIES_MATCH_ALL"
16
+ isolation_rule_second_entity_filter_params {
17
+ name = " Environment"
18
+ values = [" Production" ]
19
+ }
20
+ }
Original file line number Diff line number Diff line change
1
+ cluster_name = "Cluster Name"
2
+ subnet_name = "Primary"
3
+ user = "Admin level account to Prism Central"
4
+ password = "Password for admin level acces to Priscm Central"
5
+ endpoint = "IP address or FQDN of Prism Central"
6
+ image_uri = "https://mirror.pkgbuild.com/images/v20210515.22945/Arch-Linux-x86_64-basic-20210515.22945.qcow2"
Original file line number Diff line number Diff line change
1
+ variable "cluster_name" {
2
+ type = string
3
+ }
4
+ variable "subnet_name" {
5
+ type = string
6
+ }
7
+ variable "password" {
8
+ type = string
9
+ }
10
+ variable "endpoint" {
11
+ type = string
12
+ }
13
+ variable "user" {
14
+ type = string
15
+ }
16
+ variable "image_uri" {
17
+ type = string
18
+ }
Original file line number Diff line number Diff line change
1
+ resource "nutanix_virtual_machine" "prod" {
2
+ name = " PROD - VM"
3
+ cluster_uuid = data. nutanix_cluster . cluster . id
4
+ num_vcpus_per_socket = " 2"
5
+ num_sockets = " 1"
6
+ memory_size_mib = 1024
7
+
8
+ categories {
9
+ name = " Environment"
10
+ value = " Production"
11
+ }
12
+
13
+ disk_list {
14
+ data_source_reference = {
15
+ kind = " image"
16
+ uuid = nutanix_image.image.id
17
+ }
18
+ }
19
+
20
+ disk_list {
21
+ disk_size_bytes = 10 * 1024 * 1024 * 1024
22
+ device_properties {
23
+ device_type = " DISK"
24
+ disk_address = {
25
+ " adapter_type" = " SCSI"
26
+ " device_index" = " 1"
27
+ }
28
+ }
29
+ }
30
+ nic_list {
31
+ subnet_uuid = data. nutanix_subnet . subnet . id
32
+ }
33
+ }
34
+
35
+ resource "nutanix_virtual_machine" "dev" {
36
+ name = " DEV - VM"
37
+ cluster_uuid = data. nutanix_cluster . cluster . id
38
+ num_vcpus_per_socket = " 2"
39
+ num_sockets = " 1"
40
+ memory_size_mib = 1024
41
+
42
+ categories {
43
+ name = " Environment"
44
+ value = " Dev"
45
+ }
46
+
47
+ disk_list {
48
+ data_source_reference = {
49
+ kind = " image"
50
+ uuid = nutanix_image.image.id
51
+ }
52
+ }
53
+
54
+ disk_list {
55
+ disk_size_bytes = 10 * 1024 * 1024 * 1024
56
+ device_properties {
57
+ device_type = " DISK"
58
+ disk_address = {
59
+ " adapter_type" = " SCSI"
60
+ " device_index" = " 1"
61
+ }
62
+ }
63
+ }
64
+ nic_list {
65
+ subnet_uuid = data. nutanix_subnet . subnet . id
66
+ }
67
+ }
You can’t perform that action at this time.
0 commit comments