-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: github-oidc multiple roles map #72
Open
marekaf
wants to merge
1
commit into
master
Choose a base branch
from
mb-oidc-multiple-roles-repos
base: master
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
Conversation
This file contains 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
Terraform plan in examples/03-aws-github-actions-oidc Plan: 3 to add, 0 to change, 2 to destroy, 1 to move.Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
- destroy
-/+ destroy and then create replacement
Terraform will perform the following actions:
# aws_iam_role_policy.github_actions_push_to_ecr must be replaced
-/+ resource "aws_iam_role_policy" "github_actions_push_to_ecr" {
!~ id = "*****************************************" -> (known after apply)
name = "github-actions-push-to-ecr"
!~ role = "github_actions" -> "github_actions_deployer" # forces replacement
# (1 unchanged attribute hidden)
}
# module.github_oidc_custom_policy.aws_iam_openid_connect_provider.github has moved to module.github_oidc_custom_policy.aws_iam_openid_connect_provider.github[0]
resource "aws_iam_openid_connect_provider" "github" {
id = "arn:aws:iam::175912345102:oidc-provider/token.actions.githubusercontent.com"
tags = {}
# (5 unchanged attributes hidden)
}
# module.github_oidc_custom_policy.aws_iam_role.github_actions will be destroyed
# (because resource uses count or for_each)
- resource "aws_iam_role" "github_actions" {
- arn = "arn:aws:iam::175912345102:role/github_actions" -> null
- assume_role_policy = jsonencode(
{
- Statement = [
- {
- Action = "sts:AssumeRoleWithWebIdentity"
- Condition = {
- StringLike = {
- "token.actions.githubusercontent.com:sub" = "*************************"
}
}
- Effect = "Allow"
- Principal = {
- Federated = "arn:aws:iam::175912345102:oidc-provider/token.actions.githubusercontent.com"
}
},
]
- Version = "2012-10-17"
}
) -> null
- create_date = "2022-09-02T10:15:21Z" -> null
- force_detach_policies = false -> null
- id = "github_actions" -> null
- managed_policy_arns = [] -> null
- max_session_duration = 3600 -> null
- name = "github_actions" -> null
- path = "/" -> null
- tags = {} -> null
- tags_all = {} -> null
- unique_id = "AROASR5JRLYHNFYWMJDQV" -> null
- inline_policy {
- name = "github-actions-push-to-ecr" -> null
- policy = jsonencode(
{
- Statement = [
- {
- Action = [
- "ecr:UploadLayerPart",
- "ecr:PutImage",
- "ecr:InitiateLayerUpload",
- "ecr:GetDownloadUrlForLayer",
- "ecr:CompleteLayerUpload",
- "ecr:BatchGetImage",
- "ecr:BatchCheckLayerAvailability",
]
- Effect = "Allow"
- Resource = "arn:aws:ecr:eu-west-1:175912345102:repository/test"
- Sid = ""
},
]
- Version = "2012-10-17"
}
) -> null
}
}
# module.github_oidc_custom_policy.aws_iam_role.github_actions["github_actions_deployer"] will be created
+ resource "aws_iam_role" "github_actions" {
+ arn = (known after apply)
+ assume_role_policy = jsonencode(
{
+ Statement = [
+ {
+ Action = "sts:AssumeRoleWithWebIdentity"
+ Condition = {
+ StringLike = {
+ "token.actions.githubusercontent.com:sub" = "*************************"
}
}
+ Effect = "Allow"
+ Principal = {
+ Federated = "arn:aws:iam::175912345102:oidc-provider/token.actions.githubusercontent.com"
}
},
]
+ Version = "2012-10-17"
}
)
+ create_date = (known after apply)
+ force_detach_policies = false
+ id = (known after apply)
+ managed_policy_arns = (known after apply)
+ max_session_duration = 3600
+ name = "github_actions_deployer"
+ name_prefix = (known after apply)
+ path = "/"
+ tags_all = (known after apply)
+ unique_id = (known after apply)
}
# module.github_oidc_custom_policy.aws_iam_role.github_actions["github_actions_terraform"] will be created
+ resource "aws_iam_role" "github_actions" {
+ arn = (known after apply)
+ assume_role_policy = jsonencode(
{
+ Statement = [
+ {
+ Action = "sts:AssumeRoleWithWebIdentity"
+ Condition = {
+ StringLike = {
+ "token.actions.githubusercontent.com:sub" = "***************************"
}
}
+ Effect = "Allow"
+ Principal = {
+ Federated = "arn:aws:iam::175912345102:oidc-provider/token.actions.githubusercontent.com"
}
},
]
+ Version = "2012-10-17"
}
)
+ create_date = (known after apply)
+ force_detach_policies = false
+ id = (known after apply)
+ managed_policy_arns = [
+ "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryPowerUser",
]
+ max_session_duration = 3600
+ name = "github_actions_terraform"
+ name_prefix = (known after apply)
+ path = "/"
+ tags_all = (known after apply)
+ unique_id = (known after apply)
}
Plan: 3 to add, 0 to change, 2 to destroy. 📝 Plan generated in terraform-plan-03-aws-github-actions-oidc #169 |
Terraform plan in examples/01-minimal-aws-cloudformation-bootstrap No changes. Your infrastructure matches the configuration.
📝 Plan generated in terraform-plan-01-minimal-aws-cloudformation-bootstrap #174 |
Terraform plan in examples/02-minimal-gcp-tf-bootstrap No changes. Your infrastructure matches the configuration.
📝 Plan generated in terraform-plan-02-minimal-gcp-tf-bootstrap #177 |
09c36fe
to
e446b32
Compare
e446b32
to
9650d89
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.