Skip to content
Snippets Groups Projects
Commit b21c7411 authored by Eesaan Atluri's avatar Eesaan Atluri
Browse files

Define volume attachment resource

parent c852aeda
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ variable "floating_ip_ohpc" {type = string} ...@@ -26,7 +26,7 @@ variable "floating_ip_ohpc" {type = string}
variable "ohpc_user" {} variable "ohpc_user" {}
variable "ssh_private_key" {} variable "ssh_private_key" {}
variable "vol_id" {}
# creates details for the OHPC instance # creates details for the OHPC instance
resource "openstack_compute_instance_v2" "ohpc" { resource "openstack_compute_instance_v2" "ohpc" {
...@@ -61,6 +61,12 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" { ...@@ -61,6 +61,12 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
instance_id = openstack_compute_instance_v2.ohpc.id instance_id = openstack_compute_instance_v2.ohpc.id
} }
# Attach a volume
resource "openstack_compute_volume_attach_v2" "volume_attach" {
instance_id = openstack_compute_instance_v2.ohpc.id
volume_id = var.vol_id
}
output "id" { output "id" {
value = openstack_compute_instance_v2.ohpc.id value = openstack_compute_instance_v2.ohpc.id
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment