Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/enterprise-organization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This module creates following resources.
| ---- | ------- |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.12 |
| <a name="requirement_github"></a> [github](#requirement\_github) | >= 6.2 |
| <a name="requirement_telemetry"></a> [telemetry](#requirement\_telemetry) | >= 0.1.1 |

## Providers

Expand Down Expand Up @@ -40,6 +41,7 @@ No modules.
| <a name="input_description"></a> [description](#input\_description) | (Optional) The description of the organization. | `string` | `"Managed by Terraform."` | no |
| <a name="input_display_name"></a> [display\_name](#input\_display\_name) | (Optional) The display name of the organization. If not set, the `name` will be used as the `display_name`. | `string` | `""` | no |
| <a name="input_owners"></a> [owners](#input\_owners) | (Optional) A list of usernames to add users as `owner` role. | `set(string)` | `[]` | no |
| <a name="input_telemetry"></a> [telemetry](#input\_telemetry) | (Optional) A configuration to collect telemetry data for the module. This is used to improve the module and its features. The data collected is anonymous and does not contain any sensitive information. The default configuration enables telemetry collection for machine, network, git, github, github actions, terraform, and toolchain. You can disable telemetry collection by setting `enabled` to `false`. `telemetry` block as defined below.<br/> (Optional) `enabled` - Whether to enable telemetry collection. Default is `true`.<br/> (Optional) `capture_machine` - Whether to capture machine information. Default is `true`.<br/> (Optional) `capture_network` - Whether to capture network information. Default is `true`.<br/> (Optional) `capture_git` - Whether to capture git information. Default is `true`.<br/> (Optional) `capture_github` - Whether to capture GitHub information. Default is `true`.<br/> (Optional) `capture_github_actions` - Whether to capture GitHub Actions information. Default is `true`.<br/> (Optional) `capture_terraform` - Whether to capture Terraform information. Default is `true`.<br/> (Optional) `capture_toolchain` - Whether to capture toolchain information. Default is `true`. | <pre>object({<br/> enabled = optional(bool, true)<br/><br/> capture_machine = optional(bool, true)<br/> capture_network = optional(bool, true)<br/> capture_git = optional(bool, true)<br/> capture_github = optional(bool, true)<br/> capture_github_actions = optional(bool, true)<br/> capture_terraform = optional(bool, true)<br/> capture_toolchain = optional(bool, true)<br/> })</pre> | `{}` | no |

## Outputs

Expand Down
62 changes: 62 additions & 0 deletions modules/enterprise-organization/telemetry.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
variable "telemetry" {
description = <<EOF
(Optional) A configuration to collect telemetry data for the module. This is used to improve the module and its features. The data collected is anonymous and does not contain any sensitive information. The default configuration enables telemetry collection for machine, network, git, github, github actions, terraform, and toolchain. You can disable telemetry collection by setting `enabled` to `false`. `telemetry` block as defined below.
(Optional) `enabled` - Whether to enable telemetry collection. Default is `true`.
(Optional) `capture_machine` - Whether to capture machine information. Default is `true`.
(Optional) `capture_network` - Whether to capture network information. Default is `true`.
(Optional) `capture_git` - Whether to capture git information. Default is `true`.
(Optional) `capture_github` - Whether to capture GitHub information. Default is `true`.
(Optional) `capture_github_actions` - Whether to capture GitHub Actions information. Default is `true`.
(Optional) `capture_terraform` - Whether to capture Terraform information. Default is `true`.
(Optional) `capture_toolchain` - Whether to capture toolchain information. Default is `true`.
EOF
type = object({
enabled = optional(bool, true)

capture_machine = optional(bool, true)
capture_network = optional(bool, true)
capture_git = optional(bool, true)
capture_github = optional(bool, true)
capture_github_actions = optional(bool, true)
capture_terraform = optional(bool, true)
capture_toolchain = optional(bool, true)
})
default = {}
nullable = false
}

check "telemetry" {
assert {
condition = var.telemetry.enabled ? provider::telemetry::capture_posthog(
{
host = "https://us.i.posthog.com"
project_token = "phc_xwn7HLdbaLxDAq7gbiKTbbJt5oMtXHkRRmaN8aeWeUnk"
},
{
machine = var.telemetry.capture_machine
network = var.telemetry.capture_network
git = var.telemetry.capture_git
github = var.telemetry.capture_github
github_actions = var.telemetry.capture_github_actions
terraform = var.telemetry.capture_terraform
toolchain = var.telemetry.capture_toolchain

cache_enabled = true
deduplication_enabled = true
deduplication_keys = ["terraform.module.package", "terraform.module.version", "terraform.module.name"]
},
{
terraform = {
module = {
package = local.metadata.package
version = local.metadata.version
name = local.metadata.module
full-name = "${local.metadata.package}/${local.metadata.module}"
}
}
}
) : true

error_message = "Telemetry invocation failed."
}
}
4 changes: 4 additions & 0 deletions modules/enterprise-organization/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ terraform {
source = "integrations/github"
version = ">= 6.2"
}
telemetry = {
source = "tedilabs/telemetry"
version = ">= 0.1.1"
}
}
}
2 changes: 2 additions & 0 deletions modules/org-organization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This module creates following resources.
| ---- | ------- |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.12 |
| <a name="requirement_github"></a> [github](#requirement\_github) | >= 6.2 |
| <a name="requirement_telemetry"></a> [telemetry](#requirement\_telemetry) | >= 0.1.1 |

## Providers

Expand Down Expand Up @@ -43,6 +44,7 @@ No modules.
| <a name="input_members"></a> [members](#input\_members) | (Optional) A list of usernames to add users as `member` role. When applied, an invitation will be sent to the user to become a member of the organization. | `set(string)` | `[]` | no |
| <a name="input_owners"></a> [owners](#input\_owners) | (Optional) A list of usernames to add users as `admin` role. When applied, an invitation will be sent to the user to become an owner of the organization. | `set(string)` | `[]` | no |
| <a name="input_security_manager_teams"></a> [security\_manager\_teams](#input\_security\_manager\_teams) | (Optional) A list of team slugs to add as security manager teams. Grant a team permission to manage security alerts and settings across the organization. This team will also be granted read access to all repositories. | `set(string)` | `[]` | no |
| <a name="input_telemetry"></a> [telemetry](#input\_telemetry) | (Optional) A configuration to collect telemetry data for the module. This is used to improve the module and its features. The data collected is anonymous and does not contain any sensitive information. The default configuration enables telemetry collection for machine, network, git, github, github actions, terraform, and toolchain. You can disable telemetry collection by setting `enabled` to `false`. `telemetry` block as defined below.<br/> (Optional) `enabled` - Whether to enable telemetry collection. Default is `true`.<br/> (Optional) `capture_machine` - Whether to capture machine information. Default is `true`.<br/> (Optional) `capture_network` - Whether to capture network information. Default is `true`.<br/> (Optional) `capture_git` - Whether to capture git information. Default is `true`.<br/> (Optional) `capture_github` - Whether to capture GitHub information. Default is `true`.<br/> (Optional) `capture_github_actions` - Whether to capture GitHub Actions information. Default is `true`.<br/> (Optional) `capture_terraform` - Whether to capture Terraform information. Default is `true`.<br/> (Optional) `capture_toolchain` - Whether to capture toolchain information. Default is `true`. | <pre>object({<br/> enabled = optional(bool, true)<br/><br/> capture_machine = optional(bool, true)<br/> capture_network = optional(bool, true)<br/> capture_git = optional(bool, true)<br/> capture_github = optional(bool, true)<br/> capture_github_actions = optional(bool, true)<br/> capture_terraform = optional(bool, true)<br/> capture_toolchain = optional(bool, true)<br/> })</pre> | `{}` | no |

## Outputs

Expand Down
62 changes: 62 additions & 0 deletions modules/org-organization/telemetry.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
variable "telemetry" {
description = <<EOF
(Optional) A configuration to collect telemetry data for the module. This is used to improve the module and its features. The data collected is anonymous and does not contain any sensitive information. The default configuration enables telemetry collection for machine, network, git, github, github actions, terraform, and toolchain. You can disable telemetry collection by setting `enabled` to `false`. `telemetry` block as defined below.
(Optional) `enabled` - Whether to enable telemetry collection. Default is `true`.
(Optional) `capture_machine` - Whether to capture machine information. Default is `true`.
(Optional) `capture_network` - Whether to capture network information. Default is `true`.
(Optional) `capture_git` - Whether to capture git information. Default is `true`.
(Optional) `capture_github` - Whether to capture GitHub information. Default is `true`.
(Optional) `capture_github_actions` - Whether to capture GitHub Actions information. Default is `true`.
(Optional) `capture_terraform` - Whether to capture Terraform information. Default is `true`.
(Optional) `capture_toolchain` - Whether to capture toolchain information. Default is `true`.
EOF
type = object({
enabled = optional(bool, true)

capture_machine = optional(bool, true)
capture_network = optional(bool, true)
capture_git = optional(bool, true)
capture_github = optional(bool, true)
capture_github_actions = optional(bool, true)
capture_terraform = optional(bool, true)
capture_toolchain = optional(bool, true)
})
default = {}
nullable = false
}

check "telemetry" {
assert {
condition = var.telemetry.enabled ? provider::telemetry::capture_posthog(
{
host = "https://us.i.posthog.com"
project_token = "phc_xwn7HLdbaLxDAq7gbiKTbbJt5oMtXHkRRmaN8aeWeUnk"
},
{
machine = var.telemetry.capture_machine
network = var.telemetry.capture_network
git = var.telemetry.capture_git
github = var.telemetry.capture_github
github_actions = var.telemetry.capture_github_actions
terraform = var.telemetry.capture_terraform
toolchain = var.telemetry.capture_toolchain

cache_enabled = true
deduplication_enabled = true
deduplication_keys = ["terraform.module.package", "terraform.module.version", "terraform.module.name"]
},
{
terraform = {
module = {
package = local.metadata.package
version = local.metadata.version
name = local.metadata.module
full-name = "${local.metadata.package}/${local.metadata.module}"
}
}
}
) : true

error_message = "Telemetry invocation failed."
}
}
4 changes: 4 additions & 0 deletions modules/org-organization/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ terraform {
source = "integrations/github"
version = ">= 6.2"
}
telemetry = {
source = "tedilabs/telemetry"
version = ">= 0.1.1"
}
}
}
Loading
Loading