Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Output missing when relying on defaults for "resource_configuration" #80

Closed
prydin opened this issue Aug 21, 2020 · 3 comments
Closed

Comments

@prydin
Copy link

prydin commented Aug 21, 2020

vRA 7.x version
7.6
Terraform version
0.12.24
terraform-provider-vra7 plugin version
1.0.2

Describe the bug
The vRA 7 provider allows a user to specify configuration of individual resources from a blueprint. This is done through the resource_configuration section. However, a user is also permitted to omit this section, which should pull in the default values specified in the blueprint. When the resource_configuration section is omitted, any computed outputs from the resources are missing.

To Reproduce
Steps to reproduce the behavior:

  1. Use a config file similar to this:
resource "vra7_deployment" "machine" {
  count             = 1
  catalog_item_name = "Ubuntu 18"
  description = "some description"
  reasons = "some reason"
  lease_days = 10

  deployment_configuration = {
    "blueprint_custom_property" = "This is a blueprint custom property"
  }
}
  1. Run terraform plan and terraform apply
  2. The resources are provisioned, but the resource data is missing from the state file.

Expected behavior
Computed data is present in the .tfstate file:
https://gist.github.com/prydin/0809bed0e8f0fb118d8e3b35bd46b3b7

Actual Behavior
Computed values, such as IDs and IP addresses are missing as is evident here: https://gist.github.com/prydin/0050cf26c70b98c8ad4a3d4d5547b03a

Desktop (please complete the following information):

  • Mac
@prydin
Copy link
Author

prydin commented Aug 21, 2020

@prydin
Copy link
Author

prydin commented Aug 22, 2020

After investigating this a bit deeper, I got some interesting clues. The data from vRA is received correctly and appears to have all the fields. It also looks like it's parsed and processed correctly by the provider, but for some reason, the resource_configuration computed fields of the state don't seem to be populated by the Terraform core if they're not present in the configuration files.

Prativa20 added a commit that referenced this issue Aug 25, 2020
Fix for #80
The state file will be updated with the resource_configuration block
even if it is not specified in the tf config file

Signed-off-by: Prativa Bawri <bawrip@vmware.com>
Prativa20 added a commit that referenced this issue Aug 25, 2020
Fix for #80
The state file will be updated with the resource_configuration block
even if it is not specified in the tf config file

Signed-off-by: Prativa Bawri <bawrip@vmware.com>
markpeek pushed a commit that referenced this issue Aug 25, 2020
…on (#82)

Fix for #80
The state file will be updated with the resource_configuration block
even if it is not specified in the tf config file

Signed-off-by: Prativa Bawri <bawrip@vmware.com>
@Prativa20
Copy link
Contributor

Prativa20 commented Aug 25, 2020

@prydin Fixed as part of #82. Please verify.

Thanks,
Prativa

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants