Dynatrace / Dynatrace/community-examples
Cloud SRE Agent App - Terraform support for agents and interaction profiles
- Dominant language
- HCL
- Stars
- 17
- Forks
- 12
- Avg merge
- 13m
- Merged PRs (30d)
- 6
Description
**Is your feature request related to a problem? Please describe.**
Managing Cloud SRE Agents and Interaction Profiles through the UI is manual and error-prone, making it hard to version-control configurations, replicate setups across tenants, and integrate into IaC pipelines.
**Describe the solution you'd like**
Publish example Terraform configuration (using the [Dynatrace Terraform provider](https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest)) to manage Cloud SRE Agents and Interaction Profiles as code via the App Settings API.
The implementation would use `dynatrace_generic_setting` (or a future dedicated resource) to manage the two schema objects:
- `app:my.community.cloudsreagents.:cloudsreagent-agent` — agent definitions (endpoint, credential, budget, etc.)
- `app:my.community.cloudsreagents.:cloudsreagent-interactionprofile` — profiles including `agentRefs`, filter expressions, `topologyMaxDepth`, `deferred`, etc.
Deliverables:
1. **Terraform examples** under a new `terraform/` directory in the repo:
- `agents.tf` — example agent resources for AWS, Azure, GCP
- `profiles.tf` — example interaction profile resources referencing those agents
- `variables.tf` + `README.md` covering required provider version, schema suffix lookup, and credential handling
2. **Documentation** noting the schema suffix is tenant-scoped and must be discovered at bootstrap time (e.g. `dtctl get settings --schema ...` or via the Settings v2 API).
3. **Credential handling guidance** — the provider's `sensitive = true` support for the `credential` field so secrets are never stored in plain text in state.
**Describe alternatives you've considered**
- `dtctl apply` scripts (per `06-dtctl.md`) — works but not declarative, no state tracking, harder to review as PR diffs.
- Manual UI — not scalable across tenants or teams.
**Additional context**
The App Settings v2 API already supports the CRUD needed; Terraform wraps it declaratively. This would be especially useful for teams managing multiple Dynatrace tenants or using GitOps workflows.
App Settings schema reference: `08-settings-fields.md` in the repo describes all fields that must be populated per resource type.
Contributor guide
Research direction
Start with 08-settings-fields.md to map the agent and interaction-profile schemas, then review 06-dtctl.md and the Dynatrace Terraform provider documentation for schema suffix lookup and sensitive fields. Add the requested agents.tf, profiles.tf, variables.tf, and README.md under terraform/; done means the examples cover AWS, Azure, and GCP, reference the agents from profiles, document tenant-scoped suffix discovery, and explain credential handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- terraform
- Domain
- cloud, devops, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100