Framework: https://developer.hashicorp.com/terraform/plugin/framework
Our Terraform Provider: https://registry.terraform.io/providers/trendmicro/vision-one/latest
create .terraformrc file under your home directory(~)
Verify with
go env GOBIN
make sure you have the path ready. If nothing setup GOBIN with default /Users/YOUR_USERNAME/go/bin
check your provider installation setting in ~/.terraformrc
cat ~/.terraformrc
provider_installation {
dev_overrides {
"trendmicro/vision-one" = "<FILL_IN_WITH_$GOBIN_PATH>"
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
go install .
The binary executive file will store at your $GOBIN
Either find sample code under example folder or make your own
terraform {
required_providers {
visionone = {
source = "trendmicro/vision-one"
}
}
}
provider "visionone" {
api_key = "xxx"
regional_fqdn = "xxx"
}
resource "visionone_container_cluster" "this" {
name = "example"
}
cd examples/resources/visionone_container_ruleset
Copy the provider settings from examples/provider/provider.tf
, fill in your API key and regional fully qualified domain name (FQDN), then paste in examples/resources/visionone_container_ruleset/resource.tf
.
For the API key, add in the Vision One console.
For the regional FQDN, refer to the Regional domains table.
Use the terraform command to fetch the latest terraform provider and build your resource.
terraform init
terraform apply