WorkspaceSamlConfiguration class
Provides an Amazon Managed Grafana workspace SAML configuration resource.
Example Usage
Basic configuration
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const assume = new aws.iam.Role("assume", {
name: "grafana-assume",
assumeRolePolicy: JSON.stringify({
Version: "2012-10-17",
Statement: [{
Action: "sts:AssumeRole",
Effect: "Allow",
Sid: "",
Principal: {
Service: "grafana.amazonaws.com",
},
}],
}),
});
const exampleWorkspace = new aws.grafana.Workspace("example", {
accountAccessType: "CURRENT_ACCOUNT",
authenticationProviders: ["SAML"],
permissionType: "SERVICE_MANAGED",
roleArn: assume.arn,
});
const example = new aws.grafana.WorkspaceSamlConfiguration("example", {
editorRoleValues: ["editor"],
idpMetadataUrl: "https://my_idp_metadata.url",
workspaceId: exampleWorkspace.id,
});
import pulumi
import json
import pulumi_aws as aws
assume = aws.iam.Role("assume",
name="grafana-assume",
assume_role_policy=json.dumps({
"Version": "2012-10-17",
"Statement": [{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Sid": "",
"Principal": {
"Service": "grafana.amazonaws.com",
},
}],
}))
example_workspace = aws.grafana.Workspace("example",
account_access_type="CURRENT_ACCOUNT",
authentication_providers=["SAML"],
permission_type="SERVICE_MANAGED",
role_arn=assume.arn)
example = aws.grafana.WorkspaceSamlConfiguration("example",
editor_role_values=["editor"],
idp_metadata_url="https://my_idp_metadata.url",
workspace_id=example_workspace.id)
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var assume = new Aws.Iam.Role("assume", new()
{
Name = "grafana-assume",
AssumeRolePolicy = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["Version"] = "2012-10-17",
["Statement"] = new[]
{
new Dictionary<string, object?>
{
["Action"] = "sts:AssumeRole",
["Effect"] = "Allow",
["Sid"] = "",
["Principal"] = new Dictionary<string, object?>
{
["Service"] = "grafana.amazonaws.com",
},
},
},
}),
});
var exampleWorkspace = new Aws.Grafana.Workspace("example", new()
{
AccountAccessType = "CURRENT_ACCOUNT",
AuthenticationProviders = new[]
{
"SAML",
},
PermissionType = "SERVICE_MANAGED",
RoleArn = assume.Arn,
});
var example = new Aws.Grafana.WorkspaceSamlConfiguration("example", new()
{
EditorRoleValues = new[]
{
"editor",
},
IdpMetadataUrl = "https://my_idp_metadata.url",
WorkspaceId = exampleWorkspace.Id,
});
});
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/grafana"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"Version": "2012-10-17",
"Statement": []map[string]interface{}{
map[string]interface{}{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Sid": "",
"Principal": map[string]string{
"Service": "grafana.amazonaws.com",
},
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
assume, err := iam.NewRole(ctx, "assume", &iam.RoleArgs{
Name: pulumi.String("grafana-assume"),
AssumeRolePolicy: pulumi.String(json0),
})
if err != nil {
return err
}
exampleWorkspace, err := grafana.NewWorkspace(ctx, "example", &grafana.WorkspaceArgs{
AccountAccessType: pulumi.String("CURRENT_ACCOUNT"),
AuthenticationProviders: pulumi.StringArray{
pulumi.String("SAML"),
},
PermissionType: pulumi.String("SERVICE_MANAGED"),
RoleArn: assume.Arn,
})
if err != nil {
return err
}
_, err = grafana.NewWorkspaceSamlConfiguration(ctx, "example", &grafana.WorkspaceSamlConfigurationArgs{
EditorRoleValues: pulumi.StringArray{
pulumi.String("editor"),
},
IdpMetadataUrl: pulumi.String("https://my_idp_metadata.url"),
WorkspaceId: exampleWorkspace.ID().ToIDOutput().ToStringOutput(),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_grafana_workspacesamlconfiguration" "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"
}
}]
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.grafana.Workspace;
import com.pulumi.aws.grafana.WorkspaceArgs;
import com.pulumi.aws.grafana.WorkspaceSamlConfiguration;
import com.pulumi.aws.grafana.WorkspaceSamlConfigurationArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var assume = new Role("assume", RoleArgs.builder()
.name("grafana-assume")
.assumeRolePolicy(serializeJson(
jsonObject(
jsonProperty("Version", "2012-10-17"),
jsonProperty("Statement", jsonArray(jsonObject(
jsonProperty("Action", "sts:AssumeRole"),
jsonProperty("Effect", "Allow"),
jsonProperty("Sid", ""),
jsonProperty("Principal", jsonObject(
jsonProperty("Service", "grafana.amazonaws.com")
))
)))
)))
.build());
var exampleWorkspace = new Workspace("exampleWorkspace", WorkspaceArgs.builder()
.accountAccessType("CURRENT_ACCOUNT")
.authenticationProviders("SAML")
.permissionType("SERVICE_MANAGED")
.roleArn(assume.arn())
.build());
var example = new WorkspaceSamlConfiguration("example", WorkspaceSamlConfigurationArgs.builder()
.editorRoleValues("editor")
.idpMetadataUrl("https://my_idp_metadata.url")
.workspaceId(exampleWorkspace.id())
.build());
}
}
resources:
example:
type: aws:grafana:WorkspaceSamlConfiguration
properties:
editorRoleValues:
- editor
idpMetadataUrl: https://my_idp_metadata.url
workspaceId: ${exampleWorkspace.id}
exampleWorkspace:
type: aws:grafana:Workspace
name: example
properties:
accountAccessType: CURRENT_ACCOUNT
authenticationProviders:
- SAML
permissionType: SERVICE_MANAGED
roleArn: ${assume.arn}
assume:
type: aws:iam:Role
properties:
name: grafana-assume
assumeRolePolicy:
fn::toJSON:
Version: 2012-10-17
Statement:
- Action: sts:AssumeRole
Effect: Allow
Sid: ""
Principal:
Service: grafana.amazonaws.com
Import
Using pulumi import, import Grafana Workspace SAML configuration using the workspace's id. For example:
$ pulumi import aws:grafana/workspaceSamlConfiguration:WorkspaceSamlConfiguration example g-2054c75a02
Constructors
- WorkspaceSamlConfiguration(String name, {WorkspaceSamlConfigurationArgs? args, CustomResourceOptions? options})
-
Creates a new WorkspaceSamlConfiguration.
nameThe Pulumi resource name.argsArguments used to configure this WorkspaceSamlConfiguration. The set of arguments for WorkspaceSamlConfiguration.optionsResource options controlling this resource's behavior. - WorkspaceSamlConfiguration.reference(String urn)
- Creates a typed reference to an existing WorkspaceSamlConfiguration resource.
Properties
-
adminRoleValues
↔ Output<
List< String> ?> -
The admin role values.
latefinal
-
allowedOrganizations
↔ Output<
List< String> ?> -
The allowed organizations.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
editorRoleValues
↔ Output<
List< String> > -
The editor role values.
latefinal
-
emailAssertion
↔ Output<
String> -
The email assertion.
latefinal
-
groupsAssertion
↔ Output<
String?> -
The groups assertion.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
-
idpMetadataUrl
↔ Output<
String?> -
The IDP Metadata URL. Note that either
idpMetadataUrloridpMetadataXml(but not both) must be specified.latefinal -
idpMetadataXml
↔ Output<
String?> -
The IDP Metadata XML. Note that either
idpMetadataUrloridpMetadataXml(but not both) must be specified.latefinal - isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
loginAssertion
↔ Output<
String> -
The login assertion.
latefinal
-
loginValidityDuration
↔ Output<
int> -
The login validity duration.
latefinal
-
nameAssertion
↔ Output<
String> -
The name assertion.
latefinal
-
orgAssertion
↔ Output<
String?> -
The org assertion.
latefinal
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
-
roleAssertion
↔ Output<
String?> -
The role assertion.
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
status
↔ Output<
String> -
The status of the SAML configuration.
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
-
workspaceId
↔ Output<
String> -
The workspace id.
latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {WorkspaceSamlConfigurationState? state, CustomResourceOptions? options}) → WorkspaceSamlConfiguration -
Gets an existing WorkspaceSamlConfiguration resource's state with the given
nameandid.