Skip to content

Commit

Permalink
Add support for update action on deployment (#100)
Browse files Browse the repository at this point in the history
Changes to inputs in deployment resource are now applied on the existing deployment
using update action.

Signed-off-by: Deepak Mettem <[email protected]>
  • Loading branch information
dmettem committed Dec 18, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 281b43c commit a22c1eb
Showing 6 changed files with 335 additions and 33 deletions.
8 changes: 6 additions & 2 deletions examples/deployment/blueprint/main.tf
Original file line number Diff line number Diff line change
@@ -7,11 +7,15 @@ data "vra_project" "this" {
name = var.project_name
}

data "vra_blueprint" "this" {
name = var.blueprint_name
}

resource "vra_deployment" "this" {
name = var.deployment_name
description = "terraform test deployment"
description = "Deployed from vRA provider for Terraform."

blueprint_id = var.blueprint_id
blueprint_id = data.vra_blueprint.this.id
blueprint_version = var.blueprint_version
project_id = data.vra_project.this.id

2 changes: 1 addition & 1 deletion examples/deployment/blueprint/terraform.tfvars.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
refresh_token = ""
url = ""
project_name = ""
blueprint_id = ""
blueprint_name = ""
blueprint_version = ""
deployment_name = ""
2 changes: 1 addition & 1 deletion examples/deployment/blueprint/variables.tf
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ variable "refresh_token" {
variable "project_name" {
}

variable "blueprint_id" {
variable "blueprint_name" {
}

variable "blueprint_version" {
2 changes: 2 additions & 0 deletions examples/deployment/catalog_item/main.tf
Original file line number Diff line number Diff line change
@@ -24,6 +24,8 @@ resource "vra_deployment" "this" {
inputs = {
flavor = "small"
image = "centos"
count = 1
flag = false
}

expand_resources = true
3 changes: 3 additions & 0 deletions vra/resource_blueprint.go
Original file line number Diff line number Diff line change
@@ -18,6 +18,9 @@ func resourceBlueprint() *schema.Resource {
Read: resourceBlueprintRead,
Update: resourceBlueprintUpdate,
Delete: resourceBlueprintDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"content": {
Loading

0 comments on commit a22c1eb

Please sign in to comment.