Be aware of certain limitations and troubleshooting when you embed Terraform configurations as a resource in vRealize Automation.

Limitations for Terraform configurations

  • When validating a design with Terraform configurations, the TEST button checks vRealize Automation Cloud Assembly syntax but not the native Terraform code syntax.

    In addition, the TEST button doesn't validate commit IDs associated with Terraform configurations.

  • The recently released Terraform version 0.13 isn't officially supported yet.
  • For a cloud template that includes Terraform configurations, cloning the template to a different project requires the following workaround.
    1. In the new project, under the Integrations tab, copy the repositoryId for your integration.
    2. Open the clone template. In the code editor, replace the repositoryId with the one you copied.
  • In the version control repository, don't include a Terraform state file with configuration files. If terraform.tfstate is present, errors occur during deployment.

Supported day 2 actions for the parent Terraform resource

For the parent Terraform resource, you can view or refresh the Terraform state file. For more about the state file actions, see the comprehensive list of actions at Welke acties kan ik op vRealize Automation Cloud Assembly-implementaties uitvoeren.

Supported day 2 actions for child resources

After deploying Terraform configurations, it might take up to 20 minutes for a day 2 action to become available on child resources.

For child resources in a Terraform configuration, only the following subset of day 2 actions are supported. For details about the actions, look them up in the comprehensive list of actions at Welke acties kan ik op vRealize Automation Cloud Assembly-implementaties uitvoeren.

Provider Terraform Resource Type Supported Day 2 Actions
AWS aws_instance Power On
Power Off
Reboot
Reset
Azure azurerm_virtual_machine Power On
Power Off
Restart
Suspend
vSphere vsphere_virtual_machine Power On
Power Off
Reboot
Reset
Shutdown
Suspend
Create Snapshot
Delete Snapshot
Revert Snapshot
GCP google_compute_instance Power On
Power Off
Create Snapshot
Delete Snapshot

Troubleshooting day 2 action availability

Out-of-the-box (OOTB) day 2 actions that are missing or disabled might need troubleshooting.

Problem Cause Resolution
A Terraform resource does not have an expected OOTB day 2 action on the Actions menu.

The action might not be supported for the provider and resource type as mentioned in the previous list.

Alternatively, the action might need up to 20 minutes to appear due to the timing of resource discovery and resource caching.

Check the provider and resource type in the design.

Wait up to 20 minutes for data collection to complete.

A Terraform resource does not have an expected day 2 action even after the 20 minutes to account for data collection.

A resource discovery problem is preventing the action from appearing.

One way that happens is when the resource is accidentally created on an out-of-project cloud zone. For example, your project only includes a cloud account and region us-east-1 cloud zone, but the Terraform configuration includes a provider block for us-west-1, and you didn't change it at design time.

Another possibility is that data collection isn't working.

Check the project cloud zones against the cloud zones in the design.

Go to Infrastructure > Connections > Cloud Accounts and check the data collection status and last successful collection time for the cloud account.

Even though there are no obvious problems with the resource state and data collection, a day 2 action is disabled (gray). Occasional, intermittent timing issues and data collection failures are known to occur. The problem should resolve itself within 20 minutes.
The wrong day 2 action is disabled, one that should be enabled based on the resource state.

For example, Power Off is enabled, and Power On is disabled, even though the resource was powered off using the provider interface.

Data collection timing can cause a temporary mismatch. If you change the power state from outside vRealize Automation, it takes time to correctly reflect the change. Wait up to 20 minutes.

Using custom Terraform providers in vRealize Automation

If you have created and want to use a custom Terraform provider, take the following steps.

  1. Under the default Terraform directory in your git version control repository, add the following subdirectory structure.

    terraform.d/plugins/linux_amd64

  2. Add your custom Terraform provider Go binaries to the linux_amd64 directory.

    By default, terraform init will search that directory for custom provider plug-ins.