|
| 1 | +# GitHub Test Environment Setup |
| 2 | + |
| 3 | +This code sets up GitHub environments for testing against Keyfactor Command instances that are configured to use |
| 4 | +Active Directory or Keycloak for authentication. |
| 5 | + |
| 6 | +## Requirements |
| 7 | + |
| 8 | +1. Terraform >= 1.0 |
| 9 | +2. GitHub Provider >= 6.2 |
| 10 | +3. Keyfactor Command instance(s) configured to use Active Directory or Keycloak for authentication |
| 11 | +4. AD or Keycloak credentials for authenticating to the Keyfactor Command instance(s) |
| 12 | +5. A GitHub token with access and permissions to the repository where the environments will be created |
| 13 | + |
| 14 | +## Adding a new environment |
| 15 | + |
| 16 | +Modify the `environments.tf` file to include the new environment module. The module should be named appropriately. |
| 17 | +Example: |
| 18 | + |
| 19 | +### Active Directory Environment |
| 20 | + |
| 21 | +```hcl |
| 22 | +module "keyfactor_github_test_environment_ad_10_5_0" { |
| 23 | + source = "git::ssh://[email protected]/Keyfactor/terraform-module-keyfactor-github-test-environment-ad.git?ref=main" |
| 24 | +
|
| 25 | + gh_environment_name = "KFC_10_5_0" # Keyfactor Command 10.5.0 environment using Active Directory(/Basic Auth) |
| 26 | + gh_repo_name = data.github_repository.repo.name |
| 27 | + keyfactor_hostname = var.keyfactor_hostname_10_5_0 |
| 28 | + keyfactor_username = var.keyfactor_username_AD |
| 29 | + keyfactor_password = var.keyfactor_password_AD |
| 30 | +} |
| 31 | +``` |
| 32 | + |
| 33 | +### oAuth Client Environment |
| 34 | + |
| 35 | +```hcl |
| 36 | +module "keyfactor_github_test_environment_12_3_0_kc" { |
| 37 | + source = "git::ssh://[email protected]/Keyfactor/terraform-module-keyfactor-github-test-environment-kc.git?ref=main" |
| 38 | +
|
| 39 | + gh_environment_name = "KFC_12_3_0_KC" # Keyfactor Command 12.3.0 environment using Keycloak |
| 40 | + gh_repo_name = data.github_repository.repo.name |
| 41 | + keyfactor_hostname = var.keyfactor_hostname_12_3_0_OAUTH |
| 42 | + keyfactor_auth_token_url = var.keyfactor_auth_token_url |
| 43 | + keyfactor_client_id = var.keyfactor_client_id |
| 44 | + keyfactor_client_secret = var.keyfactor_client_secret |
| 45 | + keyfactor_tls_skip_verify = true |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +<!-- BEGIN_TF_DOCS --> |
| 50 | +## Requirements |
| 51 | + |
| 52 | +| Name | Version | |
| 53 | +|------|---------| |
| 54 | +| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 | |
| 55 | +| <a name="requirement_github"></a> [github](#requirement\_github) | >=6.2 | |
| 56 | + |
| 57 | +## Providers |
| 58 | + |
| 59 | +| Name | Version | |
| 60 | +|------|---------| |
| 61 | +| <a name="provider_github"></a> [github](#provider\_github) | 6.3.1 | |
| 62 | + |
| 63 | +## Modules |
| 64 | + |
| 65 | +| Name | Source | Version | |
| 66 | +|------|--------|---------| |
| 67 | +| < a name= "module_keyfactor_github_test_environment_12_3_0_kc"></ a> [keyfactor \_github \_test \_environment \_12 \_3 \_0 \_kc ](#module\_keyfactor\_github\_test\_environment\_12\_3\_0\_kc) | git::ssh:// [email protected]/Keyfactor/terraform-module-keyfactor-github-test-environment-ad.git | main | |
| 68 | +| < a name= "module_keyfactor_github_test_environment_ad_10_5_0"></ a> [keyfactor \_github \_test \_environment \_ad \_10 \_5 \_0 ](#module\_keyfactor\_github\_test\_environment\_ad\_10\_5\_0) | git::ssh:// [email protected]/Keyfactor/terraform-module-keyfactor-github-test-environment-ad.git | main | |
| 69 | + |
| 70 | +## Resources |
| 71 | + |
| 72 | +| Name | Type | |
| 73 | +|------|------| |
| 74 | +| [github_repository.repo](https://registry.terraform.io/providers/integrations/github/latest/docs/data-sources/repository) | data source | |
| 75 | + |
| 76 | +## Inputs |
| 77 | + |
| 78 | +| Name | Description | Type | Default | Required | |
| 79 | +|------|-------------|------|---------|:--------:| |
| 80 | +| <a name="input_keyfactor_auth_token_url_12_3_0_KC"></a> [keyfactor\_auth\_token\_url\_12\_3\_0\_KC](#input\_keyfactor\_auth\_token\_url\_12\_3\_0\_KC) | The hostname of the KeyCloak instance to authenticate to for a Keyfactor Command access token | `string` | `"https://int-oidc-lab.eastus2.cloudapp.azure.com:8444/realms/Keyfactor/protocol/openid-connect/token"` | no | |
| 81 | +| <a name="input_keyfactor_client_id_12_3_0"></a> [keyfactor\_client\_id\_12\_3\_0](#input\_keyfactor\_client\_id\_12\_3\_0) | The client ID to authenticate with the Keyfactor instance using Keycloak client credentials | `string` | n/a | yes | |
| 82 | +| <a name="input_keyfactor_client_secret_12_3_0"></a> [keyfactor\_client\_secret\_12\_3\_0](#input\_keyfactor\_client\_secret\_12\_3\_0) | The client secret to authenticate with the Keyfactor instance using Keycloak client credentials | `string` | n/a | yes | |
| 83 | +| <a name="input_keyfactor_hostname_10_5_0"></a> [keyfactor\_hostname\_10\_5\_0](#input\_keyfactor\_hostname\_10\_5\_0) | The hostname of the Keyfactor instance | `string` | `"integrations1050-lab.kfdelivery.com"` | no | |
| 84 | +| <a name="input_keyfactor_hostname_12_3_0_KC"></a> [keyfactor\_hostname\_12\_3\_0\_KC](#input\_keyfactor\_hostname\_12\_3\_0\_KC) | The hostname of the Keyfactor instance | `string` | `"int-oidc-lab.eastus2.cloudapp.azure.com"` | no | |
| 85 | +| <a name="input_keyfactor_password_10_5_0"></a> [keyfactor\_password\_10\_5\_0](#input\_keyfactor\_password\_10\_5\_0) | The password to authenticate with the Keyfactor instance | `string` | n/a | yes | |
| 86 | +| <a name="input_keyfactor_username_10_5_0"></a> [keyfactor\_username\_10\_5\_0](#input\_keyfactor\_username\_10\_5\_0) | The username to authenticate with the Keyfactor instance | `string` | n/a | yes | |
| 87 | + |
| 88 | +## Outputs |
| 89 | + |
| 90 | +No outputs. |
| 91 | +<!-- END_TF_DOCS --> |
0 commit comments