Resource: aws_grafana_license_association

Provides an Amazon Managed Grafana workspace license association resource.

Example Usage

Basic configuration

resource "aws_grafana_license_association" "example" {
  license_type = "ENTERPRISE_FREE_TRIAL"
  workspace_id = aws_grafana_workspace.example.id
}

resource "aws_grafana_workspace" "example" {
  account_access_type      = "CURRENT_ACCOUNT"
  authentication_providers = ["SAML"]
  permission_type          = "SERVICE_MANAGED"
  role_arn                 = aws_iam_role.assume.arn
}

resource "aws_iam_role" "assume" {
  name = "grafana-assume"
  assume_role_policy = jsonencode({
    Version = "2012-10-17"
    Statement = [
      {
        Action = "sts:AssumeRole"
        Effect = "Allow"
        Sid    = ""
        Principal = {
          Service = "grafana.amazonaws.com"
        }
      },
    ]
  })
}

Argument Reference

The following arguments are required:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import Grafana workspace license association using the workspace's id. For example:

import {
  to = aws_grafana_license_association.example
  id = "g-2054c75a02"
}

Using terraform import, import Grafana workspace license association using the workspace's id. For example:

% terraform import aws_grafana_license_association.example g-2054c75a02