Resource: aws_grafana_workspace_saml_configuration

Provides an Amazon Managed Grafana workspace SAML configuration resource.

Example Usage

Basic configuration

resource "aws_grafana_workspace_saml_configuration" "example" {
  editor_role_values = ["editor"]
  idp_metadata_url   = "https://my_idp_metadata.url"
  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:

The following arguments are optional:

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 SAML configuration using the workspace's id. For example:

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

Using terraform import, import Grafana Workspace SAML configuration using the workspace's id. For example:

% terraform import aws_grafana_workspace_saml_configuration.example g-2054c75a02