1. Packages
  2. Grafana Cloud
  3. API Docs
  4. cloud
  5. AccessPolicy
Grafana v0.16.3 published on Monday, Apr 7, 2025 by pulumiverse

grafana.cloud.AccessPolicy

Explore with Pulumi AI

Required access policy scopes:

  • accesspolicies:read
  • accesspolicies:write
  • accesspolicies:delete

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumi/grafana";
import * as grafana from "@pulumiverse/grafana";

const current = grafana.cloud.getOrganization({
    slug: "<your org slug>",
});
const test = new grafana.cloud.AccessPolicy("test", {
    region: "prod-us-east-0",
    name: "my-policy",
    displayName: "My Policy",
    scopes: [
        "metrics:read",
        "logs:read",
    ],
    realms: [{
        type: "org",
        identifier: current.then(current => current.id),
        labelPolicies: [{
            selector: "{namespace=\"default\"}",
        }],
    }],
});
const testAccessPolicyToken = new grafana.cloud.AccessPolicyToken("test", {
    region: "prod-us-east-0",
    accessPolicyId: test.policyId,
    name: "my-policy-token",
    displayName: "My Policy Token",
    expiresAt: "2023-01-01T00:00:00Z",
});
Copy
import pulumi
import pulumi_grafana as grafana
import pulumiverse_grafana as grafana

current = grafana.cloud.get_organization(slug="<your org slug>")
test = grafana.cloud.AccessPolicy("test",
    region="prod-us-east-0",
    name="my-policy",
    display_name="My Policy",
    scopes=[
        "metrics:read",
        "logs:read",
    ],
    realms=[{
        "type": "org",
        "identifier": current.id,
        "label_policies": [{
            "selector": "{namespace=\"default\"}",
        }],
    }])
test_access_policy_token = grafana.cloud.AccessPolicyToken("test",
    region="prod-us-east-0",
    access_policy_id=test.policy_id,
    name="my-policy-token",
    display_name="My Policy Token",
    expires_at="2023-01-01T00:00:00Z")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/cloud"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		current, err := cloud.GetOrganization(ctx, &cloud.GetOrganizationArgs{
			Slug: pulumi.StringRef("<your org slug>"),
		}, nil)
		if err != nil {
			return err
		}
		test, err := cloud.NewAccessPolicy(ctx, "test", &cloud.AccessPolicyArgs{
			Region:      pulumi.String("prod-us-east-0"),
			Name:        pulumi.String("my-policy"),
			DisplayName: pulumi.String("My Policy"),
			Scopes: pulumi.StringArray{
				pulumi.String("metrics:read"),
				pulumi.String("logs:read"),
			},
			Realms: cloud.AccessPolicyRealmArray{
				&cloud.AccessPolicyRealmArgs{
					Type:       pulumi.String("org"),
					Identifier: pulumi.String(current.Id),
					LabelPolicies: cloud.AccessPolicyRealmLabelPolicyArray{
						&cloud.AccessPolicyRealmLabelPolicyArgs{
							Selector: pulumi.String("{namespace=\"default\"}"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = cloud.NewAccessPolicyToken(ctx, "test", &cloud.AccessPolicyTokenArgs{
			Region:         pulumi.String("prod-us-east-0"),
			AccessPolicyId: test.PolicyId,
			Name:           pulumi.String("my-policy-token"),
			DisplayName:    pulumi.String("My Policy Token"),
			ExpiresAt:      pulumi.String("2023-01-01T00:00:00Z"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Pulumi.Grafana;
using Grafana = Pulumiverse.Grafana;

return await Deployment.RunAsync(() => 
{
    var current = Grafana.Cloud.GetOrganization.Invoke(new()
    {
        Slug = "<your org slug>",
    });

    var test = new Grafana.Cloud.AccessPolicy("test", new()
    {
        Region = "prod-us-east-0",
        Name = "my-policy",
        DisplayName = "My Policy",
        Scopes = new[]
        {
            "metrics:read",
            "logs:read",
        },
        Realms = new[]
        {
            new Grafana.Cloud.Inputs.AccessPolicyRealmArgs
            {
                Type = "org",
                Identifier = current.Apply(getOrganizationResult => getOrganizationResult.Id),
                LabelPolicies = new[]
                {
                    new Grafana.Cloud.Inputs.AccessPolicyRealmLabelPolicyArgs
                    {
                        Selector = "{namespace=\"default\"}",
                    },
                },
            },
        },
    });

    var testAccessPolicyToken = new Grafana.Cloud.AccessPolicyToken("test", new()
    {
        Region = "prod-us-east-0",
        AccessPolicyId = test.PolicyId,
        Name = "my-policy-token",
        DisplayName = "My Policy Token",
        ExpiresAt = "2023-01-01T00:00:00Z",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.cloud.CloudFunctions;
import com.pulumi.grafana.cloud.inputs.GetOrganizationArgs;
import com.pulumi.grafana.cloud.AccessPolicy;
import com.pulumi.grafana.cloud.AccessPolicyArgs;
import com.pulumi.grafana.cloud.inputs.AccessPolicyRealmArgs;
import com.pulumi.grafana.cloud.AccessPolicyToken;
import com.pulumi.grafana.cloud.AccessPolicyTokenArgs;
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) {
        final var current = CloudFunctions.getOrganization(GetOrganizationArgs.builder()
            .slug("<your org slug>")
            .build());

        var test = new AccessPolicy("test", AccessPolicyArgs.builder()
            .region("prod-us-east-0")
            .name("my-policy")
            .displayName("My Policy")
            .scopes(            
                "metrics:read",
                "logs:read")
            .realms(AccessPolicyRealmArgs.builder()
                .type("org")
                .identifier(current.applyValue(getOrganizationResult -> getOrganizationResult.id()))
                .labelPolicies(AccessPolicyRealmLabelPolicyArgs.builder()
                    .selector("{namespace=\"default\"}")
                    .build())
                .build())
            .build());

        var testAccessPolicyToken = new AccessPolicyToken("testAccessPolicyToken", AccessPolicyTokenArgs.builder()
            .region("prod-us-east-0")
            .accessPolicyId(test.policyId())
            .name("my-policy-token")
            .displayName("My Policy Token")
            .expiresAt("2023-01-01T00:00:00Z")
            .build());

    }
}
Copy
resources:
  test:
    type: grafana:cloud:AccessPolicy
    properties:
      region: prod-us-east-0
      name: my-policy
      displayName: My Policy
      scopes:
        - metrics:read
        - logs:read
      realms:
        - type: org
          identifier: ${current.id}
          labelPolicies:
            - selector: '{namespace="default"}'
  testAccessPolicyToken:
    type: grafana:cloud:AccessPolicyToken
    name: test
    properties:
      region: prod-us-east-0
      accessPolicyId: ${test.policyId}
      name: my-policy-token
      displayName: My Policy Token
      expiresAt: 2023-01-01T00:00:00Z
variables:
  current:
    fn::invoke:
      function: grafana:cloud:getOrganization
      arguments:
        slug: <your org slug>
Copy

Create AccessPolicy Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new AccessPolicy(name: string, args: AccessPolicyArgs, opts?: CustomResourceOptions);
@overload
def AccessPolicy(resource_name: str,
                 args: AccessPolicyArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def AccessPolicy(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 realms: Optional[Sequence[AccessPolicyRealmArgs]] = None,
                 region: Optional[str] = None,
                 scopes: Optional[Sequence[str]] = None,
                 conditions: Optional[Sequence[AccessPolicyConditionArgs]] = None,
                 display_name: Optional[str] = None,
                 name: Optional[str] = None)
func NewAccessPolicy(ctx *Context, name string, args AccessPolicyArgs, opts ...ResourceOption) (*AccessPolicy, error)
public AccessPolicy(string name, AccessPolicyArgs args, CustomResourceOptions? opts = null)
public AccessPolicy(String name, AccessPolicyArgs args)
public AccessPolicy(String name, AccessPolicyArgs args, CustomResourceOptions options)
type: grafana:cloud:AccessPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. AccessPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. AccessPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. AccessPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. AccessPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. AccessPolicyArgs
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 accessPolicyResource = new Grafana.Cloud.AccessPolicy("accessPolicyResource", new()
{
    Realms = new[]
    {
        new Grafana.Cloud.Inputs.AccessPolicyRealmArgs
        {
            Identifier = "string",
            Type = "string",
            LabelPolicies = new[]
            {
                new Grafana.Cloud.Inputs.AccessPolicyRealmLabelPolicyArgs
                {
                    Selector = "string",
                },
            },
        },
    },
    Region = "string",
    Scopes = new[]
    {
        "string",
    },
    Conditions = new[]
    {
        new Grafana.Cloud.Inputs.AccessPolicyConditionArgs
        {
            AllowedSubnets = new[]
            {
                "string",
            },
        },
    },
    DisplayName = "string",
    Name = "string",
});
Copy
example, err := cloud.NewAccessPolicy(ctx, "accessPolicyResource", &cloud.AccessPolicyArgs{
	Realms: cloud.AccessPolicyRealmArray{
		&cloud.AccessPolicyRealmArgs{
			Identifier: pulumi.String("string"),
			Type:       pulumi.String("string"),
			LabelPolicies: cloud.AccessPolicyRealmLabelPolicyArray{
				&cloud.AccessPolicyRealmLabelPolicyArgs{
					Selector: pulumi.String("string"),
				},
			},
		},
	},
	Region: pulumi.String("string"),
	Scopes: pulumi.StringArray{
		pulumi.String("string"),
	},
	Conditions: cloud.AccessPolicyConditionArray{
		&cloud.AccessPolicyConditionArgs{
			AllowedSubnets: pulumi.StringArray{
				pulumi.String("string"),
			},
		},
	},
	DisplayName: pulumi.String("string"),
	Name:        pulumi.String("string"),
})
Copy
var accessPolicyResource = new AccessPolicy("accessPolicyResource", AccessPolicyArgs.builder()
    .realms(AccessPolicyRealmArgs.builder()
        .identifier("string")
        .type("string")
        .labelPolicies(AccessPolicyRealmLabelPolicyArgs.builder()
            .selector("string")
            .build())
        .build())
    .region("string")
    .scopes("string")
    .conditions(AccessPolicyConditionArgs.builder()
        .allowedSubnets("string")
        .build())
    .displayName("string")
    .name("string")
    .build());
Copy
access_policy_resource = grafana.cloud.AccessPolicy("accessPolicyResource",
    realms=[{
        "identifier": "string",
        "type": "string",
        "label_policies": [{
            "selector": "string",
        }],
    }],
    region="string",
    scopes=["string"],
    conditions=[{
        "allowed_subnets": ["string"],
    }],
    display_name="string",
    name="string")
Copy
const accessPolicyResource = new grafana.cloud.AccessPolicy("accessPolicyResource", {
    realms: [{
        identifier: "string",
        type: "string",
        labelPolicies: [{
            selector: "string",
        }],
    }],
    region: "string",
    scopes: ["string"],
    conditions: [{
        allowedSubnets: ["string"],
    }],
    displayName: "string",
    name: "string",
});
Copy
type: grafana:cloud:AccessPolicy
properties:
    conditions:
        - allowedSubnets:
            - string
    displayName: string
    name: string
    realms:
        - identifier: string
          labelPolicies:
            - selector: string
          type: string
    region: string
    scopes:
        - string
Copy

AccessPolicy 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 AccessPolicy resource accepts the following input properties:

Realms This property is required. List<Pulumiverse.Grafana.Cloud.Inputs.AccessPolicyRealm>
Region
This property is required.
Changes to this property will trigger replacement.
string
Region where the API is deployed. Generally where the stack is deployed. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
Scopes This property is required. List<string>
Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values.
Conditions List<Pulumiverse.Grafana.Cloud.Inputs.AccessPolicyCondition>
Conditions for the access policy.
DisplayName string
Display name of the access policy. Defaults to the name.
Name Changes to this property will trigger replacement. string
Name of the access policy.
Realms This property is required. []AccessPolicyRealmArgs
Region
This property is required.
Changes to this property will trigger replacement.
string
Region where the API is deployed. Generally where the stack is deployed. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
Scopes This property is required. []string
Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values.
Conditions []AccessPolicyConditionArgs
Conditions for the access policy.
DisplayName string
Display name of the access policy. Defaults to the name.
Name Changes to this property will trigger replacement. string
Name of the access policy.
realms This property is required. List<AccessPolicyRealm>
region
This property is required.
Changes to this property will trigger replacement.
String
Region where the API is deployed. Generally where the stack is deployed. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
scopes This property is required. List<String>
Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values.
conditions List<AccessPolicyCondition>
Conditions for the access policy.
displayName String
Display name of the access policy. Defaults to the name.
name Changes to this property will trigger replacement. String
Name of the access policy.
realms This property is required. AccessPolicyRealm[]
region
This property is required.
Changes to this property will trigger replacement.
string
Region where the API is deployed. Generally where the stack is deployed. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
scopes This property is required. string[]
Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values.
conditions AccessPolicyCondition[]
Conditions for the access policy.
displayName string
Display name of the access policy. Defaults to the name.
name Changes to this property will trigger replacement. string
Name of the access policy.
realms This property is required. Sequence[AccessPolicyRealmArgs]
region
This property is required.
Changes to this property will trigger replacement.
str
Region where the API is deployed. Generally where the stack is deployed. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
scopes This property is required. Sequence[str]
Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values.
conditions Sequence[AccessPolicyConditionArgs]
Conditions for the access policy.
display_name str
Display name of the access policy. Defaults to the name.
name Changes to this property will trigger replacement. str
Name of the access policy.
realms This property is required. List<Property Map>
region
This property is required.
Changes to this property will trigger replacement.
String
Region where the API is deployed. Generally where the stack is deployed. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
scopes This property is required. List<String>
Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values.
conditions List<Property Map>
Conditions for the access policy.
displayName String
Display name of the access policy. Defaults to the name.
name Changes to this property will trigger replacement. String
Name of the access policy.

Outputs

All input properties are implicitly available as output properties. Additionally, the AccessPolicy resource produces the following output properties:

CreatedAt string
Creation date of the access policy.
Id string
The provider-assigned unique ID for this managed resource.
PolicyId string
ID of the access policy.
UpdatedAt string
Last update date of the access policy.
CreatedAt string
Creation date of the access policy.
Id string
The provider-assigned unique ID for this managed resource.
PolicyId string
ID of the access policy.
UpdatedAt string
Last update date of the access policy.
createdAt String
Creation date of the access policy.
id String
The provider-assigned unique ID for this managed resource.
policyId String
ID of the access policy.
updatedAt String
Last update date of the access policy.
createdAt string
Creation date of the access policy.
id string
The provider-assigned unique ID for this managed resource.
policyId string
ID of the access policy.
updatedAt string
Last update date of the access policy.
created_at str
Creation date of the access policy.
id str
The provider-assigned unique ID for this managed resource.
policy_id str
ID of the access policy.
updated_at str
Last update date of the access policy.
createdAt String
Creation date of the access policy.
id String
The provider-assigned unique ID for this managed resource.
policyId String
ID of the access policy.
updatedAt String
Last update date of the access policy.

Look up Existing AccessPolicy Resource

Get an existing AccessPolicy 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?: AccessPolicyState, opts?: CustomResourceOptions): AccessPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        conditions: Optional[Sequence[AccessPolicyConditionArgs]] = None,
        created_at: Optional[str] = None,
        display_name: Optional[str] = None,
        name: Optional[str] = None,
        policy_id: Optional[str] = None,
        realms: Optional[Sequence[AccessPolicyRealmArgs]] = None,
        region: Optional[str] = None,
        scopes: Optional[Sequence[str]] = None,
        updated_at: Optional[str] = None) -> AccessPolicy
func GetAccessPolicy(ctx *Context, name string, id IDInput, state *AccessPolicyState, opts ...ResourceOption) (*AccessPolicy, error)
public static AccessPolicy Get(string name, Input<string> id, AccessPolicyState? state, CustomResourceOptions? opts = null)
public static AccessPolicy get(String name, Output<String> id, AccessPolicyState state, CustomResourceOptions options)
resources:  _:    type: grafana:cloud:AccessPolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
Conditions List<Pulumiverse.Grafana.Cloud.Inputs.AccessPolicyCondition>
Conditions for the access policy.
CreatedAt string
Creation date of the access policy.
DisplayName string
Display name of the access policy. Defaults to the name.
Name Changes to this property will trigger replacement. string
Name of the access policy.
PolicyId string
ID of the access policy.
Realms List<Pulumiverse.Grafana.Cloud.Inputs.AccessPolicyRealm>
Region Changes to this property will trigger replacement. string
Region where the API is deployed. Generally where the stack is deployed. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
Scopes List<string>
Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values.
UpdatedAt string
Last update date of the access policy.
Conditions []AccessPolicyConditionArgs
Conditions for the access policy.
CreatedAt string
Creation date of the access policy.
DisplayName string
Display name of the access policy. Defaults to the name.
Name Changes to this property will trigger replacement. string
Name of the access policy.
PolicyId string
ID of the access policy.
Realms []AccessPolicyRealmArgs
Region Changes to this property will trigger replacement. string
Region where the API is deployed. Generally where the stack is deployed. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
Scopes []string
Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values.
UpdatedAt string
Last update date of the access policy.
conditions List<AccessPolicyCondition>
Conditions for the access policy.
createdAt String
Creation date of the access policy.
displayName String
Display name of the access policy. Defaults to the name.
name Changes to this property will trigger replacement. String
Name of the access policy.
policyId String
ID of the access policy.
realms List<AccessPolicyRealm>
region Changes to this property will trigger replacement. String
Region where the API is deployed. Generally where the stack is deployed. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
scopes List<String>
Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values.
updatedAt String
Last update date of the access policy.
conditions AccessPolicyCondition[]
Conditions for the access policy.
createdAt string
Creation date of the access policy.
displayName string
Display name of the access policy. Defaults to the name.
name Changes to this property will trigger replacement. string
Name of the access policy.
policyId string
ID of the access policy.
realms AccessPolicyRealm[]
region Changes to this property will trigger replacement. string
Region where the API is deployed. Generally where the stack is deployed. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
scopes string[]
Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values.
updatedAt string
Last update date of the access policy.
conditions Sequence[AccessPolicyConditionArgs]
Conditions for the access policy.
created_at str
Creation date of the access policy.
display_name str
Display name of the access policy. Defaults to the name.
name Changes to this property will trigger replacement. str
Name of the access policy.
policy_id str
ID of the access policy.
realms Sequence[AccessPolicyRealmArgs]
region Changes to this property will trigger replacement. str
Region where the API is deployed. Generally where the stack is deployed. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
scopes Sequence[str]
Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values.
updated_at str
Last update date of the access policy.
conditions List<Property Map>
Conditions for the access policy.
createdAt String
Creation date of the access policy.
displayName String
Display name of the access policy. Defaults to the name.
name Changes to this property will trigger replacement. String
Name of the access policy.
policyId String
ID of the access policy.
realms List<Property Map>
region Changes to this property will trigger replacement. String
Region where the API is deployed. Generally where the stack is deployed. Use the region list API to get the list of available regions: https://grafana.com/docs/grafana-cloud/developer-resources/api-reference/cloud-api/#list-regions.
scopes List<String>
Scopes of the access policy. See https://grafana.com/docs/grafana-cloud/security-and-account-management/authentication-and-permissions/access-policies/#scopes for possible values.
updatedAt String
Last update date of the access policy.

Supporting Types

AccessPolicyCondition
, AccessPolicyConditionArgs

AllowedSubnets This property is required. List<string>
Conditions that apply to the access policy,such as IP Allow lists.
AllowedSubnets This property is required. []string
Conditions that apply to the access policy,such as IP Allow lists.
allowedSubnets This property is required. List<String>
Conditions that apply to the access policy,such as IP Allow lists.
allowedSubnets This property is required. string[]
Conditions that apply to the access policy,such as IP Allow lists.
allowed_subnets This property is required. Sequence[str]
Conditions that apply to the access policy,such as IP Allow lists.
allowedSubnets This property is required. List<String>
Conditions that apply to the access policy,such as IP Allow lists.

AccessPolicyRealm
, AccessPolicyRealmArgs

Identifier This property is required. string
The identifier of the org or stack. For orgs, this is the slug, for stacks, this is the stack ID.
Type This property is required. string
Whether a policy applies to a Cloud org or a specific stack. Should be one of org or stack.
LabelPolicies List<Pulumiverse.Grafana.Cloud.Inputs.AccessPolicyRealmLabelPolicy>
Identifier This property is required. string
The identifier of the org or stack. For orgs, this is the slug, for stacks, this is the stack ID.
Type This property is required. string
Whether a policy applies to a Cloud org or a specific stack. Should be one of org or stack.
LabelPolicies []AccessPolicyRealmLabelPolicy
identifier This property is required. String
The identifier of the org or stack. For orgs, this is the slug, for stacks, this is the stack ID.
type This property is required. String
Whether a policy applies to a Cloud org or a specific stack. Should be one of org or stack.
labelPolicies List<AccessPolicyRealmLabelPolicy>
identifier This property is required. string
The identifier of the org or stack. For orgs, this is the slug, for stacks, this is the stack ID.
type This property is required. string
Whether a policy applies to a Cloud org or a specific stack. Should be one of org or stack.
labelPolicies AccessPolicyRealmLabelPolicy[]
identifier This property is required. str
The identifier of the org or stack. For orgs, this is the slug, for stacks, this is the stack ID.
type This property is required. str
Whether a policy applies to a Cloud org or a specific stack. Should be one of org or stack.
label_policies Sequence[AccessPolicyRealmLabelPolicy]
identifier This property is required. String
The identifier of the org or stack. For orgs, this is the slug, for stacks, this is the stack ID.
type This property is required. String
Whether a policy applies to a Cloud org or a specific stack. Should be one of org or stack.
labelPolicies List<Property Map>

AccessPolicyRealmLabelPolicy
, AccessPolicyRealmLabelPolicyArgs

Selector This property is required. string
The label selector to match in metrics or logs query. Should be in PromQL or LogQL format.
Selector This property is required. string
The label selector to match in metrics or logs query. Should be in PromQL or LogQL format.
selector This property is required. String
The label selector to match in metrics or logs query. Should be in PromQL or LogQL format.
selector This property is required. string
The label selector to match in metrics or logs query. Should be in PromQL or LogQL format.
selector This property is required. str
The label selector to match in metrics or logs query. Should be in PromQL or LogQL format.
selector This property is required. String
The label selector to match in metrics or logs query. Should be in PromQL or LogQL format.

Import

$ pulumi import grafana:cloud/accessPolicy:AccessPolicy name "{{ region }}:{{ policyId }}"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
grafana pulumiverse/pulumi-grafana
License
Apache-2.0
Notes
This Pulumi package is based on the grafana Terraform Provider.