Install Dynatrace Configuration as Code via Monaco

This guide shows you how to download and install Dynatrace Configuration as Code via Monaco (the Dynatrace Monaco CLI).

Install the Dynatrace Monaco CLI

Linux

macOS

Windows

Container image

A container image of the Dynatrace Monaco CLI is available to simplify usage in CI/CD pipelines.

Images are available via Docker Hub:

docker pull dynatrace/dynatrace-configuration-as-code:latest

You can use the image directly with the CLI commands or as a CI container with a monaco executable available inside.

By default, commands run in the container image are running from a /monaco working directory. If you map your configurations into the container as a Docker volume, it's easiest to map the volume to this directory.

In the following example, we validate a project contained in /your/path/to/project with a manifest.yaml reading the deployment access token from an API_TOKEN variable.

docker run \
--env API_TOKEN=XXX \
--mount type=bind,src="/your/path/to/project",target=/monaco \
dynatrace/dynatrace-configuration-as-code:latest deploy -d manifest.yaml

The container image uses the monaco executable as its entrypoint, so any inputs are passed directly to it.

However, some CI/CD tools (for example, GitLab CI/CD) need a regular shell as entrypoint. To make the container image work with these tools, you need to overwrite the entrypoint with sh.

Verify the image signature

Dynatrace Monaco CLI version 2.2.0+

The container image is signed to allow you to verify its authenticity.

You can verify the signature using cosign and the cosign.pub key that can be downloaded from the GitHub release page.

To verify the signature of a given version

  1. Install the applicable version of cosign for your operating system, following the installation instructions.

  2. Download the cosign.pub public key from the GitHub release page of the version you wish to verify.

  3. Verify the container image of the version you wish to check:

    cosign verify --key cosign.pub dynatrace/dynatrace-configuration-as-code:[VERSION]

    For example, to verify version 2.2.0:

    cosign verify --key cosign.pub dynatrace/dynatrace-configuration-as-code:2.2.0

Run monaco

Execute the monaco command to try out the downloaded CLI.

> monaco
Tool used to deploy dynatrace configurations via the cli
Examples:
Deploy configuration defined in a manifest
monaco deploy service.yaml
Deploy a specific environment within an manifest
monaco deploy service.yaml -e dev
Usage:
monaco <command> [flags]
monaco [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
convert Convert v1 monaco configuration into v2 format
delete Delete configurations defined in delete.yaml from the environments defined in the manifest
deploy Deploy configurations to Dynatrace environments
download Download configuration from Dynatrace
generate Generate offers several sub-commands to generate files - take a look at the sub-commands for usage
help Help about any command
version Prints out the version of the monaco cli
Flags:
-h, --help help for monaco
--support-archive Create support archive
-v, --verbose Enable debug logging
Use "monaco [command] --help" for more information about a command.

What's next