Skip to content

Commit

Permalink
Merge pull request #46 from ConseilsTI/v0.0.45
Browse files Browse the repository at this point in the history
V0.0.45
  • Loading branch information
benyboy84 authored Mar 19, 2024
2 parents 83dce15 + a792163 commit 58fa530
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ instead of a user token.

### Hashicorp Vault Secrets Permissions

To read secrets from Hashicorp Vault Secrets, provide a client ID and a key
from a service principals with the secret `reader` role.
To read and create secrets in Hashicorp Vault Secrets, provide a client ID and a key
from a service principals with the secret `contributor` role.

### GitHub Permissions

Expand Down Expand Up @@ -84,7 +84,7 @@ GITHUB\_APP\_PEM\_FILE, and GITHUB\_OWNER environment variables to authenticate.
* branches protection
* repositories secrets
* teams
* Read secrets from Hashicorp Vault Secrets
* Read and write secrets in Hashicorp Vault Secrets

## Prerequisite

Expand Down Expand Up @@ -179,6 +179,7 @@ No optional inputs.
The following resources are used by this module:

- [github_actions_secret.this](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/actions_secret) (resource)
- [hcp_vault_secrets_secret.this](https://registry.terraform.io/providers/hashicorp/hcp/latest/docs/resources/vault_secrets_secret) (resource)
- [tfe_project.project](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/project) (resource)
- [tfe_project_variable_set.this](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/project_variable_set) (resource)
- [tfe_variable.variable_set](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/variable) (resource)
Expand Down
6 changes: 3 additions & 3 deletions docs/README_header.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ instead of a user token.

### Hashicorp Vault Secrets Permissions

To read secrets from Hashicorp Vault Secrets, provide a client ID and a key
from a service principals with the secret `reader` role.
To read and create secrets in Hashicorp Vault Secrets, provide a client ID and a key
from a service principals with the secret `contributor` role.

### GitHub Permissions

Expand Down Expand Up @@ -83,7 +83,7 @@ GITHUB_APP_PEM_FILE, and GITHUB_OWNER environment variables to authenticate.
* branches protection
* repositories secrets
* teams
* Read secrets from Hashicorp Vault Secrets
* Read and write secrets in Hashicorp Vault Secrets

## Prerequisite

Expand Down
8 changes: 8 additions & 0 deletions resources_hcp_vault_secrets.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# The following code blode is used to create secret in Hashicorp Vault.

resource "hcp_vault_secrets_secret" "this" {
for_each = nonsensitive({ for team in local.tfc_teams : team.name => team if try(team.token, false) == true })
app_name = "TerraformCloud"
secret_name = lower(replace(each.value.name, "/\\W|_|\\s/", "_"))
secret_value = module.tfe_teams[each.value.name].token
}

0 comments on commit 58fa530

Please sign in to comment.