Modeling vRA in Terraform
To model a VMware vRealize Automation Enterprise (vRA) environment, log in with a vRealize Automation cloud project and specify the vRealize Automation-specific information in a blueprint.
- Connect the blueprint design server to a cloud system. See Connecting to clouds through the blueprint designer.
- Make sure that your user account is authenticated to a cloud system. See Setting up access to clouds in the blueprint designer.
- Connect the blueprint design server to the server. See Connecting the blueprint design server to the server.
- Log in to the blueprint designer.
- At the top of the page, select the cloud project and region to use.
Resource vra7_deployment
resource "vra7_deployment" "aws_two_node" {
count = "1"
wait_timeout = "${var.aws_two_node_timeout}"
catalog_item_name = "aws-two-node"
resource_configuration {
myvm2.myprop2 = "myval2"
HelloWorld_1.myhelloprop = ""
IBM_UrbanCode_Deploy_Agent_for_Linux_1._ucd_server_url_ = ""
IBM_UrbanCode_Deploy_Agent_for_Linux_1._agent_name_ = ""
IBM_UrbanCode_Deploy_Agent_for_Linux_1._ucd_password_ = ""
myvm2.ip_address = "" # Leave blank auto populated by terraform
myvm1.ip_address = "" # Leave blank auto populated by terraform
}
}
https://github.com/vmware/terraform-provider-vra7 definitions are found here.
Null resource(s):
resource "null_resource" "myvm2" {
provisioner "ucd" {
agent_name = "${var.myvm2_agent_name}.${random_id.stack.hex}"
ucd_server_url = "${var.ucd_server_url}"
ucd_user = "${var.ucd_user}"
ucd_password = "${var.ucd_password}"
}
provisioner "local-exec" {
when = "destroy"
command = <<EOT
curl -k -u ${var.ucd_user}:${var.ucd_password} ${var.ucd_server_url}/cli/agentCLI?
agent=${var.myvm2_agent_name}.${random_id.stack.hex} -X DELETE
EOT
}
connection {
user = "${var.myvm2_user}"
password = "${var.myvm2_password}"
host = "${vra7_deployment.aws_two_node.resource_configuration.myvm2.ip_address}"
}
}