WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
    • VMware Cloud Foundation 9
  • VKS
  • Homelab
    • Hardware Options
    • Hardware Reviews
    • Lab Deployment Scripts
    • Nested Virtualization
    • Homelab Podcasts
  • VMware Nostalgia
  • Apple
You are here: Home / VCF Automation / Automating VCF Automation (VCFA) Configuration using VCFA Terraform Provider

Automating VCF Automation (VCFA) Configuration using VCFA Terraform Provider

10.22.2025 by William Lam // Leave a Comment

I recently rebuilt my VMware Cloud Foundation (VCF) lab environment to run the latest VCF 9.0.1 release. While most of the deployment and configuration has been fully automated, I was dreading the VMware Cloud Foundation Automation (VCFA) setup, mainly as the initial configuration can be a bit involved.


Having some experience with configuring VCFA manually, I wanted to take the opportunity to automate as much of the setup as I could, so the next that I need to rebuild, it is not an issue for me, which is typically the case as I like to automate everything!

My automation approach was going to be leveraging the newly published Terraform Provider for VCFA, this was on my todo list but I finally got a chance to play with it over the weekend in my lab.

I was blown away at how the automation was at configuring VCFA, the same manual tasks could  easily 20min+ and using the TP4VCFA, it was done in under 30 seconds! 🤯

It has been some time since I had played with Terraform, but once I figured out how the TP4VCFA works, I was able to quickly build a Terraform manifest that would automate all tasks within the Provider Portal and some of the initial Organization Portal setup as well. The TP4VCFA has Provider and Tenant module that respectively applies to the VCFA Provider and Tenant Portal configurations.

Step 1 - Clone the TP4VCFA repo and change into the provider directory

git clone https://github.com/vmware/terraform-provider-vcfa.git
cd terraform-provider-vcfa/examples/greenfield/provider

Step 2 - The directory includes a number of sample manifests demonstrating how to use each resource type, go ahead and move anything that does NOT end with _variables.tf to another folder, since it will attempt to apply those examples if you are using the current working directory.

Download my sample manifests:

  • vcfa-provider-example-main.tf
  • vcfa-provider-example-terraform.tfvars
  • vcfa-provider-example-william_custom_variables.tf

and store them into the current working directory, so it looks like the following:


The main.tf defines the various VCFA resources that it must be created and/or fetched, which has comments for users to understand what it is doing. The custom_variables.tf is my own custom variables manifest for making it easier to describe my VCFA configuration, such that I can easily use the TP4VCFA and is referenced at the bottom of the terraform.tfvars file, so you know which variables are coming from where.

You only need to modify terraform.tfvars to match your VCFA deployment, the assumption is that nothing has been setup in the VCFA Provider Portal, but you have all the prerequisite met (e.g. VCF Networking enabled with VPC and vSphere Supervisor configured with VPC). If you are unsure, please refer to this blog post here and here before proceeding.

Step 3 - Perform the init operation, which will install the required modules.

terraform init

Step 4 - Next run the plan operation, which will validate your environment and the desired state and output any errors or if everything was setup correctly, you something like the following outline the resources that will be created in your VCFA setup.

terraform plan


Step 5 - Finally, run the apply operation, which will start

terraform apply

or

terraform apply -auto-approve


As you can see from the screenshot, the entire VCFA Provider Portal configuration took ~25 seconds to complete! The ~hour-ish investment was totally worth it 😁

Categories // VCF Automation, VMware Cloud Foundation Tags // VCF 9.0

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Capturing Kasa Smart Plug Power Metrics using VCF Operations Management Pack Builder 11/07/2025
  • Retrieving the vSAN Cluster Shutdown VMs running Pre-Check Results using PowerCLI 11/05/2025
  • JFrog Artifactory as VCF Software Depot for VCF Installer & SDDC Manager 11/03/2025
  • Identifying VMware Cloud Foundation (VCF) managed service accounts in vCenter Server 10/30/2025
  • Configuring VCF Automation (VCFA) Organization Portal OIDC IdP using Terraform Provider for VCFA 10/28/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.

To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...