-
Notifications
You must be signed in to change notification settings - Fork 5
Ajout de l'IAM pour Github backups #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
leo-naeka
wants to merge
2
commits into
main
Choose a base branch
from
leo/add-github-backups-iam
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
infrastructure/iac-gip-inclusion/secret-manager/terraform/.terraform.lock.hcl
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
infrastructure/iac-gip-inclusion/secret-manager/terraform/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Secrets gérés par Terraform pour le GIP Plateforme de l'inclusion | ||
|
|
||
| Les secrets relatifs à un projet spécifique n'ont pas leur place ici ! | ||
|
|
||
| <!-- BEGIN_TF_DOCS --> | ||
| ## Requirements | ||
|
|
||
| | Name | Version | | ||
| |------|---------| | ||
| | <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.10 | | ||
|
|
||
| ## Providers | ||
|
|
||
| | Name | Version | | ||
| |------|---------| | ||
| | <a name="provider_scaleway"></a> [scaleway](#provider\_scaleway) | 2.60.5 | | ||
| | <a name="provider_scaleway.tmp"></a> [scaleway.tmp](#provider\_scaleway.tmp) | 2.60.5 | | ||
|
|
||
| ## Modules | ||
|
|
||
| No modules. | ||
|
|
||
| ## Resources | ||
|
|
||
| | Name | Type | | ||
| |------|------| | ||
| | [scaleway_secret.github_backups_api_key](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/secret) | resource | | ||
| | [scaleway_account_project.default](https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/data-sources/account_project) | data source | | ||
|
|
||
| ## Inputs | ||
|
|
||
| | Name | Description | Type | Default | Required | | ||
| |------|-------------|------|---------|:--------:| | ||
| | <a name="input_managed"></a> [managed](#input\_managed) | Indicates the resource is managed by Terraform | `string` | `"Managed by Terraform"` | no | | ||
| | <a name="input_scw_region"></a> [scw\_region](#input\_scw\_region) | Scaleway region for resources | `string` | n/a | yes | | ||
| | <a name="input_scw_zone"></a> [scw\_zone](#input\_scw\_zone) | Scaleway zone for resources | `string` | n/a | yes | | ||
|
|
||
| ## Outputs | ||
|
|
||
| No outputs. | ||
| <!-- END_TF_DOCS --> |
14 changes: 14 additions & 0 deletions
14
infrastructure/iac-gip-inclusion/secret-manager/terraform/backend.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| terraform { | ||
| backend "s3" { | ||
| bucket = "gip-inclusion-state" | ||
| key = "iac-gip-inclusion/secret-manager/terraform/terraform.tfstate" | ||
| region = "fr-par" | ||
| skip_credentials_validation = true | ||
| skip_metadata_api_check = true | ||
| skip_region_validation = true | ||
| skip_requesting_account_id = true | ||
| endpoints = { | ||
| s3 = "https://s3.fr-par.scw.cloud" | ||
| } | ||
| } | ||
| } |
4 changes: 4 additions & 0 deletions
4
infrastructure/iac-gip-inclusion/secret-manager/terraform/data.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| data "scaleway_account_project" "default" { | ||
| name = "default" | ||
| provider = scaleway.tmp | ||
| } |
15 changes: 15 additions & 0 deletions
15
infrastructure/iac-gip-inclusion/secret-manager/terraform/main.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| terraform { | ||
| required_providers { | ||
| scaleway = { | ||
| source = "scaleway/scaleway" | ||
| } | ||
| } | ||
| required_version = ">= 1.10" | ||
| } | ||
|
|
||
| resource "scaleway_secret" "github_backups_api_key" { | ||
| name = "github-backups-api-key" | ||
| protected = true | ||
| description = var.managed | ||
| type = "key_value" | ||
| } |
9 changes: 9 additions & 0 deletions
9
infrastructure/iac-gip-inclusion/secret-manager/terraform/providers.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| provider "scaleway" { | ||
| alias = "tmp" | ||
| } | ||
|
|
||
| provider "scaleway" { | ||
| region = var.scw_region | ||
| zone = var.scw_zone | ||
| project_id = data.scaleway_account_project.default.id | ||
| } | ||
2 changes: 2 additions & 0 deletions
2
infrastructure/iac-gip-inclusion/secret-manager/terraform/terraform.tfvars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| scw_region = "fr-par" | ||
| scw_zone = "fr-par-1" |
15 changes: 15 additions & 0 deletions
15
infrastructure/iac-gip-inclusion/secret-manager/terraform/variables.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| variable "scw_region" { | ||
| type = string | ||
| description = "Scaleway region for resources" | ||
| } | ||
|
|
||
| variable "scw_zone" { | ||
| type = string | ||
| description = "Scaleway zone for resources" | ||
| } | ||
|
|
||
| variable "managed" { | ||
| type = string | ||
| description = "Indicates the resource is managed by Terraform" | ||
| default = "Managed by Terraform" | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok donc si je comprends bien on fait ça pour exposer notre projet scaleway dans les data et pouvoir récupérer le default id quand on déclare "vraiment" le provider en bas ? L'idée c'est que le provider ne peut pas se référencer lui-même si j'ai compris
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tout à fait, car la définition du provider dépend de la réponse de la source de données, mais pour requêter la source de données, il faut un provider.
https://github.com/gip-inclusion/infrastructure/pull/40/files/e2ee8261c08b715435bf9cee3cfbf88414fabee3#diff-b4b8e40a68685bbd22342674bf7c3b20abc06604f0caf418b2c71f04d20b583fR8