|
| 1 | +locals { |
| 2 | + repo_name = "delinea-secretserver-pam" |
| 3 | +} |
| 4 | + |
| 5 | +# ── Repository ──────────────────────────────────────────────────────────────── |
| 6 | + |
| 7 | +resource "github_repository" "repo" { |
| 8 | + name = local.repo_name |
| 9 | + description = "The Delinea Secret Server PAM Provider allows for the retrieval of stored account credentials from a Delinea Secret Server secret. A valid username, password and secret share settings are required." |
| 10 | + visibility = "public" |
| 11 | + |
| 12 | + has_issues = true |
| 13 | + has_projects = true |
| 14 | + has_wiki = true |
| 15 | + has_discussions = false |
| 16 | + |
| 17 | + allow_merge_commit = true |
| 18 | + allow_squash_merge = true |
| 19 | + allow_rebase_merge = true |
| 20 | + squash_merge_commit_title = "COMMIT_OR_PR_TITLE" |
| 21 | + squash_merge_commit_message = "COMMIT_MESSAGES" |
| 22 | + |
| 23 | + delete_branch_on_merge = false |
| 24 | + allow_auto_merge = false |
| 25 | + |
| 26 | + topics = ["keyfactor-pam"] |
| 27 | +} |
| 28 | + |
| 29 | +resource "github_repository_dependabot_security_updates" "repo" { |
| 30 | + repository = github_repository.repo.id |
| 31 | + enabled = true |
| 32 | +} |
| 33 | + |
| 34 | +# ── Team access ─────────────────────────────────────────────────────────────── |
| 35 | + |
| 36 | +resource "github_team_repository" "integration_engineers" { |
| 37 | + team_id = "4319508" |
| 38 | + repository = github_repository.repo.name |
| 39 | + permission = "push" |
| 40 | +} |
| 41 | + |
| 42 | +resource "github_team_repository" "release_builders" { |
| 43 | + team_id = "6287033" |
| 44 | + repository = github_repository.repo.name |
| 45 | + permission = "admin" |
| 46 | +} |
| 47 | + |
| 48 | +resource "github_team_repository" "private_access" { |
| 49 | + team_id = "5888166" |
| 50 | + repository = github_repository.repo.name |
| 51 | + permission = "pull" |
| 52 | +} |
| 53 | + |
| 54 | +# ── Integration test environment ────────────────────────────────────────────── |
| 55 | + |
| 56 | +resource "github_repository_environment" "integration_tests" { |
| 57 | + repository = github_repository.repo.name |
| 58 | + environment = "integration-tests" |
| 59 | +} |
| 60 | + |
| 61 | +resource "github_actions_environment_secret" "secret_server_url" { |
| 62 | + repository = github_repository.repo.name |
| 63 | + environment = github_repository_environment.integration_tests.environment |
| 64 | + secret_name = "SECRET_SERVER_URL" |
| 65 | + value = var.secret_server_url |
| 66 | +} |
| 67 | + |
| 68 | +resource "github_actions_environment_secret" "secret_server_username" { |
| 69 | + repository = github_repository.repo.name |
| 70 | + environment = github_repository_environment.integration_tests.environment |
| 71 | + secret_name = "SECRET_SERVER_USERNAME" |
| 72 | + value = var.secret_server_username |
| 73 | +} |
| 74 | + |
| 75 | +resource "github_actions_environment_secret" "secret_server_password" { |
| 76 | + repository = github_repository.repo.name |
| 77 | + environment = github_repository_environment.integration_tests.environment |
| 78 | + secret_name = "SECRET_SERVER_PASSWORD" |
| 79 | + value = var.secret_server_password |
| 80 | +} |
| 81 | + |
| 82 | +resource "github_actions_environment_secret" "secret_server_secret_id" { |
| 83 | + repository = github_repository.repo.name |
| 84 | + environment = github_repository_environment.integration_tests.environment |
| 85 | + secret_name = "SECRET_SERVER_SECRET_ID" |
| 86 | + value = var.secret_server_secret_id |
| 87 | +} |
| 88 | + |
| 89 | +resource "github_actions_environment_variable" "skip_tls_validation" { |
| 90 | + repository = github_repository.repo.name |
| 91 | + environment = github_repository_environment.integration_tests.environment |
| 92 | + variable_name = "SECRET_SERVER_SKIP_TLS_VALIDATION" |
| 93 | + value = "true" |
| 94 | +} |
| 95 | + |
| 96 | +# ── Repository variable to gate integration tests in CI ─────────────────────── |
| 97 | +# When this variable is absent (no terraform apply yet), the integration-test |
| 98 | +# job in dotnet-ci.yml is skipped entirely via `if: vars.INTEGRATION_TESTS_ENABLED == 'true'`. |
| 99 | + |
| 100 | +resource "github_actions_variable" "integration_tests_enabled" { |
| 101 | + repository = github_repository.repo.name |
| 102 | + variable_name = "INTEGRATION_TESTS_ENABLED" |
| 103 | + value = "true" |
| 104 | +} |
0 commit comments