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

aws-cdk/aws-cognito-identitypool-alpha: allow session tagging #30919

Open
2 tasks
lobanov opened this issue Jul 22, 2024 · 1 comment
Open
2 tasks

aws-cdk/aws-cognito-identitypool-alpha: allow session tagging #30919

lobanov opened this issue Jul 22, 2024 · 1 comment
Labels
@aws-cdk/aws-cognito-identitypool effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@lobanov
Copy link

lobanov commented Jul 22, 2024

Describe the feature

Allow IAM roles created by Identity Pool CDK construct to tag sessions for federated identities.

Use Case

We are using a Cognito Identity Pool to assign AWS credentials for federated identities, and we need to tag sessions for the IAM policies to work. Unfortunately, it seems to be impossible to create Identity Pool and its authenticated role in such a way that it is allowed to tag sessions. The approach introduced in #15908 (calling .withSessionTags() on the principal before passing it into the newly created IAM role) seemingly cannot be used with Identity Pool CDK construct, because the identity pool does not exist at the time authenticated role is created, and it looks impossible to change trust policy on the IAM role created by Identity Pool CDK construct itself.

Proposed Solution

It would be great if there was a flag in the Identity Pool CDK construct allowing the authenticated role to tag created sessions. Probably all it needs to do is to call .withSessionTags() on the identity pool principal when the role is being created.

Other Information

As a workaround, we have to manually add sts:TagSessions action to the trust policy of the authenticated role.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.130 (python)

Environment details (OS name and version, etc.)

Linux 6.6.30-0-virt 1-Alpine SMP aarch64 GNU/Linux

@lobanov lobanov added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jul 22, 2024
@pahud
Copy link
Contributor

pahud commented Jul 22, 2024

Yes, adding sts:TagSessions should be a workaround but we definitely need to improve the user experience here. Please help us prioritize with 👍 .

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cognito-identitypool effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

2 participants