unfunco / terraform-aws-oidc-github

Terraform module to configure GitHub Actions as an IAM OIDC identity provider in AWS.
https://registry.terraform.io/modules/unfunco/oidc-github/aws/latest
Apache License 2.0
91 stars 51 forks source link

Two instances of this module in one account conflict due to the same name #23

Closed pww217 closed 1 year ago

pww217 commented 1 year ago

It's related to this resource. The name seems auto-generated and we can't override it as far as I can tell.

pww217 commented 1 year ago

Error: Error: creating IAM OIDC Provider: EntityAlreadyExists: Provider with url https://token.actions.githubusercontent.com already exists

pww217 commented 1 year ago

Maybe there's nothing that can be done about this, but for RBAC/security reasons using a single Github provider for multiple repos isn't ideal.

unfunco commented 1 year ago

Hello @pww217, unfortunately one OIDC provider per URL is a limitation but you can set create_oidc_provider to false in the module and configure multiple roles if that works for your use case?

More information in this merged pull request: https://github.com/unfunco/terraform-aws-oidc-github/pull/4

pww217 commented 1 year ago

Thank you, I had begun to reach that conclusion myself. I'll look into that PR and close this issue.

Appreciate the response and your useful little module here. Thanks again.