LogoLogo
Log in|Playground
  • Welcome
    • Introduction
    • FAQ
  • Capabilities
    • Log Management
    • Infrastructure Monitoring
    • Application Performance Monitoring (APM)
      • Application Metrics
      • Traces
      • Supported Technologies
    • Real User Monitoring (RUM)
  • Getting Started
    • Requirements
      • Kubernetes requirements
      • Kernel requirements for eBPF sensor
      • CPU architectures
      • ClickHouse resources
    • Installation & updating
    • Connect Linux hosts
    • Connect RUM
    • 5 quick steps to get you started
    • groundcover MCP
      • Configure groundcover's MCP Server
      • Getting-started Prompts
      • Real-world Use Cases
  • Use groundcover
    • Monitors
      • Create a new Monitor
      • Issues page
      • Monitor List page
      • Silences page
      • Monitor Catalog page
      • Monitor YAML structure
      • Embedded Grafana Alerts
        • Create a Grafana alert
    • Dashboards
      • Create a dashboard
      • Embedded Grafana Dashboards
        • Create a Grafana dashboard
        • Build alerts & dashboards with Grafana Terraform provider
        • Using groundcover datasources in a Self-hosted Grafana
    • Insights
    • Explore & Monitors query builder
    • Workflows
      • Create a new Workflow
      • Workflow Examples
      • Alert Structure
    • Search & Filter
    • Saved Views
    • Issues
    • Role-Based Access Control (RBAC)
    • Remote Access & APIs
      • Service Accounts
      • API Keys
      • APIs
      • Ingestion Keys
      • Datasource API Keys
      • Grafana Service Account Token
    • groundcover Terraform Provider
    • Log Patterns
    • Drilldown
    • Scraping custom metrics
      • Operator based metrics
      • kube-state-metrics
      • cadvisor metrics
    • Backup & Restore Metrics
    • Metrics & Labels
    • Add custom environment labels
    • Configuring Pipelines
      • Writing Remap Transforms
      • Logs Pipeline Examples
      • Traces Pipeline Examples
      • Logs to Events Pipeline Examples
      • Logs/Traces Sensitive Data Obfuscation
      • Sensitive Data Obfuscation using OTTL
      • Log Filtering using OTTL
    • Querying your groundcover data
      • Query your logs
        • Example queries
        • Logs alerting
      • Query your metrics
      • Using KEDA autoscaler with groundcover
    • Fleet Manager
  • Log Parsing with OpenTelemetry Pipelines
  • Log and Trace Correlation
  • RUM
  • Customization
    • Customize deployment
      • Agents in host network mode
      • API Key Secret
      • Argo CD
      • On-premise deployment
      • Quay.io registry
      • Configuring sensor deployment coverage
      • Enabling SSL Tracing in Java Applications
    • Customize usage
      • Filtering Kubernetes entities
      • Custom data retention
      • Sensitive data obfuscation
      • Custom storage
      • Custom logs collection
      • Custom labels and annotations
        • Enrich logs and traces with pod labels & annotations
        • Enrich metrics with node labels
      • Disable tracing for specific protocols
      • Tuning resources
      • Controlling the eBPF sampling mechanism
  • Integrations
    • Overview
    • Workflow Integrations
      • Slack Webhook Integration
      • Opsgenie Integration
      • Webhook Integration
        • incident.io
      • PagerDuty Integration
      • Jira Webhook Integration
      • Send groundcover Alerts to Email via Zapier
    • Data sources
      • OpenTelemetry
        • Traces & Logs
        • Metrics
      • Istio
      • AWS
        • Ingest CloudWatch Metrics
        • Ingest CloudWatch Logs
        • Ingest Logs Stored on S3
        • Integrate CloudWatch Grafana Datasource
      • GCP
        • Ingest Google Cloud Monitoring Metrics
        • Stream Logs using Pub/Sub
        • Integrate Google Cloud Monitoring Grafana Datasource
      • Azure
        • Ingest Azure Monitor Metrics
      • DataDog
        • Traces
        • Metrics
      • FluentBit
      • Fluentd
      • JSON Logs
    • 3rd-party metrics
      • ActiveMQ
      • Aerospike
      • Cassandra
      • CloudFlare
      • Consul
      • CoreDNS
      • Etcd
      • HAProxy
      • Harbor
      • JMeter
      • K6
      • Loki
      • Nginx
      • Pi-hole
      • Postfix
      • RabbitMQ
      • Redpanda
      • SNMP
      • Solr
      • Tomcat
      • Traefik
      • Varnish
      • Vertica
      • Zabbix
    • Source control (Gitlab/Github)
  • Architecture
    • Overview
    • inCloud Managed
      • Setup inCloud Managed with AWS
        • AWS PrivateLink Setup
        • EKS add-on
      • Setup inCloud Managed with GCP
      • Setup inCloud Managed with Azure
      • High Availability
      • Disaster Recovery
      • Ingestion Endpoints
      • Deploying in Sensor-Only mode
    • Security considerations
      • Okta SSO - onboarding
    • Service endpoints inside the cluster
  • Product Updates
    • What's new?
    • Earlier updates
      • 2025
        • Mar 2025
        • Feb 2025
        • Jan 2025
      • 2024
        • Dec 2024
        • Nov 2024
        • Oct 2024
        • Sep 2024
        • Aug 2024
        • July 2024
        • May 2024
        • Apr 2024
        • Mar 2024
        • Feb 2024
        • Jan 2024
      • 2023
        • Dec 2023
        • Nov 2023
        • Oct 2023
Powered by GitBook
On this page
  • Overview
  • Supported Resources
  • Installation and Setup
  • Requirements
  • Install the Provider
  • Configure the Provider
  • Examples
  • Creating a Read-Only Service Account and API Key
Export as PDF
  1. Use groundcover

groundcover Terraform Provider

Last updated 1 day ago

Overview

Terraform is an infrastructure-as-code (IaC) tool for managing cloud and SaaS resources using declarative configuration. The groundcover Terraform provider enables you to manage observability resources such as policies, service accounts, API keys, and monitors as code—making them consistent, versioned, and automated.

Check out our provider Github repository:

Supported Resources

  • groundcover_policy – Defines RBAC policies (roles and optional data scope filters) Role-Based Access Control (RBAC)

  • groundcover_serviceaccount – Creates service accounts using attaches policies. Service Accounts

  • groundcover_apikey – Issues API keys for service accounts. API Keys

  • groundcover_monitor – Defines alerting rules and monitors. Monitors

  • groundcover_logspipeline - Defines Logs Pipeline configurations Log Parsing with OpenTelemetry Pipelines

Installation and Setup

Requirements

  • ≥ 1.0 (Check required_version if specified in main.tf)

  • >= 1.21 (to build the provider plugin)

  • groundcover Account and API Key.

Install the Provider

terraform {
  required_providers {
    groundcover = {
      source  = "registry.terraform.io/groundcover-com/groundcover"
      version = ">= 0.0.0" # Replace with actual version constraint
    }
  }
}

Run terraform init to install the provider.

Configure the Provider

provider "groundcover" {
  api_key  = "YOUR_API_KEY" # Required
  base_url = "https://api.groundcover.com" # Optional, change if using onprem/airgap deployment
  org_name = "YOUR_BACKEND_ID" # Backend name selected when deployed groundcover
}

Arguments

  • api_key (String, Required, Sensitive): Your groundcover API key. It is strongly recommended to configure this using the TF_VAR_groundcover_api_key environment variable rather than hardcoding it.

  • base_url (String, Optional): The base URL for the groundcover API. Defaults to api.groundcover.com if not specified.

Examples

Creating a Read-Only Service Account and API Key

resource "groundcover_policy" "read_only" {
  name        = "Read-Only Policy"
  description = "Grants read-only access"
  claim_role  = "ci-readonly-role"
  roles = {
    read = "read"
  }
}

resource "groundcover_serviceaccount" "ci_account" {
  name         = "ci-pipeline-account"
  description  = "Service account for CI"
  policy_uuids = [groundcover_policy.read_only.id]
}

resource "groundcover_apikey" "ci_key" {
  name               = "CI Key"
  description        = "Key for CI pipeline"
  service_account_id = groundcover_serviceaccount.ci_account.id
}

For full examples of all existing resources, see:

https://github.com/groundcover-com/terraform-provider-groundcover
Terraform
Go
https://github.com/groundcover-com/terraform-provider-groundcover/tree/main/examples/resources