grafana.grafana.cloud_stack module – Manage Grafana Cloud stack

Note

This module is part of the grafana.grafana collection (version 0.0.6).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install grafana.grafana.

To use it in a playbook, specify: grafana.grafana.cloud_stack.

New in version 0.0.1: of grafana.grafana

Synopsis

  • Create and delete Grafana Cloud stacks using Ansible.

Parameters

Parameter

Comments

cloud_api_key

string / required

CLoud API Key to authenticate with Grafana Cloud.

name

string / required

Name of stack. Conventionally matches the URL of the instance. For example, “<stack_slug>.grafana.net”.

org_slug

string

Name of the organization under which Cloud stack is created.

region

string

Choose a region for your stack.

Choices:

  • us ← (default)

  • us-azure

  • eu

  • au

  • eu-azure

  • prod-ap-southeast-0

  • prod-gb-south-0

  • prod-eu-west-3

stack_slug

string / required

Subdomain of the Grafana instance. For example, if slug is <stack_slug>, the instance URL will be https://<stack_slug>.grafana.net

state

string

State for the Grafana CLoud stack.

Choices:

  • present ← (default)

  • absent

url

string

If you use a custom domain for the instance, you can provide it here. For example, “https://grafana.yourdoman.io”.

Default: “https://<stack_slug>.grafana.net”

Examples

- name: Create a Grafana Cloud stack
  cloud_stack:
    name: company_name
    slug: company_name
    cloud_api_key: "{{ grafana_cloud_api_key }}"
    region: eu
    url: https://grafana.company_name.com
    state: present

- name: Delete a Grafana Cloud stack
  cloud_stack:
    name: company_name
    slug: company_name
    cloud_api_key: "{{ grafana_cloud_api_key }}"
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

alertmanager_name

string

Name of the alertmanager instance

Returned: always

alertmanager_url

string

URL of the alertmanager instance

Returned: always

cluster_slug

string

Slug for the cluster where the Grafana stack is deployed

Returned: always

id

integer

ID of the Grafana Cloud stack

Returned: always

loki_url

string

URl for the Loki instance

Returned: always

orgID

integer

ID of the Grafana Cloud organization

Returned: always

prometheus_url

string

URl for the Prometheus instance

Returned: always

tempo_url

string

URl for the Tempo instance

Returned: always

url

string

URL of the Grafana Cloud stack

Returned: always

Authors

  • Ishan Jain (@ishanjainn)