Header background

Simplify OneAgent installation with AWS CloudFormation Registry

Provisioning of cloud infrastructure, especially within large environments, requires a standardized approach to scalability, compliance, and troubleshooting. AWS CloudFormation provides a common language for modeling and provisioning resources in the AWS Cloud. Dynamic cloud operations call for an application performance management tool that can monitor individual customer workloads. However, deploying Dynatrace OneAgent to hundreds or thousands of hosts in AWS environments can be tricky. To accomplish this, customers either install OneAgent manually or rely on external tools that have access to production hosts.

Easily automate EC2 instrumentation with the AWS Dynatrace OneAgent Installer

The new AWS CloudFormation Registry allows Dynatrace to offer an initial set of third-party resources that can assist you in automated OneAgent installation. But now you can use the AWS Dynatrace OneAgent Installer to automatically deploy OneAgent on newly created EC2 hosts.

How to use the AWS Dynatrace OneAgent Installer

The first step is to register a new CloudFormation resource (the AWS Dynatrace OneAgent Installer). Using command line interface (CLI), run the following command:

aws cloudformation register-type \
--region us-east-1 \
--type-name "Dynatrace::Installer::Agent" \
--schema-handler-package "s3://aws-dynatrace-oneagent-installer/dynatrace-installer-agent-handler-1.0-SNAPSHOT.zip" \
--type RESOURCE

As it’s an asynchronous call, you can track the progress of the registration until a “success” message is returned with:

aws cloudformation describe-type-registration \
--region us-east-1 \
--registration-token <token>

Then you can add the AWS Dynatrace OneAgent Installer to your CloudFormation stack by specifying the following parameters in your template:

  • Hostname of your Dynatrace Cluster (could be SaaS or Managed)
  • TenantId (the ID of your Dynatrace environment)
  • ApiToken for accessing the Dynatrace API. Tokens can be obtained from the Dynatrace UI at Settings > Integrations > Dynatrace API.

Example #1: Deploy OneAgent in a Dynatrace SaaS environment

Below is a sample YAML template for deploying OneAgent on a t2.micro EC2 host in a Dynatrace SaaS environment. Note that values in bold need to be adjusted to your environment.

Resources:
  AgentInstaller:
    Type: 'Dynatrace::Installer::Agent'
    Properties:
      Hostname: yjm10428.live.dynatrace.com
      TenantId: yjm10428
      ApiToken: LXOAFt3X4FQQQqch8wxQpL6m
  EC2Instance:
    Type: 'AWS::EC2::Instance'
    Properties:
      InstanceType: t2.micro
      SecurityGroupIds:
        - sg-0a73435634634
      KeyName: dynatrace-test
      ImageId: ami-04b762b4289fba92b
      UserData: !GetAtt 
        - AgentInstaller
        - ScriptString

Example #2: Deploy OneAgent in a Dynatrace Managed environment

Resources:
  AgentInstaller:
    Type: 'Dynatrace::Installer::Agent'
    Properties:
      Hostname: ert125.managed-dev.dynatrace.com
      TenantId: 64213432-f3fc-3243-8296-15d933018e21
      ApiToken: LXOAFt3X4FQQQqch8wxQpL6m
  EC2Instance:
    Type: 'AWS::EC2::Instance'
    Properties:
      InstanceType: t2.micro
      SecurityGroupIds:
        - sg-0a73435634634
      KeyName: dynatrace-test
      ImageId: ami-04b762b4289fba92b
      UserData: !GetAtt 
        - AgentInstaller
        - ScriptString

AWS Dynatrace OneAgent Installer capabilities

The Dynatrace Installer currently supports OneAgent installation for Linux systems, but it’s fully extensible. Expanding it to handle Windows or even Environment ActiveGate installation won’t pose much of a challenge for developers. You can also build the resource from the source code using a Java environment (cfn tool, Maven, JDK, git CLI, etc) with the following steps:

  1. Clone git repository: git clone https://github.com/mnalezin/DynatraceInstallerAgent
  2. Create a package with Maven: mvn package
  3. Submit the resource: cfn submit

Feel free to experiment with the new resource provider and contact us with questions and comments.

Additional information