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
A container image of the Dynatrace Monaco CLI is available to simplify usage in CI/CD pipelines.
Images are available via Docker Hub:
1docker 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
1docker run \2 --env API_TOKEN=XXX \3 --mount type=bind,src="/your/path/to/project",target=/monaco \4 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
Verify the image signature
Dynatrace Monaco CLI version 2.2.0+
The container image is signed to allow you to verify its authenticity.
To verify the signature of a given version
Install the applicable version of cosign for your operating system, following the installation instructions.
cosign.pubpublic key from the GitHub release page of the version you wish to verify.
Verify the container image of the version you wish to check:1cosign verify --key cosign.pub dynatrace/dynatrace-configuration-as-code:[VERSION]
For example, to verify version
2.2.0:1cosign verify --key cosign.pub dynatrace/dynatrace-configuration-as-code:2.2.0
monaco command to try out the downloaded CLI.
1> monaco2Tool used to deploy dynatrace configurations via the cli34Examples:5 Deploy configuration defined in a manifest6 monaco deploy service.yaml7 Deploy a specific environment within an manifest8 monaco deploy service.yaml -e dev910Usage:11 monaco <command> [flags]12 monaco [command]1314Available Commands:15 completion Generate the autocompletion script for the specified shell16 convert Convert v1 monaco configuration into v2 format17 delete Delete configurations defined in delete.yaml from the environments defined in the manifest18 deploy Deploy configurations to Dynatrace environments19 download Download configuration from Dynatrace20 generate Generate offers several sub-commands to generate files - take a look at the sub-commands for usage21 help Help about any command22 version Prints out the version of the monaco cli2324Flags:25 -h, --help help for monaco26 --support-archive Create support archive27 -v, --verbose Enable debug logging2829Use "monaco [command] --help" for more information about a command.