|
| 1 | +--- |
| 2 | +layout: "github" |
| 3 | +page_title: "GitHub: github_organization_custom_properties" |
| 4 | +description: |- |
| 5 | + Creates and manages custom properties for a GitHub organization |
| 6 | +--- |
| 7 | + |
| 8 | +# github_organization_custom_properties |
| 9 | + |
| 10 | +This resource allows you to create and manage custom properties for a GitHub organization. |
| 11 | + |
| 12 | +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. |
| 13 | + |
| 14 | +## Example Usage |
| 15 | + |
| 16 | +```hcl |
| 17 | +resource "github_organization_custom_properties" "environment" { |
| 18 | + property_name = "environment" |
| 19 | + value_type = "single_select" |
| 20 | + required = true |
| 21 | + description = "The deployment environment for this repository" |
| 22 | + default_value = "development" |
| 23 | + allowed_values = [ |
| 24 | + "development", |
| 25 | + "staging", |
| 26 | + "production" |
| 27 | + ] |
| 28 | +} |
| 29 | +``` |
| 30 | + |
| 31 | +## Example Usage - Text Property |
| 32 | + |
| 33 | +```hcl |
| 34 | +resource "github_organization_custom_properties" "owner" { |
| 35 | + property_name = "owner" |
| 36 | + value_type = "string" |
| 37 | + required = true |
| 38 | + description = "The team or individual responsible for this repository" |
| 39 | +} |
| 40 | +``` |
| 41 | + |
| 42 | +## Example Usage - Boolean Property |
| 43 | + |
| 44 | +```hcl |
| 45 | +resource "github_organization_custom_properties" "archived" { |
| 46 | + property_name = "archived" |
| 47 | + value_type = "true_false" |
| 48 | + required = false |
| 49 | + description = "Whether this repository is archived" |
| 50 | + default_value = "false" |
| 51 | +} |
| 52 | +``` |
| 53 | + |
| 54 | +## Argument Reference |
| 55 | + |
| 56 | +The following arguments are supported: |
| 57 | + |
| 58 | +* `property_name` - (Required) The name of the custom property. |
| 59 | + |
| 60 | +* `value_type` - (Optional) The type of the custom property. Can be one of `string`, `single_select`, `multi_select`, or `true_false`. Defaults to `string`. |
| 61 | + |
| 62 | +* `required` - (Optional) Whether the custom property is required. Defaults to `false`. |
| 63 | + |
| 64 | +* `description` - (Optional) The description of the custom property. |
| 65 | + |
| 66 | +* `default_value` - (Optional) The default value of the custom property. |
| 67 | + |
| 68 | +* `allowed_values` - (Optional) List of allowed values for the custom property. Only applicable when `value_type` is `single_select` or `multi_select`. |
| 69 | + |
| 70 | +## Attributes Reference |
| 71 | + |
| 72 | +In addition to all arguments above, the following attributes are exported: |
| 73 | + |
| 74 | +* `property_name` - The name of the custom property. |
| 75 | + |
| 76 | +## Import |
| 77 | + |
| 78 | +Organization custom properties can be imported using the property name: |
| 79 | + |
| 80 | +``` |
| 81 | +terraform import github_organization_custom_properties.environment environment |
| 82 | +``` |
0 commit comments