Skip to content

Commit 20f4c17

Browse files
spriorielloclaude
andcommitted
docs: add organization security configuration docs, test configuration_id
- Add missing organization_security_configuration documentation - Fix enterprise docs: description is Optional not Required - Add configuration_id assertions to both test files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c6016f6 commit 20f4c17

4 files changed

Lines changed: 102 additions & 1 deletion

github/resource_github_enterprise_security_configuration_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ func TestAccGithubEnterpriseSecurityConfiguration(t *testing.T) {
4747
tfjsonpath.New("advanced_security"), knownvalue.StringExact("enabled")),
4848
statecheck.ExpectKnownValue("github_enterprise_security_configuration.test",
4949
tfjsonpath.New("enforcement"), knownvalue.StringExact("enforced")),
50+
statecheck.ExpectKnownValue("github_enterprise_security_configuration.test",
51+
tfjsonpath.New("configuration_id"), knownvalue.NotNull()),
5052
},
5153
},
5254
{

github/resource_github_organization_security_configuration_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ func TestAccGithubOrganizationSecurityConfiguration(t *testing.T) {
4646
tfjsonpath.New("advanced_security"), knownvalue.StringExact("enabled")),
4747
statecheck.ExpectKnownValue("github_organization_security_configuration.test",
4848
tfjsonpath.New("enforcement"), knownvalue.StringExact("enforced")),
49+
statecheck.ExpectKnownValue("github_organization_security_configuration.test",
50+
tfjsonpath.New("configuration_id"), knownvalue.NotNull()),
4951
},
5052
},
5153
{

website/docs/r/enterprise_security_configuration.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The following arguments are supported:
3434

3535
* `enterprise_slug` - (Required) The slug of the enterprise. Changing this forces a new resource to be created.
3636
* `name` - (Required) The name of the code security configuration.
37-
* `description` - (Required) A description of the code security configuration.
37+
* `description` - (Optional) A description of the code security configuration.
3838
* `advanced_security` - (Optional) The advanced security configuration. Can be one of `enabled`, `disabled`.
3939
* `dependency_graph` - (Optional) The dependency graph configuration. Can be one of `enabled`, `disabled`, `not_set`.
4040
* `dependency_graph_autosubmit_action` - (Optional) The dependency graph autosubmit action configuration. Can be one of `enabled`, `disabled`, `not_set`.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
layout: "github"
3+
page_title: "GitHub: github_organization_security_configuration"
4+
description: |-
5+
Manages a code security configuration for a GitHub Organization.
6+
---
7+
8+
# github_organization_security_configuration
9+
10+
This resource allows you to create and manage code security configurations for a GitHub Organization.
11+
12+
## Example Usage
13+
14+
```hcl
15+
resource "github_organization_security_configuration" "default" {
16+
name = "default-config"
17+
description = "Default security configuration"
18+
advanced_security = "enabled"
19+
dependency_graph = "enabled"
20+
dependabot_alerts = "enabled"
21+
dependabot_security_updates = "enabled"
22+
code_scanning_default_setup = "enabled"
23+
secret_scanning = "enabled"
24+
secret_scanning_push_protection = "enabled"
25+
private_vulnerability_reporting = "enabled"
26+
enforcement = "enforced"
27+
}
28+
```
29+
30+
## Argument Reference
31+
32+
The following arguments are supported:
33+
34+
* `name` - (Required) The name of the code security configuration.
35+
* `description` - (Optional) A description of the code security configuration.
36+
* `advanced_security` - (Optional) The advanced security configuration. Can be one of `enabled`, `disabled`.
37+
* `dependency_graph` - (Optional) The dependency graph configuration. Can be one of `enabled`, `disabled`, `not_set`.
38+
* `dependency_graph_autosubmit_action` - (Optional) The dependency graph autosubmit action configuration. Can be one of `enabled`, `disabled`, `not_set`.
39+
* `dependency_graph_autosubmit_action_options` - (Optional) The dependency graph autosubmit action options. See [Dependency Graph Autosubmit Action Options](#dependency-graph-autosubmit-action-options) below for details.
40+
* `dependabot_alerts` - (Optional) The dependabot alerts configuration. Can be one of `enabled`, `disabled`, `not_set`.
41+
* `dependabot_security_updates` - (Optional) The dependabot security updates configuration. Can be one of `enabled`, `disabled`, `not_set`.
42+
* `code_scanning_default_setup` - (Optional) The code scanning default setup configuration. Can be one of `enabled`, `disabled`, `not_set`.
43+
* `code_scanning_default_setup_options` - (Optional) The code scanning default setup options. See [Code Scanning Default Setup Options](#code-scanning-default-setup-options) below for details.
44+
* `code_scanning_delegated_alert_dismissal` - (Optional) The code scanning delegated alert dismissal configuration. Can be one of `enabled`, `disabled`, `not_set`.
45+
* `code_scanning_options` - (Optional) The code scanning options. See [Code Scanning Options](#code-scanning-options) below for details.
46+
* `code_security` - (Optional) The code security configuration. Can be one of `enabled`, `disabled`, `not_set`.
47+
* `secret_scanning` - (Optional) The secret scanning configuration. Can be one of `enabled`, `disabled`, `not_set`.
48+
* `secret_scanning_push_protection` - (Optional) The secret scanning push protection configuration. Can be one of `enabled`, `disabled`, `not_set`.
49+
* `secret_scanning_delegated_bypass` - (Optional) The secret scanning delegated bypass configuration. Can be one of `enabled`, `disabled`, `not_set`.
50+
* `secret_scanning_delegated_bypass_options` - (Optional) The secret scanning delegated bypass options. See [Secret Scanning Delegated Bypass Options](#secret-scanning-delegated-bypass-options) below for details.
51+
* `secret_scanning_validity_checks` - (Optional) The secret scanning validity checks configuration. Can be one of `enabled`, `disabled`, `not_set`.
52+
* `secret_scanning_non_provider_patterns` - (Optional) The secret scanning non provider patterns configuration. Can be one of `enabled`, `disabled`, `not_set`.
53+
* `secret_scanning_generic_secrets` - (Optional) The secret scanning generic secrets configuration. Can be one of `enabled`, `disabled`, `not_set`.
54+
* `secret_scanning_delegated_alert_dismissal` - (Optional) The secret scanning delegated alert dismissal configuration. Can be one of `enabled`, `disabled`, `not_set`.
55+
* `secret_protection` - (Optional) The secret protection configuration. Can be one of `enabled`, `disabled`, `not_set`.
56+
* `private_vulnerability_reporting` - (Optional) The private vulnerability reporting configuration. Can be one of `enabled`, `disabled`, `not_set`.
57+
* `enforcement` - (Optional) The enforcement configuration. Can be one of `enforced`, `unenforced`.
58+
59+
## Attributes Reference
60+
61+
* `configuration_id` - The numeric ID of the code security configuration.
62+
* `target_type` - The target type of the code security configuration.
63+
64+
### Dependency Graph Autosubmit Action Options
65+
66+
The `dependency_graph_autosubmit_action_options` block supports:
67+
68+
* `labeled_runners` - (Optional) Whether to use labeled runners for the dependency graph autosubmit action.
69+
70+
### Code Scanning Default Setup Options
71+
72+
The `code_scanning_default_setup_options` block supports:
73+
74+
* `runner_type` - (Optional) The type of runner to use for code scanning default setup. Can be one of `standard`, `labeled`.
75+
* `runner_label` - (Optional) The label of the runner to use for code scanning default setup.
76+
77+
### Code Scanning Options
78+
79+
The `code_scanning_options` block supports:
80+
81+
* `allow_advanced` - (Optional) Whether to allow advanced security for code scanning.
82+
83+
### Secret Scanning Delegated Bypass Options
84+
85+
The `secret_scanning_delegated_bypass_options` block supports:
86+
87+
* `reviewers` - (Optional) The bypass reviewers. Each entry supports:
88+
* `reviewer_id` - (Required) The ID of the bypass reviewer (team or role ID).
89+
* `reviewer_type` - (Required) The type of the bypass reviewer. Can be one of `Team`, `Role`.
90+
91+
## Import
92+
93+
GitHub Organization Code Security Configurations can be imported using the organization name and the configuration ID separated by a colon, e.g.
94+
95+
```text
96+
$ terraform import github_organization_security_configuration.example my-org:123
97+
```

0 commit comments

Comments
 (0)