# Deploying Dynatrace Oneagent on GCP VM instances

**URL:** <https://community.dynatrace.com/t/deploying-dynatrace-oneagent-on-gcp-vm-instances/36720>\
**Category:** Open Q&A\
**Tags:** installation, google-cloud-platform, oneagent\
**Created:** [September 29, 2022, 9:56pm UTC](https://community.dynatrace.com/t/deploying-dynatrace-oneagent-on-gcp-vm-instances/36720 "2022-09-29T21:56:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![agrawal\_shashan](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@agrawal\_shashan](https://community.dynatrace.com/u/agrawal_shashan)\
**Post date:** [September 29, 2022, 9:56pm UTC](https://community.dynatrace.com/t/deploying-dynatrace-oneagent-on-gcp-vm-instances/36720/1 "2022-09-29T21:56:30Z")

</div>

Hi All,

We are trying to deploy/install Dynatrace Oneagent on VM instances running in my Production environment. Everything in the infrastructure was built using IaaC using Terraform and we are not allowed to SSH into the machines and then install Oneagent.

Has anyone tried this using automation tools like Terraform? I am trying to understand what the code will look like if we have to deploy Oneagent on all the instances.

I understand It’s a vague question but if anyone has done it before, that would be very helpful.

Best Regards,

Shashank

---

<div class="post-metadata">

**Author:** ![rgarzon1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/rgarzon1/32/11844_2.png) [@rgarzon1](https://community.dynatrace.com/u/rgarzon1)\
**Post date:** [September 30, 2022, 5:49pm UTC](https://community.dynatrace.com/t/deploying-dynatrace-oneagent-on-gcp-vm-instances/36720/2 "2022-09-30T17:49:40Z")

</div>

hi agrawal\_shashan

until i know there is not a terraform script provided in the documentation.

but you can allways do a remote exec in terraform like this

> **[Perform post-apply operations using provisioners | Terraform | HashiCorp...](https://developer.hashicorp.com/terraform/language/provisioners)**
>
> Learn how to run commands and scripts and upload files to prepare resources for service after applying the configuration with provisioners, config-init, and configuration management software.

there is some examples from others users, did you allready try this ?

> **[GitHub - millerkc/template\_integration\_dynatrace: Sample terraform module for deploying Dynatrace...](https://github.com/millerkc/template_integration_dynatrace)**
>
> Sample terraform module for deploying Dynatrace OneAgent using IBM Cloud Automation Manager

Regards
