일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- github
- 후기
- 보안 규칙
- IAM
- terraform
- vm
- CentOS
- docker
- pub/sub
- cicd
- Terraform Cloud
- interconnect
- vpc peering
- Python
- cloud
- cloud armor
- 자격증
- Java
- devops
- direnv
- Uptime Check
- cloud function
- 우테캠
- kubernetes
- AWS
- MIG
- Google Cloud Platform
- VAGRANT
- gcp
- Clean Code
- Today
- Total
EMD Blog
tfe Provider로 OAuth Client 구성 시 Provider 수동 연결 이슈 본문
tfe provider를 사용해서 Organization을 구성 할 때 OAuth Client도 함께 구성 할 수 있다. 아래 Resource 참고
https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/resources/oauth_client
위 리소스를 사용하면 이미 연결된 VCS Provider에 대해서 oauth_client_id 값을 받아 올 수 있다. 문제는 이 리소스의 경우 id를 받아오는 용도로 밖에 사용 할 수 없다는 것인데, 결국에는 Organization을 먼저 생성하고 수동으로 VCS 연결 후 다시 Terraform 코드를 Apply해줘야 한다.
이러면 굳이 저 리소스를 안쓰고 Client ID를 따로 관리하는 게 편해보이는데, 뭔가 다른 방법이 있는 것인지 확인 해볼 필요 있겠음.
Hashicorp에서 답변을 받았으나 UI 및 API를 사용하는 방법밖에 없는 것으로 확인 되었음.
============
Thank you for contacting HashiCorp Support.
When creating a VCS connection to a Terraform Cloud (TFC) Organization, configuring authentication for that VCS connection usually requires OAuth access and the process takes place within the TFC UI.
However, when creating a VCS connection through either "tfe" provider or TFC API you have to authenticate with a Personal Access Token (PAT) instead as a value for the oauth_token argument of the tfe_oauth_client resource.
You can read the following documentation on how to generate PAT for each of the VCS providers listed below:
GitHub and GitHub EnterpriseGitLab, GitLab Community Edition, and GitLab Enterprise EditionAzure DevOps Services and Azure DevOps Server
Note that for the "oauth_token" value, you needed to pass a PAT that has the appropriate permissions.
For example for GitHub:
- repo:status
- admin:org_hook
You can also find useful the following KB describing the steps required to create a VCS connection using a PAT.
'IaC > Terraform' 카테고리의 다른 글
tfe_variable Resource value Type 관련 (0) | 2022.09.04 |
---|---|
tfe Provider 사용 시 기본 “owners” 팀 관리 이슈 (0) | 2022.09.04 |
SQL Server 생성시 tier에 custom type 설정 (0) | 2022.09.03 |
Terraform State (0) | 2022.09.03 |
Terraform cloud workspace 관리 (0) | 2022.09.03 |