Terraform needs to be locally installed. A GCP account is needed.
-
Make sure you're authenticated to use GCP. The easiest way is through the
gcloud
CLI:gcloud auth application-default login
More info as well as alternative options can be found in the Terraform provider docs
-
Navigate to the
terraform/gcloud
folder$ cd terraform/gcloud
-
Initialize terraform
$ terraform init
-
Create a
terraform.tfvars
file inside the terraform/gcloud folder It needs to contain the following as a minimum:gcloud_project = "myGCPProject" # GCP Project you want to use gcloud_zone = "europe-west1-b" # zone where you want to provision the resources. Check out https://cloud.google.com/compute/docs/regions-zones#available for available zones
Check out
variables.tf
for a complete list of variables -
Verify the configuration by running
terraform plan
$ terraform plan
-
Apply the configuration
$ terraform apply
It is possible to leverage the Ansible OpenTelemetry callback plugin to send Traces to the Dynatraces API.
The following variable need to be set to enable it:
otel_export_enable = true
Note: The traces will be sent to the
dt_tenant/api/v2/otlp
endpoint Note: The api token specified in thedt_api_token
variable needs to have the additionalopenTelemetryTrace.ingest
scope
This terraform script supports the use of custom domains via Cloud DNS.
-
Ensure your service account can create DNS records in the target Cloud DNS managed zone.
-
Add the following values to the
terraform.tfvars
file:gcloud_project = "myGCPProject" # GCP Project you want to use gcloud_zone = "europe-west1-b" # zone where you want to provision the resources. Check out https://cloud.google.com/compute/docs/regions-zones#available for available zones custom_domain = "acebox.example.com" # Set to override default domain (ip_address.xip.io) managed_zone_name = "example.com" # Name of Cloud DNS managed zone
Command | Result |
---|---|
terraform destroy |
deletes any resources created by Terraform |
terraform plan -destroy |
view a speculative destroy plan, to see what the effect of destroying would be |
terraform show |
Outputs the resources created by Terraform. Useful to verify IP addresses and the dashboard URL. |
terraform output -json |
Shows Terraform outputs in clear text json. This command might be useful to show the dashboard password. |