1. Registry
  2. Packages
  3. Grafana Cloud
  4. API Docs
  5. onCall
  6. TeamAccessManagement
Viewing docs for Grafana v2.45.0
published on Monday, Nov 9, 2026 by pulumiverse
grafana logo Grafana
Viewing docs for Grafana v2.45.0
published on Monday, Nov 9, 2026 by pulumiverse

    Manages the Team Access Management setting of a Grafana OnCall team.

    Destroying this resource resets the team’s setting to the OnCall default (resources visible to all users).

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as grafana from "@pulumiverse/grafana";
    
    const exampleTeam = new grafana.oss.Team("example", {name: "Example team"});
    const example = grafana.onCall.getTeamOutput({
        name: exampleTeam.name,
    });
    // Restrict the team's OnCall resources to team members and admins
    const exampleTeamAccessManagement = new grafana.oncall.TeamAccessManagement("example", {
        teamId: example.apply(example => example.id),
        isSharingResourcesToAll: false,
    });
    
    import pulumi
    import pulumi_grafana as grafana
    import pulumiverse_grafana as grafana
    
    example_team = grafana.oss.Team("example", name="Example team")
    example = grafana.onCall.get_team_output(name=example_team.name)
    # Restrict the team's OnCall resources to team members and admins
    example_team_access_management = grafana.oncall.TeamAccessManagement("example",
        team_id=example.id,
        is_sharing_resources_to_all=False)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-grafana/sdk/v2/go/grafana/oncall"
    	"github.com/pulumiverse/pulumi-grafana/sdk/v2/go/grafana/oss"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleTeam, err := oss.NewTeam(ctx, "example", &oss.TeamArgs{
    			Name: pulumi.String("Example team"),
    		})
    		if err != nil {
    			return err
    		}
    		example := oncall.GetTeamOutput(ctx, oncall.GetTeamOutputArgs{
    			Name: exampleTeam.Name,
    		}, nil)
    		// Restrict the team's OnCall resources to team members and admins
    		_, err = oncall.NewTeamAccessManagement(ctx, "example", &oncall.TeamAccessManagementArgs{
    			TeamId: pulumi.String(example.ApplyT(func(example oncall.GetTeamResult) (*string, error) {
    				return &example.Id, nil
    			}).(pulumi.StringPtrOutput)),
    			IsSharingResourcesToAll: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Grafana = Pulumiverse.Grafana;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleTeam = new Grafana.Oss.Team("example", new()
        {
            Name = "Example team",
        });
    
        var example = Grafana.OnCall.GetTeam.Invoke(new()
        {
            Name = exampleTeam.Name,
        });
    
        // Restrict the team's OnCall resources to team members and admins
        var exampleTeamAccessManagement = new Grafana.OnCall.TeamAccessManagement("example", new()
        {
            TeamId = example.Apply(getTeamResult => getTeamResult.Id),
            IsSharingResourcesToAll = false,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.grafana.oss.Team;
    import com.pulumi.grafana.oss.TeamArgs;
    import com.pulumi.grafana.onCall.OnCallFunctions;
    import com.pulumi.grafana.onCall.inputs.GetTeamArgs;
    import com.pulumi.grafana.onCall.TeamAccessManagement;
    import com.pulumi.grafana.onCall.TeamAccessManagementArgs;
    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 exampleTeam = new Team("exampleTeam", TeamArgs.builder()
                .name("Example team")
                .build());
    
            final var example = OnCallFunctions.getTeam(GetTeamArgs.builder()
                .name(exampleTeam.name())
                .build());
    
            // Restrict the team's OnCall resources to team members and admins
            var exampleTeamAccessManagement = new TeamAccessManagement("exampleTeamAccessManagement", TeamAccessManagementArgs.builder()
                .teamId(example.applyValue(_example -> _example.id()))
                .isSharingResourcesToAll(false)
                .build());
    
        }
    }
    
    resources:
      exampleTeam:
        type: grafana:oss:Team
        name: example
        properties:
          name: Example team
      # Restrict the team's OnCall resources to team members and admins
      exampleTeamAccessManagement:
        type: grafana:onCall:TeamAccessManagement
        name: example
        properties:
          teamId: ${example.id}
          isSharingResourcesToAll: false
    variables:
      example:
        fn::invoke:
          function: grafana:onCall:getTeam
          arguments:
            name: ${exampleTeam.name}
    
    Example coming soon!
    

    Create TeamAccessManagement Resource

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

    Constructor syntax

    new TeamAccessManagement(name: string, args: TeamAccessManagementArgs, opts?: CustomResourceOptions);
    @overload
    def TeamAccessManagement(resource_name: str,
                             args: TeamAccessManagementArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def TeamAccessManagement(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             is_sharing_resources_to_all: Optional[bool] = None,
                             team_id: Optional[str] = None)
    func NewTeamAccessManagement(ctx *Context, name string, args TeamAccessManagementArgs, opts ...ResourceOption) (*TeamAccessManagement, error)
    public TeamAccessManagement(string name, TeamAccessManagementArgs args, CustomResourceOptions? opts = null)
    public TeamAccessManagement(String name, TeamAccessManagementArgs args)
    public TeamAccessManagement(String name, TeamAccessManagementArgs args, CustomResourceOptions options)
    
    type: grafana:onCall:TeamAccessManagement
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "grafana_on_call_team_access_management" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args TeamAccessManagementArgs
    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 TeamAccessManagementArgs
    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 TeamAccessManagementArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TeamAccessManagementArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TeamAccessManagementArgs
    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 teamAccessManagementResource = new Grafana.OnCall.TeamAccessManagement("teamAccessManagementResource", new()
    {
        IsSharingResourcesToAll = false,
        TeamId = "string",
    });
    
    example, err := oncall.NewTeamAccessManagement(ctx, "teamAccessManagementResource", &oncall.TeamAccessManagementArgs{
    	IsSharingResourcesToAll: pulumi.Bool(false),
    	TeamId:                  pulumi.String("string"),
    })
    
    resource "grafana_on_call_team_access_management" "teamAccessManagementResource" {
      lifecycle {
        create_before_destroy = true
      }
      is_sharing_resources_to_all = false
      team_id                     = "string"
    }
    
    var teamAccessManagementResource = new TeamAccessManagement("teamAccessManagementResource", TeamAccessManagementArgs.builder()
        .isSharingResourcesToAll(false)
        .teamId("string")
        .build());
    
    team_access_management_resource = grafana.oncall.TeamAccessManagement("teamAccessManagementResource",
        is_sharing_resources_to_all=False,
        team_id="string")
    
    const teamAccessManagementResource = new grafana.oncall.TeamAccessManagement("teamAccessManagementResource", {
        isSharingResourcesToAll: false,
        teamId: "string",
    });
    
    type: grafana:onCall:TeamAccessManagement
    properties:
        isSharingResourcesToAll: false
        teamId: string
    

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

    IsSharingResourcesToAll bool
    Whether the team's resources are visible to all users (true), or only to team members and admins (false).
    TeamId string
    The ID of the OnCall team, for example from the grafana.onCall.getTeam data source.
    IsSharingResourcesToAll bool
    Whether the team's resources are visible to all users (true), or only to team members and admins (false).
    TeamId string
    The ID of the OnCall team, for example from the grafana.onCall.getTeam data source.
    is_sharing_resources_to_all bool
    Whether the team's resources are visible to all users (true), or only to team members and admins (false).
    team_id string
    The ID of the OnCall team, for example from the grafana.onCall.getTeam data source.
    isSharingResourcesToAll Boolean
    Whether the team's resources are visible to all users (true), or only to team members and admins (false).
    teamId String
    The ID of the OnCall team, for example from the grafana.onCall.getTeam data source.
    isSharingResourcesToAll boolean
    Whether the team's resources are visible to all users (true), or only to team members and admins (false).
    teamId string
    The ID of the OnCall team, for example from the grafana.onCall.getTeam data source.
    is_sharing_resources_to_all bool
    Whether the team's resources are visible to all users (true), or only to team members and admins (false).
    team_id str
    The ID of the OnCall team, for example from the grafana.onCall.getTeam data source.
    isSharingResourcesToAll Boolean
    Whether the team's resources are visible to all users (true), or only to team members and admins (false).
    teamId String
    The ID of the OnCall team, for example from the grafana.onCall.getTeam data source.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing TeamAccessManagement Resource

    Get an existing TeamAccessManagement 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?: TeamAccessManagementState, opts?: CustomResourceOptions): TeamAccessManagement
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            is_sharing_resources_to_all: Optional[bool] = None,
            team_id: Optional[str] = None) -> TeamAccessManagement
    func GetTeamAccessManagement(ctx *Context, name string, id IDInput, state *TeamAccessManagementState, opts ...ResourceOption) (*TeamAccessManagement, error)
    public static TeamAccessManagement Get(string name, Input<string> id, TeamAccessManagementState? state, CustomResourceOptions? opts = null)
    public static TeamAccessManagement get(String name, Output<String> id, TeamAccessManagementState state, CustomResourceOptions options)
    resources:  _:    type: grafana:onCall:TeamAccessManagement    get:      id: ${id}
    import {
      to = grafana_on_call_team_access_management.example
      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.
    The following state arguments are supported:
    IsSharingResourcesToAll bool
    Whether the team's resources are visible to all users (true), or only to team members and admins (false).
    TeamId string
    The ID of the OnCall team, for example from the grafana.onCall.getTeam data source.
    IsSharingResourcesToAll bool
    Whether the team's resources are visible to all users (true), or only to team members and admins (false).
    TeamId string
    The ID of the OnCall team, for example from the grafana.onCall.getTeam data source.
    is_sharing_resources_to_all bool
    Whether the team's resources are visible to all users (true), or only to team members and admins (false).
    team_id string
    The ID of the OnCall team, for example from the grafana.onCall.getTeam data source.
    isSharingResourcesToAll Boolean
    Whether the team's resources are visible to all users (true), or only to team members and admins (false).
    teamId String
    The ID of the OnCall team, for example from the grafana.onCall.getTeam data source.
    isSharingResourcesToAll boolean
    Whether the team's resources are visible to all users (true), or only to team members and admins (false).
    teamId string
    The ID of the OnCall team, for example from the grafana.onCall.getTeam data source.
    is_sharing_resources_to_all bool
    Whether the team's resources are visible to all users (true), or only to team members and admins (false).
    team_id str
    The ID of the OnCall team, for example from the grafana.onCall.getTeam data source.
    isSharingResourcesToAll Boolean
    Whether the team's resources are visible to all users (true), or only to team members and admins (false).
    teamId String
    The ID of the OnCall team, for example from the grafana.onCall.getTeam data source.

    Import

    terraform import grafana_oncall_team_access_management.name "{{ id }}"
    

    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.
    grafana logo Grafana
    Viewing docs for Grafana v2.45.0
    published on Monday, Nov 9, 2026 by pulumiverse

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial