Skip to content
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: Add support for inline policy creation #479

Conversation

fatmcgav
Copy link
Contributor

@fatmcgav fatmcgav commented Apr 19, 2024

Description

This commit adds support for creating an inline policy for an IAM role to the iam-assumable-role-with-oidc and iam-assumable-role modules.

Also updated examples for these modules.

Motivation and Context

Allows creation of an IAM role with an inline policy.

Breaking Changes

None

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@fatmcgav fatmcgav force-pushed the feat/support_inline_policies branch 2 times, most recently from 3ee7dc9 to 7df208a Compare April 19, 2024 20:42
@fatmcgav
Copy link
Contributor Author

@bryantbiggs Any chance of a review on this one? 😎

This commit adds support for creating an inline policy for an IAM role
to the `iam-assumable-role-with-oidc` and `iam-assumable-role` modules.

Also updated examples for these modules, and corresponding wrappers.
@fatmcgav fatmcgav force-pushed the feat/support_inline_policies branch from 7df208a to ae6789b Compare May 23, 2024 08:57
@fatmcgav
Copy link
Contributor Author

@bryantbiggs / @antonbabenko Any chance of a review on this one? 👍

Copy link

This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days

@github-actions github-actions bot added the stale label Jun 23, 2024
@maor-paz-hs
Copy link

bump

@github-actions github-actions bot removed the stale label Jul 2, 2024
@bryantbiggs
Copy link
Member

why are we creating examples that look like users should be using https://github.com/terraform-aws-modules/terraform-aws-iam/tree/master/modules/iam-role-for-service-accounts-eks ?

@fatmcgav
Copy link
Contributor Author

fatmcgav commented Jul 2, 2024

why are we creating examples that look like users should be using https://github.com/terraform-aws-modules/terraform-aws-iam/tree/master/modules/iam-role-for-service-accounts-eks ?

So for my use case, I needed to be able to add an inline policy to a role that's assumed by a 3rd party service, not by EKS...

@bryantbiggs
Copy link
Member

that doesn't really explain why the examples added are IRSA related?

@fatmcgav
Copy link
Contributor Author

fatmcgav commented Jul 2, 2024

that doesn't really explain why the examples added are IRSA related?

Ah, ok... that was probably a poor copy'n'paste on my part... Will re-work to show a CircleCI related example...

@bryantbiggs
Copy link
Member

thank you - it doesn't have to fully function, you can make up OIDC provider details just to demonstrate the point (i.e. - we don't test whether the authentication flow between the role and the OIDC provider works correctly)

and the implementation is currently quite lacking - here is a reference that is closer to what we could support terraform-aws-modules/terraform-aws-eks#3087

@fatmcgav
Copy link
Contributor Author

fatmcgav commented Jul 2, 2024

and the implementation is currently quite lacking - here is a reference that is closer to what we could support terraform-aws-modules/terraform-aws-eks#3087

Nice... I'll replicate here 👍

@fatmcgav
Copy link
Contributor Author

fatmcgav commented Jul 2, 2024

RIght, I've pushed a couple of updates based on the changes from terraform-aws-modules/terraform-aws-eks#3087 and also tweaked the oidc examples to reference CircleCI.

@bryantbiggs Let me know what you think 👍

@bryantbiggs bryantbiggs merged commit e13cb1e into terraform-aws-modules:master Jul 5, 2024
35 checks passed
antonbabenko pushed a commit that referenced this pull request Jul 5, 2024
## [5.40.0](v5.39.1...v5.40.0) (2024-07-05)

### Features

* Add support for inline policy creation ([#479](#479)) ([e13cb1e](e13cb1e))
@antonbabenko
Copy link
Member

This PR is included in version 5.40.0 🎉

Copy link

github-actions bot commented Aug 5, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants