-
Notifications
You must be signed in to change notification settings - Fork 3
Feat/#34: OIDC 코드 수정, CI 코드 수정 #35
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
47418b8
OIDC 코드 추가, ci/cd 코드 수정
rnjsdbwlsqwer 79be864
ci 중복제거 수정
rnjsdbwlsqwer 9a22c15
포맷 체크
rnjsdbwlsqwer 60fe982
iam 정책 추가
rnjsdbwlsqwer 85a88bc
포맷 체크
rnjsdbwlsqwer 1e3e4e1
OIDC 코드 수정, PR output 수정
rnjsdbwlsqwer 4af40c4
change pr output line
imyourhopeee 2a408ab
change pr output line_2
imyourhopeee ffedc06
change pr output line_3
imyourhopeee 4b696f2
change pr output line_3
imyourhopeee b3227e1
change pr output line_4
imyourhopeee 38a955c
모듈 폴더 이름 수정
rnjsdbwlsqwer ecac189
ci 코드 수정
rnjsdbwlsqwer c7091c1
ci 글자 깨짐 수정
rnjsdbwlsqwer 1d24067
ci 글자 깨짐 수정
rnjsdbwlsqwer 4cd81b3
ci 글자 깨짐 수정
rnjsdbwlsqwer 4a3b962
ci 글자 깨짐 수정
rnjsdbwlsqwer f2a7cee
ci 글자 깨짐 수정
rnjsdbwlsqwer 6580b0f
ci 글자 깨짐 수정
rnjsdbwlsqwer 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| .DS_Store | ||
| .idea | ||
|
|
||
| # tfstate files | ||
| *.tfstate | ||
| *.tfstate.* | ||
| .terraform | ||
| .terraform/ | ||
| *.tfvars | ||
| *.tfvars.json | ||
| *.tfplan | ||
| *.tfplan.json | ||
| *.tfignore | ||
| *.tfbackup | ||
| *.tfstate.backup | ||
| *.tfstate.backup.* | ||
| *.tfstate.backup.json | ||
| *.tfstate.backup.json.* | ||
| .terraform.lock.hcl |
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 @@ | ||
| terraform { | ||
| backend "s3" { | ||
| bucket = "cloudfence-dev-state" | ||
| key = "OIDC/iam.tfstate" | ||
| region = "ap-northeast-2" | ||
| encrypt = true | ||
| dynamodb_table = "s3-dev-lock" | ||
| } | ||
| } |
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,43 @@ | ||
| # modules/github_oidc를 불러와 해당account별 OIDC역할을 자동으로 생성하는 구조 | ||
| # | ||
| module "github_oidc" { | ||
| source = "../../../modules/iam_OIDC" | ||
|
|
||
| role_name = "application-deployment-role1" | ||
|
|
||
| # GitHub Actions에서 이 role을 사용할 수 있도록 허용하는 sub조건 | ||
| sub_condition = ["repo:WHS-DevSecOps-infra/Organization:*", | ||
| "repo:WHS-DevSecOps-infra/Application-Deployment:*"] | ||
|
|
||
| thumbprint_list = [ | ||
| "d89e3bd43d5d909b47a18977aa9d5ce36cee184c" | ||
| ] | ||
|
|
||
| # 이 role에 연결할 정책들(IAM 정책 ARN) | ||
| policy_arns = [] | ||
| } | ||
|
|
||
| #tfsec:ignore:aws-iam-no-policy-wildcards | ||
| resource "aws_iam_role_policy" "custom_inline_policy" { | ||
| name = "dev-role" | ||
| role = module.github_oidc.oidc_role_name # 모듈에서 출력된 role이름 참조 | ||
|
|
||
| policy = jsonencode({ | ||
| "Version" : "2012-10-17", | ||
| "Statement" : [ | ||
| { | ||
| "Sid" : "VisualEditor0", | ||
| "Effect" : "Allow", | ||
| "Action" : [ | ||
| "rds:*", | ||
| "s3:*", | ||
| "ec2:*", | ||
| "kms:*", | ||
| "dynamodb:*", | ||
| "iam:*" | ||
| ], | ||
| "Resource" : "*" | ||
| } | ||
| ] | ||
| }) | ||
| } |
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 @@ | ||
| terraform { | ||
| backend "s3" { | ||
| bucket = "cloudfence-identity-state" | ||
| key = "OIDC/iam.tfstate" | ||
| region = "ap-northeast-2" | ||
| encrypt = true | ||
| dynamodb_table = "s3-identity-lock" | ||
| } | ||
| } |
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.
현재 ci와 cd의 변경 파일 탐지 로직이 다르네요.
cd는 filter 방식이고, ci는 git diff 기반으로 탐지하는 것 같은데
ci가 변경사항 탐지는 더 정확해 보여요.
그래서 cd는 폴더 기준으로 돌아가는 것 같은데 방식을 통일할 생각도 있으실까요?
Uh oh!
There was an error while loading. Please reload this page.
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.
처음에는 CD도 git diff로 변경 사항을 탐지하려 했지만, 머지 후에는 기준이 불분명해져 잘 작동하지 않았어요.
그래서 CD는 필터 기반으로 탐지하는 것이 더 적합하다고 판단했습니다.