1. Packages
  2. Github Provider
  3. API Docs
  4. TeamSyncGroupMapping
GitHub v6.7.0 published on Friday, Feb 28, 2025 by Pulumi

github.TeamSyncGroupMapping

Explore with Pulumi AI

This resource allows you to create and manage Identity Provider (IdP) group connections within your GitHub teams. You must have team synchronization enabled for organizations owned by enterprise accounts.

To learn more about team synchronization between IdPs and GitHub, please refer to: https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/synchronizing-teams-between-your-identity-provider-and-github

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";

const exampleGroups = github.getOrganizationTeamSyncGroups({});
const exampleGroupMapping = new github.TeamSyncGroupMapping("example_group_mapping", {
    groups: .map(entry => ({
        groupId: entry.value.groupId,
        groupName: entry.value.groupName,
        groupDescription: entry.value.groupDescription,
    })),
    teamSlug: "example",
});
Copy
import pulumi
import pulumi_github as github

example_groups = github.get_organization_team_sync_groups()
example_group_mapping = github.TeamSyncGroupMapping("example_group_mapping",
    groups=[{
        "group_id": entry["value"],
        "group_name": entry["value"],
        "group_description": entry["value"],
    } for entry in [{"key": k, "value": v} for k, v in [g for g in example_groups.groups if g.group_name == "some_team_group"]]],
    team_slug="example")
Copy
Coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;

return await Deployment.RunAsync(() => 
{
    var exampleGroups = Github.GetOrganizationTeamSyncGroups.Invoke();

    var exampleGroupMapping = new Github.TeamSyncGroupMapping("example_group_mapping", new()
    {
        Groups = ,
        TeamSlug = "example",
    });

});
Copy
Coming soon!
Coming soon!

Create TeamSyncGroupMapping Resource

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

Constructor syntax

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

@overload
def TeamSyncGroupMapping(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         team_slug: Optional[str] = None,
                         groups: Optional[Sequence[TeamSyncGroupMappingGroupArgs]] = None)
func NewTeamSyncGroupMapping(ctx *Context, name string, args TeamSyncGroupMappingArgs, opts ...ResourceOption) (*TeamSyncGroupMapping, error)
public TeamSyncGroupMapping(string name, TeamSyncGroupMappingArgs args, CustomResourceOptions? opts = null)
public TeamSyncGroupMapping(String name, TeamSyncGroupMappingArgs args)
public TeamSyncGroupMapping(String name, TeamSyncGroupMappingArgs args, CustomResourceOptions options)
type: github:TeamSyncGroupMapping
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. TeamSyncGroupMappingArgs
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. TeamSyncGroupMappingArgs
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. TeamSyncGroupMappingArgs
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. TeamSyncGroupMappingArgs
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. TeamSyncGroupMappingArgs
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 teamSyncGroupMappingResource = new Github.TeamSyncGroupMapping("teamSyncGroupMappingResource", new()
{
    TeamSlug = "string",
    Groups = new[]
    {
        new Github.Inputs.TeamSyncGroupMappingGroupArgs
        {
            GroupDescription = "string",
            GroupId = "string",
            GroupName = "string",
        },
    },
});
Copy
example, err := github.NewTeamSyncGroupMapping(ctx, "teamSyncGroupMappingResource", &github.TeamSyncGroupMappingArgs{
	TeamSlug: pulumi.String("string"),
	Groups: github.TeamSyncGroupMappingGroupArray{
		&github.TeamSyncGroupMappingGroupArgs{
			GroupDescription: pulumi.String("string"),
			GroupId:          pulumi.String("string"),
			GroupName:        pulumi.String("string"),
		},
	},
})
Copy
var teamSyncGroupMappingResource = new TeamSyncGroupMapping("teamSyncGroupMappingResource", TeamSyncGroupMappingArgs.builder()
    .teamSlug("string")
    .groups(TeamSyncGroupMappingGroupArgs.builder()
        .groupDescription("string")
        .groupId("string")
        .groupName("string")
        .build())
    .build());
Copy
team_sync_group_mapping_resource = github.TeamSyncGroupMapping("teamSyncGroupMappingResource",
    team_slug="string",
    groups=[{
        "group_description": "string",
        "group_id": "string",
        "group_name": "string",
    }])
Copy
const teamSyncGroupMappingResource = new github.TeamSyncGroupMapping("teamSyncGroupMappingResource", {
    teamSlug: "string",
    groups: [{
        groupDescription: "string",
        groupId: "string",
        groupName: "string",
    }],
});
Copy
type: github:TeamSyncGroupMapping
properties:
    groups:
        - groupDescription: string
          groupId: string
          groupName: string
    teamSlug: string
Copy

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

TeamSlug This property is required. string
Slug of the team
Groups Changes to this property will trigger replacement. List<TeamSyncGroupMappingGroup>

An Array of GitHub Identity Provider Groups (or empty []). Each group block consists of the fields documented below.


The group block consists of:

TeamSlug This property is required. string
Slug of the team
Groups Changes to this property will trigger replacement. []TeamSyncGroupMappingGroupArgs

An Array of GitHub Identity Provider Groups (or empty []). Each group block consists of the fields documented below.


The group block consists of:

teamSlug This property is required. String
Slug of the team
groups Changes to this property will trigger replacement. List<TeamSyncGroupMappingGroup>

An Array of GitHub Identity Provider Groups (or empty []). Each group block consists of the fields documented below.


The group block consists of:

teamSlug This property is required. string
Slug of the team
groups Changes to this property will trigger replacement. TeamSyncGroupMappingGroup[]

An Array of GitHub Identity Provider Groups (or empty []). Each group block consists of the fields documented below.


The group block consists of:

team_slug This property is required. str
Slug of the team
groups Changes to this property will trigger replacement. Sequence[TeamSyncGroupMappingGroupArgs]

An Array of GitHub Identity Provider Groups (or empty []). Each group block consists of the fields documented below.


The group block consists of:

teamSlug This property is required. String
Slug of the team
groups Changes to this property will trigger replacement. List<Property Map>

An Array of GitHub Identity Provider Groups (or empty []). Each group block consists of the fields documented below.


The group block consists of:

Outputs

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

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

Look up Existing TeamSyncGroupMapping Resource

Get an existing TeamSyncGroupMapping 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?: TeamSyncGroupMappingState, opts?: CustomResourceOptions): TeamSyncGroupMapping
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        etag: Optional[str] = None,
        groups: Optional[Sequence[TeamSyncGroupMappingGroupArgs]] = None,
        team_slug: Optional[str] = None) -> TeamSyncGroupMapping
func GetTeamSyncGroupMapping(ctx *Context, name string, id IDInput, state *TeamSyncGroupMappingState, opts ...ResourceOption) (*TeamSyncGroupMapping, error)
public static TeamSyncGroupMapping Get(string name, Input<string> id, TeamSyncGroupMappingState? state, CustomResourceOptions? opts = null)
public static TeamSyncGroupMapping get(String name, Output<String> id, TeamSyncGroupMappingState state, CustomResourceOptions options)
resources:  _:    type: github:TeamSyncGroupMapping    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:
Etag string
Groups Changes to this property will trigger replacement. List<TeamSyncGroupMappingGroup>

An Array of GitHub Identity Provider Groups (or empty []). Each group block consists of the fields documented below.


The group block consists of:

TeamSlug string
Slug of the team
Etag string
Groups Changes to this property will trigger replacement. []TeamSyncGroupMappingGroupArgs

An Array of GitHub Identity Provider Groups (or empty []). Each group block consists of the fields documented below.


The group block consists of:

TeamSlug string
Slug of the team
etag String
groups Changes to this property will trigger replacement. List<TeamSyncGroupMappingGroup>

An Array of GitHub Identity Provider Groups (or empty []). Each group block consists of the fields documented below.


The group block consists of:

teamSlug String
Slug of the team
etag string
groups Changes to this property will trigger replacement. TeamSyncGroupMappingGroup[]

An Array of GitHub Identity Provider Groups (or empty []). Each group block consists of the fields documented below.


The group block consists of:

teamSlug string
Slug of the team
etag str
groups Changes to this property will trigger replacement. Sequence[TeamSyncGroupMappingGroupArgs]

An Array of GitHub Identity Provider Groups (or empty []). Each group block consists of the fields documented below.


The group block consists of:

team_slug str
Slug of the team
etag String
groups Changes to this property will trigger replacement. List<Property Map>

An Array of GitHub Identity Provider Groups (or empty []). Each group block consists of the fields documented below.


The group block consists of:

teamSlug String
Slug of the team

Supporting Types

TeamSyncGroupMappingGroup
, TeamSyncGroupMappingGroupArgs

GroupDescription This property is required. string
The description of the IdP group.
GroupId This property is required. string
The ID of the IdP group.
GroupName This property is required. string
The name of the IdP group.
GroupDescription This property is required. string
The description of the IdP group.
GroupId This property is required. string
The ID of the IdP group.
GroupName This property is required. string
The name of the IdP group.
groupDescription This property is required. String
The description of the IdP group.
groupId This property is required. String
The ID of the IdP group.
groupName This property is required. String
The name of the IdP group.
groupDescription This property is required. string
The description of the IdP group.
groupId This property is required. string
The ID of the IdP group.
groupName This property is required. string
The name of the IdP group.
group_description This property is required. str
The description of the IdP group.
group_id This property is required. str
The ID of the IdP group.
group_name This property is required. str
The name of the IdP group.
groupDescription This property is required. String
The description of the IdP group.
groupId This property is required. String
The ID of the IdP group.
groupName This property is required. String
The name of the IdP group.

Import

GitHub Team Sync Group Mappings can be imported using the GitHub team slug e.g.

$ pulumi import github:index/teamSyncGroupMapping:TeamSyncGroupMapping example some_team
Copy

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

Package Details

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