Professional Services repo to bootstrap a customer environment for the deployment of monitoring resources.
Managed Services will provide a set of info for the bootstrap process:
-
client repo name
The name of a customer repo from the template repo in the https://github.com/Cloud-Direct-Monitoring organisation.
-
personal access token (PAT)
A short-lived personal access token to allow this repo to write files, secrets and variables to that client repo.
-
secret files
A set of files downloaded from the https://github.com/Cloud-Direct-Monitoring/cd-monitoring-secrets repo.
You will also need the git binary installed on your machine. Visual Studio Code is also assumed in this guide.
-
Clone the repo
git clone https://github.com/Cloud-Direct-Monitoring/cd-monitoring-bootstrap customer
Change
customer
to a customer shortcode. -
Change directory
cd customer
-
Open Visual Studio Code
code .
An terraform.tfvars file has been provided.
-
Rename terraform.tfvars.example, removing the .example extension
-
Customise the values
- Specify the provided GitHub repo name and access token.
- You will also need the resource ID for an existing Azure Monitor workspace. This will be used by the Data Collection Rule.
Note that additional variables are defined in variables.tf.
-
Save the terraform.tfvars file
-
Save the secrets files into the secrets folder
- Log into the customer environment
- Set the context to the correct subscription
-
Validate
terraform validate
This will check that you have all of the expected secrets and variable values.
-
Plan
terraform plan
-
Apply
terraform apply
Once deployed, you should see the new resource group in the selected subscription.
If you have not specified a resource group name then it will default to rg-cdmonitoring-prod-uksouth-001.
The resource group will contain:
- managed identity with
- least privilege RBAC roles on the resource group scope
- federated credential to enable the workflows to use OpenID Connect
- storage account and a single container
- ready for use as a remote state by Terraform
The client repo will also have a number of variables and secrets, plus parameter files.
The workflows in the client repo may now be run by Managed Services.
Once deployed, the Azure Monitor Agent policies can be deployed to specify the new Data Collection Rule.