aws.grafana.LicenseAssociation
Explore with Pulumi AI
Provides an Amazon Managed Grafana workspace license association 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.LicenseAssociation("example", {
    licenseType: "ENTERPRISE_FREE_TRIAL",
    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.LicenseAssociation("example",
    license_type="ENTERPRISE_FREE_TRIAL",
    workspace_id=example_workspace.id)
package main
import (
	"encoding/json"
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/grafana"
	"github.com/pulumi/pulumi-aws/sdk/v6/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]interface{}{
						"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.NewLicenseAssociation(ctx, "example", &grafana.LicenseAssociationArgs{
			LicenseType: pulumi.String("ENTERPRISE_FREE_TRIAL"),
			WorkspaceId: exampleWorkspace.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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.LicenseAssociation("example", new()
    {
        LicenseType = "ENTERPRISE_FREE_TRIAL",
        WorkspaceId = exampleWorkspace.Id,
    });
});
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.LicenseAssociation;
import com.pulumi.aws.grafana.LicenseAssociationArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
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 LicenseAssociation("example", LicenseAssociationArgs.builder()
            .licenseType("ENTERPRISE_FREE_TRIAL")
            .workspaceId(exampleWorkspace.id())
            .build());
    }
}
resources:
  example:
    type: aws:grafana:LicenseAssociation
    properties:
      licenseType: ENTERPRISE_FREE_TRIAL
      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
Create LicenseAssociation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new LicenseAssociation(name: string, args: LicenseAssociationArgs, opts?: CustomResourceOptions);@overload
def LicenseAssociation(resource_name: str,
                       args: LicenseAssociationArgs,
                       opts: Optional[ResourceOptions] = None)
@overload
def LicenseAssociation(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       license_type: Optional[str] = None,
                       workspace_id: Optional[str] = None,
                       grafana_token: Optional[str] = None)func NewLicenseAssociation(ctx *Context, name string, args LicenseAssociationArgs, opts ...ResourceOption) (*LicenseAssociation, error)public LicenseAssociation(string name, LicenseAssociationArgs args, CustomResourceOptions? opts = null)
public LicenseAssociation(String name, LicenseAssociationArgs args)
public LicenseAssociation(String name, LicenseAssociationArgs args, CustomResourceOptions options)
type: aws:grafana:LicenseAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args LicenseAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args LicenseAssociationArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args LicenseAssociationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LicenseAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LicenseAssociationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var licenseAssociationResource = new Aws.Grafana.LicenseAssociation("licenseAssociationResource", new()
{
    LicenseType = "string",
    WorkspaceId = "string",
    GrafanaToken = "string",
});
example, err := grafana.NewLicenseAssociation(ctx, "licenseAssociationResource", &grafana.LicenseAssociationArgs{
	LicenseType:  pulumi.String("string"),
	WorkspaceId:  pulumi.String("string"),
	GrafanaToken: pulumi.String("string"),
})
var licenseAssociationResource = new LicenseAssociation("licenseAssociationResource", LicenseAssociationArgs.builder()
    .licenseType("string")
    .workspaceId("string")
    .grafanaToken("string")
    .build());
license_association_resource = aws.grafana.LicenseAssociation("licenseAssociationResource",
    license_type="string",
    workspace_id="string",
    grafana_token="string")
const licenseAssociationResource = new aws.grafana.LicenseAssociation("licenseAssociationResource", {
    licenseType: "string",
    workspaceId: "string",
    grafanaToken: "string",
});
type: aws:grafana:LicenseAssociation
properties:
    grafanaToken: string
    licenseType: string
    workspaceId: string
LicenseAssociation Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The LicenseAssociation resource accepts the following input properties:
- LicenseType string
- The type of license for the workspace license association. Valid values are ENTERPRISEandENTERPRISE_FREE_TRIAL.
- WorkspaceId string
- The workspace id.
- GrafanaToken string
- A token from Grafana Labs that ties your AWS account with a Grafana Labs account.
- LicenseType string
- The type of license for the workspace license association. Valid values are ENTERPRISEandENTERPRISE_FREE_TRIAL.
- WorkspaceId string
- The workspace id.
- GrafanaToken string
- A token from Grafana Labs that ties your AWS account with a Grafana Labs account.
- licenseType String
- The type of license for the workspace license association. Valid values are ENTERPRISEandENTERPRISE_FREE_TRIAL.
- workspaceId String
- The workspace id.
- grafanaToken String
- A token from Grafana Labs that ties your AWS account with a Grafana Labs account.
- licenseType string
- The type of license for the workspace license association. Valid values are ENTERPRISEandENTERPRISE_FREE_TRIAL.
- workspaceId string
- The workspace id.
- grafanaToken string
- A token from Grafana Labs that ties your AWS account with a Grafana Labs account.
- license_type str
- The type of license for the workspace license association. Valid values are ENTERPRISEandENTERPRISE_FREE_TRIAL.
- workspace_id str
- The workspace id.
- grafana_token str
- A token from Grafana Labs that ties your AWS account with a Grafana Labs account.
- licenseType String
- The type of license for the workspace license association. Valid values are ENTERPRISEandENTERPRISE_FREE_TRIAL.
- workspaceId String
- The workspace id.
- grafanaToken String
- A token from Grafana Labs that ties your AWS account with a Grafana Labs account.
Outputs
All input properties are implicitly available as output properties. Additionally, the LicenseAssociation resource produces the following output properties:
- FreeTrial stringExpiration 
- If license_typeis set toENTERPRISE_FREE_TRIAL, this is the expiration date of the free trial.
- Id string
- The provider-assigned unique ID for this managed resource.
- LicenseExpiration string
- If license_typeis set toENTERPRISE, this is the expiration date of the enterprise license.
- FreeTrial stringExpiration 
- If license_typeis set toENTERPRISE_FREE_TRIAL, this is the expiration date of the free trial.
- Id string
- The provider-assigned unique ID for this managed resource.
- LicenseExpiration string
- If license_typeis set toENTERPRISE, this is the expiration date of the enterprise license.
- freeTrial StringExpiration 
- If license_typeis set toENTERPRISE_FREE_TRIAL, this is the expiration date of the free trial.
- id String
- The provider-assigned unique ID for this managed resource.
- licenseExpiration String
- If license_typeis set toENTERPRISE, this is the expiration date of the enterprise license.
- freeTrial stringExpiration 
- If license_typeis set toENTERPRISE_FREE_TRIAL, this is the expiration date of the free trial.
- id string
- The provider-assigned unique ID for this managed resource.
- licenseExpiration string
- If license_typeis set toENTERPRISE, this is the expiration date of the enterprise license.
- free_trial_ strexpiration 
- If license_typeis set toENTERPRISE_FREE_TRIAL, this is the expiration date of the free trial.
- id str
- The provider-assigned unique ID for this managed resource.
- license_expiration str
- If license_typeis set toENTERPRISE, this is the expiration date of the enterprise license.
- freeTrial StringExpiration 
- If license_typeis set toENTERPRISE_FREE_TRIAL, this is the expiration date of the free trial.
- id String
- The provider-assigned unique ID for this managed resource.
- licenseExpiration String
- If license_typeis set toENTERPRISE, this is the expiration date of the enterprise license.
Look up Existing LicenseAssociation Resource
Get an existing LicenseAssociation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: LicenseAssociationState, opts?: CustomResourceOptions): LicenseAssociation@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        free_trial_expiration: Optional[str] = None,
        grafana_token: Optional[str] = None,
        license_expiration: Optional[str] = None,
        license_type: Optional[str] = None,
        workspace_id: Optional[str] = None) -> LicenseAssociationfunc GetLicenseAssociation(ctx *Context, name string, id IDInput, state *LicenseAssociationState, opts ...ResourceOption) (*LicenseAssociation, error)public static LicenseAssociation Get(string name, Input<string> id, LicenseAssociationState? state, CustomResourceOptions? opts = null)public static LicenseAssociation get(String name, Output<String> id, LicenseAssociationState state, CustomResourceOptions options)resources:  _:    type: aws:grafana:LicenseAssociation    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- FreeTrial stringExpiration 
- If license_typeis set toENTERPRISE_FREE_TRIAL, this is the expiration date of the free trial.
- GrafanaToken string
- A token from Grafana Labs that ties your AWS account with a Grafana Labs account.
- LicenseExpiration string
- If license_typeis set toENTERPRISE, this is the expiration date of the enterprise license.
- LicenseType string
- The type of license for the workspace license association. Valid values are ENTERPRISEandENTERPRISE_FREE_TRIAL.
- WorkspaceId string
- The workspace id.
- FreeTrial stringExpiration 
- If license_typeis set toENTERPRISE_FREE_TRIAL, this is the expiration date of the free trial.
- GrafanaToken string
- A token from Grafana Labs that ties your AWS account with a Grafana Labs account.
- LicenseExpiration string
- If license_typeis set toENTERPRISE, this is the expiration date of the enterprise license.
- LicenseType string
- The type of license for the workspace license association. Valid values are ENTERPRISEandENTERPRISE_FREE_TRIAL.
- WorkspaceId string
- The workspace id.
- freeTrial StringExpiration 
- If license_typeis set toENTERPRISE_FREE_TRIAL, this is the expiration date of the free trial.
- grafanaToken String
- A token from Grafana Labs that ties your AWS account with a Grafana Labs account.
- licenseExpiration String
- If license_typeis set toENTERPRISE, this is the expiration date of the enterprise license.
- licenseType String
- The type of license for the workspace license association. Valid values are ENTERPRISEandENTERPRISE_FREE_TRIAL.
- workspaceId String
- The workspace id.
- freeTrial stringExpiration 
- If license_typeis set toENTERPRISE_FREE_TRIAL, this is the expiration date of the free trial.
- grafanaToken string
- A token from Grafana Labs that ties your AWS account with a Grafana Labs account.
- licenseExpiration string
- If license_typeis set toENTERPRISE, this is the expiration date of the enterprise license.
- licenseType string
- The type of license for the workspace license association. Valid values are ENTERPRISEandENTERPRISE_FREE_TRIAL.
- workspaceId string
- The workspace id.
- free_trial_ strexpiration 
- If license_typeis set toENTERPRISE_FREE_TRIAL, this is the expiration date of the free trial.
- grafana_token str
- A token from Grafana Labs that ties your AWS account with a Grafana Labs account.
- license_expiration str
- If license_typeis set toENTERPRISE, this is the expiration date of the enterprise license.
- license_type str
- The type of license for the workspace license association. Valid values are ENTERPRISEandENTERPRISE_FREE_TRIAL.
- workspace_id str
- The workspace id.
- freeTrial StringExpiration 
- If license_typeis set toENTERPRISE_FREE_TRIAL, this is the expiration date of the free trial.
- grafanaToken String
- A token from Grafana Labs that ties your AWS account with a Grafana Labs account.
- licenseExpiration String
- If license_typeis set toENTERPRISE, this is the expiration date of the enterprise license.
- licenseType String
- The type of license for the workspace license association. Valid values are ENTERPRISEandENTERPRISE_FREE_TRIAL.
- workspaceId String
- The workspace id.
Import
Using pulumi import, import Grafana workspace license association using the workspace’s id. For example:
$ pulumi import aws:grafana/licenseAssociation:LicenseAssociation example g-2054c75a02
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.