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

github.EnterpriseOrganization

Explore with Pulumi AI

This resource allows you to create and manage a GitHub enterprise organization.

Example Usage

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

const org = new github.EnterpriseOrganization("org", {
    enterpriseId: enterprise.id,
    name: "some-awesome-org",
    displayName: "Some Awesome Org",
    description: "Organization created with terraform",
    billingEmail: "jon@winteriscoming.com",
    adminLogins: ["jon-snow"],
});
Copy
import pulumi
import pulumi_github as github

org = github.EnterpriseOrganization("org",
    enterprise_id=enterprise["id"],
    name="some-awesome-org",
    display_name="Some Awesome Org",
    description="Organization created with terraform",
    billing_email="jon@winteriscoming.com",
    admin_logins=["jon-snow"])
Copy
package main

import (
	"github.com/pulumi/pulumi-github/sdk/v6/go/github"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := github.NewEnterpriseOrganization(ctx, "org", &github.EnterpriseOrganizationArgs{
			EnterpriseId: pulumi.Any(enterprise.Id),
			Name:         pulumi.String("some-awesome-org"),
			DisplayName:  pulumi.String("Some Awesome Org"),
			Description:  pulumi.String("Organization created with terraform"),
			BillingEmail: pulumi.String("jon@winteriscoming.com"),
			AdminLogins: pulumi.StringArray{
				pulumi.String("jon-snow"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;

return await Deployment.RunAsync(() => 
{
    var org = new Github.EnterpriseOrganization("org", new()
    {
        EnterpriseId = enterprise.Id,
        Name = "some-awesome-org",
        DisplayName = "Some Awesome Org",
        Description = "Organization created with terraform",
        BillingEmail = "jon@winteriscoming.com",
        AdminLogins = new[]
        {
            "jon-snow",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.EnterpriseOrganization;
import com.pulumi.github.EnterpriseOrganizationArgs;
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 org = new EnterpriseOrganization("org", EnterpriseOrganizationArgs.builder()
            .enterpriseId(enterprise.id())
            .name("some-awesome-org")
            .displayName("Some Awesome Org")
            .description("Organization created with terraform")
            .billingEmail("jon@winteriscoming.com")
            .adminLogins("jon-snow")
            .build());

    }
}
Copy
resources:
  org:
    type: github:EnterpriseOrganization
    properties:
      enterpriseId: ${enterprise.id}
      name: some-awesome-org
      displayName: Some Awesome Org
      description: Organization created with terraform
      billingEmail: jon@winteriscoming.com
      adminLogins:
        - jon-snow
Copy

Create EnterpriseOrganization Resource

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

Constructor syntax

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

@overload
def EnterpriseOrganization(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           admin_logins: Optional[Sequence[str]] = None,
                           billing_email: Optional[str] = None,
                           enterprise_id: Optional[str] = None,
                           description: Optional[str] = None,
                           display_name: Optional[str] = None,
                           name: Optional[str] = None)
func NewEnterpriseOrganization(ctx *Context, name string, args EnterpriseOrganizationArgs, opts ...ResourceOption) (*EnterpriseOrganization, error)
public EnterpriseOrganization(string name, EnterpriseOrganizationArgs args, CustomResourceOptions? opts = null)
public EnterpriseOrganization(String name, EnterpriseOrganizationArgs args)
public EnterpriseOrganization(String name, EnterpriseOrganizationArgs args, CustomResourceOptions options)
type: github:EnterpriseOrganization
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. EnterpriseOrganizationArgs
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. EnterpriseOrganizationArgs
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. EnterpriseOrganizationArgs
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. EnterpriseOrganizationArgs
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. EnterpriseOrganizationArgs
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 enterpriseOrganizationResource = new Github.EnterpriseOrganization("enterpriseOrganizationResource", new()
{
    AdminLogins = new[]
    {
        "string",
    },
    BillingEmail = "string",
    EnterpriseId = "string",
    Description = "string",
    DisplayName = "string",
    Name = "string",
});
Copy
example, err := github.NewEnterpriseOrganization(ctx, "enterpriseOrganizationResource", &github.EnterpriseOrganizationArgs{
	AdminLogins: pulumi.StringArray{
		pulumi.String("string"),
	},
	BillingEmail: pulumi.String("string"),
	EnterpriseId: pulumi.String("string"),
	Description:  pulumi.String("string"),
	DisplayName:  pulumi.String("string"),
	Name:         pulumi.String("string"),
})
Copy
var enterpriseOrganizationResource = new EnterpriseOrganization("enterpriseOrganizationResource", EnterpriseOrganizationArgs.builder()
    .adminLogins("string")
    .billingEmail("string")
    .enterpriseId("string")
    .description("string")
    .displayName("string")
    .name("string")
    .build());
Copy
enterprise_organization_resource = github.EnterpriseOrganization("enterpriseOrganizationResource",
    admin_logins=["string"],
    billing_email="string",
    enterprise_id="string",
    description="string",
    display_name="string",
    name="string")
Copy
const enterpriseOrganizationResource = new github.EnterpriseOrganization("enterpriseOrganizationResource", {
    adminLogins: ["string"],
    billingEmail: "string",
    enterpriseId: "string",
    description: "string",
    displayName: "string",
    name: "string",
});
Copy
type: github:EnterpriseOrganization
properties:
    adminLogins:
        - string
    billingEmail: string
    description: string
    displayName: string
    enterpriseId: string
    name: string
Copy

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

AdminLogins This property is required. List<string>
List of organization owner usernames.
BillingEmail This property is required. string
The billing email address.
EnterpriseId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the enterprise.
Description string
The description of the organization.
DisplayName string
The display name of the organization.
Name Changes to this property will trigger replacement. string
The name of the organization.
AdminLogins This property is required. []string
List of organization owner usernames.
BillingEmail This property is required. string
The billing email address.
EnterpriseId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the enterprise.
Description string
The description of the organization.
DisplayName string
The display name of the organization.
Name Changes to this property will trigger replacement. string
The name of the organization.
adminLogins This property is required. List<String>
List of organization owner usernames.
billingEmail This property is required. String
The billing email address.
enterpriseId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the enterprise.
description String
The description of the organization.
displayName String
The display name of the organization.
name Changes to this property will trigger replacement. String
The name of the organization.
adminLogins This property is required. string[]
List of organization owner usernames.
billingEmail This property is required. string
The billing email address.
enterpriseId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the enterprise.
description string
The description of the organization.
displayName string
The display name of the organization.
name Changes to this property will trigger replacement. string
The name of the organization.
admin_logins This property is required. Sequence[str]
List of organization owner usernames.
billing_email This property is required. str
The billing email address.
enterprise_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the enterprise.
description str
The description of the organization.
display_name str
The display name of the organization.
name Changes to this property will trigger replacement. str
The name of the organization.
adminLogins This property is required. List<String>
List of organization owner usernames.
billingEmail This property is required. String
The billing email address.
enterpriseId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the enterprise.
description String
The description of the organization.
displayName String
The display name of the organization.
name Changes to this property will trigger replacement. String
The name of the organization.

Outputs

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

DatabaseId int
The ID of the organization.
Id string
The provider-assigned unique ID for this managed resource.
DatabaseId int
The ID of the organization.
Id string
The provider-assigned unique ID for this managed resource.
databaseId Integer
The ID of the organization.
id String
The provider-assigned unique ID for this managed resource.
databaseId number
The ID of the organization.
id string
The provider-assigned unique ID for this managed resource.
database_id int
The ID of the organization.
id str
The provider-assigned unique ID for this managed resource.
databaseId Number
The ID of the organization.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing EnterpriseOrganization Resource

Get an existing EnterpriseOrganization 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?: EnterpriseOrganizationState, opts?: CustomResourceOptions): EnterpriseOrganization
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        admin_logins: Optional[Sequence[str]] = None,
        billing_email: Optional[str] = None,
        database_id: Optional[int] = None,
        description: Optional[str] = None,
        display_name: Optional[str] = None,
        enterprise_id: Optional[str] = None,
        name: Optional[str] = None) -> EnterpriseOrganization
func GetEnterpriseOrganization(ctx *Context, name string, id IDInput, state *EnterpriseOrganizationState, opts ...ResourceOption) (*EnterpriseOrganization, error)
public static EnterpriseOrganization Get(string name, Input<string> id, EnterpriseOrganizationState? state, CustomResourceOptions? opts = null)
public static EnterpriseOrganization get(String name, Output<String> id, EnterpriseOrganizationState state, CustomResourceOptions options)
resources:  _:    type: github:EnterpriseOrganization    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:
AdminLogins List<string>
List of organization owner usernames.
BillingEmail string
The billing email address.
DatabaseId int
The ID of the organization.
Description string
The description of the organization.
DisplayName string
The display name of the organization.
EnterpriseId Changes to this property will trigger replacement. string
The ID of the enterprise.
Name Changes to this property will trigger replacement. string
The name of the organization.
AdminLogins []string
List of organization owner usernames.
BillingEmail string
The billing email address.
DatabaseId int
The ID of the organization.
Description string
The description of the organization.
DisplayName string
The display name of the organization.
EnterpriseId Changes to this property will trigger replacement. string
The ID of the enterprise.
Name Changes to this property will trigger replacement. string
The name of the organization.
adminLogins List<String>
List of organization owner usernames.
billingEmail String
The billing email address.
databaseId Integer
The ID of the organization.
description String
The description of the organization.
displayName String
The display name of the organization.
enterpriseId Changes to this property will trigger replacement. String
The ID of the enterprise.
name Changes to this property will trigger replacement. String
The name of the organization.
adminLogins string[]
List of organization owner usernames.
billingEmail string
The billing email address.
databaseId number
The ID of the organization.
description string
The description of the organization.
displayName string
The display name of the organization.
enterpriseId Changes to this property will trigger replacement. string
The ID of the enterprise.
name Changes to this property will trigger replacement. string
The name of the organization.
admin_logins Sequence[str]
List of organization owner usernames.
billing_email str
The billing email address.
database_id int
The ID of the organization.
description str
The description of the organization.
display_name str
The display name of the organization.
enterprise_id Changes to this property will trigger replacement. str
The ID of the enterprise.
name Changes to this property will trigger replacement. str
The name of the organization.
adminLogins List<String>
List of organization owner usernames.
billingEmail String
The billing email address.
databaseId Number
The ID of the organization.
description String
The description of the organization.
displayName String
The display name of the organization.
enterpriseId Changes to this property will trigger replacement. String
The ID of the enterprise.
name Changes to this property will trigger replacement. String
The name of the organization.

Import

GitHub Enterprise Organization can be imported using the slug of the enterprise, combined with the orgname of the organization, separated by a / character.

$ pulumi import github:index/enterpriseOrganization:EnterpriseOrganization org enterp/some-awesome-org
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.