Skip to main content
Knowledge Base

Terratest for terraform-provider-megaport

Answer

Hi team, I'm wondering if Terratest works with Megaport Terraform Provider (terraform-provider-megaport). My understanding is that we can use Terraform plan/apply features for testing with terratest but can't using megaport's api to run any custom tests. Can you advise if this is correct? Thanks --- <ins datetime="2023-10-20T05:51:46Z"> <p><a href="https://support.gruntwork.io/hc/requests/110545">Tracked in ticket #110545</a></p> </ins>

Hi @damankaur99, we don't have custom modules for Megaport on terratest yet with helpers or utility functions. But I believe you could still run tests using megaport's api, you would have to create functions for making the requests to the api from within your code though. It seems their docs has some examples on how to do that in golang: https://dev.megaport.com/#5b1bd901-ca32-436c-83a1-43af4ddc3f5c