github.OrganizationCustomProperties
This resource allows you to create and manage custom properties for a GitHub organization.
Custom properties enable you to add metadata to repositories within your organization. You can use custom properties to add context about repositories, such as who owns them, when they expire, or compliance requirements.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const environment = new github.OrganizationCustomProperties("environment", {
propertyName: "environment",
valueType: "single_select",
required: true,
description: "The deployment environment for this repository",
defaultValue: "development",
allowedValues: [
"development",
"staging",
"production",
],
});
import pulumi
import pulumi_github as github
environment = github.OrganizationCustomProperties("environment",
property_name="environment",
value_type="single_select",
required=True,
description="The deployment environment for this repository",
default_value="development",
allowed_values=[
"development",
"staging",
"production",
])
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.NewOrganizationCustomProperties(ctx, "environment", &github.OrganizationCustomPropertiesArgs{
PropertyName: pulumi.String("environment"),
ValueType: pulumi.String("single_select"),
Required: pulumi.Bool(true),
Description: pulumi.String("The deployment environment for this repository"),
DefaultValue: pulumi.String("development"),
AllowedValues: pulumi.StringArray{
pulumi.String("development"),
pulumi.String("staging"),
pulumi.String("production"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var environment = new Github.OrganizationCustomProperties("environment", new()
{
PropertyName = "environment",
ValueType = "single_select",
Required = true,
Description = "The deployment environment for this repository",
DefaultValue = "development",
AllowedValues = new[]
{
"development",
"staging",
"production",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.OrganizationCustomProperties;
import com.pulumi.github.OrganizationCustomPropertiesArgs;
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 environment = new OrganizationCustomProperties("environment", OrganizationCustomPropertiesArgs.builder()
.propertyName("environment")
.valueType("single_select")
.required(true)
.description("The deployment environment for this repository")
.defaultValue("development")
.allowedValues(
"development",
"staging",
"production")
.build());
}
}
resources:
environment:
type: github:OrganizationCustomProperties
properties:
propertyName: environment
valueType: single_select
required: true
description: The deployment environment for this repository
defaultValue: development
allowedValues:
- development
- staging
- production
Text Property
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const owner = new github.OrganizationCustomProperties("owner", {
propertyName: "owner",
valueType: "string",
required: true,
description: "The team or individual responsible for this repository",
});
import pulumi
import pulumi_github as github
owner = github.OrganizationCustomProperties("owner",
property_name="owner",
value_type="string",
required=True,
description="The team or individual responsible for this repository")
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.NewOrganizationCustomProperties(ctx, "owner", &github.OrganizationCustomPropertiesArgs{
PropertyName: pulumi.String("owner"),
ValueType: pulumi.String("string"),
Required: pulumi.Bool(true),
Description: pulumi.String("The team or individual responsible for this repository"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var owner = new Github.OrganizationCustomProperties("owner", new()
{
PropertyName = "owner",
ValueType = "string",
Required = true,
Description = "The team or individual responsible for this repository",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.OrganizationCustomProperties;
import com.pulumi.github.OrganizationCustomPropertiesArgs;
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 owner = new OrganizationCustomProperties("owner", OrganizationCustomPropertiesArgs.builder()
.propertyName("owner")
.valueType("string")
.required(true)
.description("The team or individual responsible for this repository")
.build());
}
}
resources:
owner:
type: github:OrganizationCustomProperties
properties:
propertyName: owner
valueType: string
required: true
description: The team or individual responsible for this repository
Boolean Property
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const archived = new github.OrganizationCustomProperties("archived", {
propertyName: "archived",
valueType: "true_false",
required: false,
description: "Whether this repository is archived",
defaultValue: "false",
});
import pulumi
import pulumi_github as github
archived = github.OrganizationCustomProperties("archived",
property_name="archived",
value_type="true_false",
required=False,
description="Whether this repository is archived",
default_value="false")
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.NewOrganizationCustomProperties(ctx, "archived", &github.OrganizationCustomPropertiesArgs{
PropertyName: pulumi.String("archived"),
ValueType: pulumi.String("true_false"),
Required: pulumi.Bool(false),
Description: pulumi.String("Whether this repository is archived"),
DefaultValue: pulumi.String("false"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var archived = new Github.OrganizationCustomProperties("archived", new()
{
PropertyName = "archived",
ValueType = "true_false",
Required = false,
Description = "Whether this repository is archived",
DefaultValue = "false",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.OrganizationCustomProperties;
import com.pulumi.github.OrganizationCustomPropertiesArgs;
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 archived = new OrganizationCustomProperties("archived", OrganizationCustomPropertiesArgs.builder()
.propertyName("archived")
.valueType("true_false")
.required(false)
.description("Whether this repository is archived")
.defaultValue("false")
.build());
}
}
resources:
archived:
type: github:OrganizationCustomProperties
properties:
propertyName: archived
valueType: true_false
required: false
description: Whether this repository is archived
defaultValue: 'false'
Create OrganizationCustomProperties Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new OrganizationCustomProperties(name: string, args: OrganizationCustomPropertiesArgs, opts?: CustomResourceOptions);@overload
def OrganizationCustomProperties(resource_name: str,
args: OrganizationCustomPropertiesArgs,
opts: Optional[ResourceOptions] = None)
@overload
def OrganizationCustomProperties(resource_name: str,
opts: Optional[ResourceOptions] = None,
property_name: Optional[str] = None,
allowed_values: Optional[Sequence[str]] = None,
default_value: Optional[str] = None,
description: Optional[str] = None,
required: Optional[bool] = None,
value_type: Optional[str] = None)func NewOrganizationCustomProperties(ctx *Context, name string, args OrganizationCustomPropertiesArgs, opts ...ResourceOption) (*OrganizationCustomProperties, error)public OrganizationCustomProperties(string name, OrganizationCustomPropertiesArgs args, CustomResourceOptions? opts = null)
public OrganizationCustomProperties(String name, OrganizationCustomPropertiesArgs args)
public OrganizationCustomProperties(String name, OrganizationCustomPropertiesArgs args, CustomResourceOptions options)
type: github:OrganizationCustomProperties
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 OrganizationCustomPropertiesArgs
- 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 OrganizationCustomPropertiesArgs
- 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 OrganizationCustomPropertiesArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args OrganizationCustomPropertiesArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args OrganizationCustomPropertiesArgs
- 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 organizationCustomPropertiesResource = new Github.OrganizationCustomProperties("organizationCustomPropertiesResource", new()
{
PropertyName = "string",
AllowedValues = new[]
{
"string",
},
DefaultValue = "string",
Description = "string",
Required = false,
ValueType = "string",
});
example, err := github.NewOrganizationCustomProperties(ctx, "organizationCustomPropertiesResource", &github.OrganizationCustomPropertiesArgs{
PropertyName: pulumi.String("string"),
AllowedValues: pulumi.StringArray{
pulumi.String("string"),
},
DefaultValue: pulumi.String("string"),
Description: pulumi.String("string"),
Required: pulumi.Bool(false),
ValueType: pulumi.String("string"),
})
var organizationCustomPropertiesResource = new OrganizationCustomProperties("organizationCustomPropertiesResource", OrganizationCustomPropertiesArgs.builder()
.propertyName("string")
.allowedValues("string")
.defaultValue("string")
.description("string")
.required(false)
.valueType("string")
.build());
organization_custom_properties_resource = github.OrganizationCustomProperties("organizationCustomPropertiesResource",
property_name="string",
allowed_values=["string"],
default_value="string",
description="string",
required=False,
value_type="string")
const organizationCustomPropertiesResource = new github.OrganizationCustomProperties("organizationCustomPropertiesResource", {
propertyName: "string",
allowedValues: ["string"],
defaultValue: "string",
description: "string",
required: false,
valueType: "string",
});
type: github:OrganizationCustomProperties
properties:
allowedValues:
- string
defaultValue: string
description: string
propertyName: string
required: false
valueType: string
OrganizationCustomProperties 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 OrganizationCustomProperties resource accepts the following input properties:
- Property
Name string - The name of the custom property.
- Allowed
Values List<string> - List of allowed values for the custom property. Only applicable when
value_typeissingle_selectormulti_select. - Default
Value string - The default value of the custom property.
- Description string
- The description of the custom property.
- Required bool
- Whether the custom property is required. Defaults to
false. - Value
Type string - The type of the custom property. Can be one of
string,single_select,multi_select, ortrue_false. Defaults tostring.
- Property
Name string - The name of the custom property.
- Allowed
Values []string - List of allowed values for the custom property. Only applicable when
value_typeissingle_selectormulti_select. - Default
Value string - The default value of the custom property.
- Description string
- The description of the custom property.
- Required bool
- Whether the custom property is required. Defaults to
false. - Value
Type string - The type of the custom property. Can be one of
string,single_select,multi_select, ortrue_false. Defaults tostring.
- property
Name String - The name of the custom property.
- allowed
Values List<String> - List of allowed values for the custom property. Only applicable when
value_typeissingle_selectormulti_select. - default
Value String - The default value of the custom property.
- description String
- The description of the custom property.
- required Boolean
- Whether the custom property is required. Defaults to
false. - value
Type String - The type of the custom property. Can be one of
string,single_select,multi_select, ortrue_false. Defaults tostring.
- property
Name string - The name of the custom property.
- allowed
Values string[] - List of allowed values for the custom property. Only applicable when
value_typeissingle_selectormulti_select. - default
Value string - The default value of the custom property.
- description string
- The description of the custom property.
- required boolean
- Whether the custom property is required. Defaults to
false. - value
Type string - The type of the custom property. Can be one of
string,single_select,multi_select, ortrue_false. Defaults tostring.
- property_
name str - The name of the custom property.
- allowed_
values Sequence[str] - List of allowed values for the custom property. Only applicable when
value_typeissingle_selectormulti_select. - default_
value str - The default value of the custom property.
- description str
- The description of the custom property.
- required bool
- Whether the custom property is required. Defaults to
false. - value_
type str - The type of the custom property. Can be one of
string,single_select,multi_select, ortrue_false. Defaults tostring.
- property
Name String - The name of the custom property.
- allowed
Values List<String> - List of allowed values for the custom property. Only applicable when
value_typeissingle_selectormulti_select. - default
Value String - The default value of the custom property.
- description String
- The description of the custom property.
- required Boolean
- Whether the custom property is required. Defaults to
false. - value
Type String - The type of the custom property. Can be one of
string,single_select,multi_select, ortrue_false. Defaults tostring.
Outputs
All input properties are implicitly available as output properties. Additionally, the OrganizationCustomProperties 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 str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing OrganizationCustomProperties Resource
Get an existing OrganizationCustomProperties 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?: OrganizationCustomPropertiesState, opts?: CustomResourceOptions): OrganizationCustomProperties@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
allowed_values: Optional[Sequence[str]] = None,
default_value: Optional[str] = None,
description: Optional[str] = None,
property_name: Optional[str] = None,
required: Optional[bool] = None,
value_type: Optional[str] = None) -> OrganizationCustomPropertiesfunc GetOrganizationCustomProperties(ctx *Context, name string, id IDInput, state *OrganizationCustomPropertiesState, opts ...ResourceOption) (*OrganizationCustomProperties, error)public static OrganizationCustomProperties Get(string name, Input<string> id, OrganizationCustomPropertiesState? state, CustomResourceOptions? opts = null)public static OrganizationCustomProperties get(String name, Output<String> id, OrganizationCustomPropertiesState state, CustomResourceOptions options)resources: _: type: github:OrganizationCustomProperties 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.
- Allowed
Values List<string> - List of allowed values for the custom property. Only applicable when
value_typeissingle_selectormulti_select. - Default
Value string - The default value of the custom property.
- Description string
- The description of the custom property.
- Property
Name string - The name of the custom property.
- Required bool
- Whether the custom property is required. Defaults to
false. - Value
Type string - The type of the custom property. Can be one of
string,single_select,multi_select, ortrue_false. Defaults tostring.
- Allowed
Values []string - List of allowed values for the custom property. Only applicable when
value_typeissingle_selectormulti_select. - Default
Value string - The default value of the custom property.
- Description string
- The description of the custom property.
- Property
Name string - The name of the custom property.
- Required bool
- Whether the custom property is required. Defaults to
false. - Value
Type string - The type of the custom property. Can be one of
string,single_select,multi_select, ortrue_false. Defaults tostring.
- allowed
Values List<String> - List of allowed values for the custom property. Only applicable when
value_typeissingle_selectormulti_select. - default
Value String - The default value of the custom property.
- description String
- The description of the custom property.
- property
Name String - The name of the custom property.
- required Boolean
- Whether the custom property is required. Defaults to
false. - value
Type String - The type of the custom property. Can be one of
string,single_select,multi_select, ortrue_false. Defaults tostring.
- allowed
Values string[] - List of allowed values for the custom property. Only applicable when
value_typeissingle_selectormulti_select. - default
Value string - The default value of the custom property.
- description string
- The description of the custom property.
- property
Name string - The name of the custom property.
- required boolean
- Whether the custom property is required. Defaults to
false. - value
Type string - The type of the custom property. Can be one of
string,single_select,multi_select, ortrue_false. Defaults tostring.
- allowed_
values Sequence[str] - List of allowed values for the custom property. Only applicable when
value_typeissingle_selectormulti_select. - default_
value str - The default value of the custom property.
- description str
- The description of the custom property.
- property_
name str - The name of the custom property.
- required bool
- Whether the custom property is required. Defaults to
false. - value_
type str - The type of the custom property. Can be one of
string,single_select,multi_select, ortrue_false. Defaults tostring.
- allowed
Values List<String> - List of allowed values for the custom property. Only applicable when
value_typeissingle_selectormulti_select. - default
Value String - The default value of the custom property.
- description String
- The description of the custom property.
- property
Name String - The name of the custom property.
- required Boolean
- Whether the custom property is required. Defaults to
false. - value
Type String - The type of the custom property. Can be one of
string,single_select,multi_select, ortrue_false. Defaults tostring.
Import
Organization custom properties can be imported using the property name:
$ pulumi import github:index/organizationCustomProperties:OrganizationCustomProperties environment environment
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
githubTerraform Provider.
