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

Refactored Cognito AAI from Data Portal stack #218

Merged
merged 2 commits into from
Apr 12, 2022

Conversation

williamputraintan
Copy link
Member

@williamputraintan williamputraintan commented Apr 5, 2022

  • Break out Cognito User Pool and Identity Pool from Data Portal
  • Imported existing resources
  • Migrated terraform states
  • Improved structure and code arrangement

@williamputraintan williamputraintan self-assigned this Apr 5, 2022
@williamputraintan williamputraintan linked an issue Apr 5, 2022 that may be closed by this pull request
Copy link
Member

@victorskl victorskl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, the plan is to refactor the TF code including their TF state migration into separate stack. It will get a bit touchy with state import, anyhow, in tick, next down the track. So, let me take it from here. Thanks for the try, Will!

@victorskl victorskl self-assigned this Apr 6, 2022
Copy link
Member

@victorskl victorskl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Status: @victorskl will take over branch and follow up with changes.

* Renamed to Cognito AAI
* Renamed and migrated terraform states
* Improved structure and code arrangement
* Improved README
@victorskl victorskl added this to the Chartreux milestone Apr 11, 2022
@victorskl victorskl self-requested a review April 11, 2022 23:00
Copy link
Member

@victorskl victorskl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay! This refactor is ready to go to this point. Going to merge in tick, next.

@victorskl
Copy link
Member

@williamputraintan Just FYI and, feel free to have a peek into diff. No action required on your side.

@victorskl victorskl changed the title Added global UMCCR Cognito Refactored Cognito AAI from Data Portal stack Apr 11, 2022
@williamputraintan
Copy link
Member Author

williamputraintan commented Apr 11, 2022

Wondering what do you think of defining SSM Parameter for cog_user_pool_id, cog_app_client_id_local, oauth_domain from the main stack, then for any future app could just refer this user_pool from their own stack? Ideally we do not need to keep changing this stack for every new app. (let the new app handle by its own stack)

By this means, app that is defined here such as sscheck or status_page need to refactored out to their own stack.

@victorskl
Copy link
Member

Yep; that was the initial idea, remember? You have faced issue trouble creating with CDK or something; in those early days for sscheck/status-page. Hence, we did this quickly here.

@williamputraintan
Copy link
Member Author

williamputraintan commented Apr 11, 2022

Yup! The trouble was adding a new app_client to the same identity_pool. Realising that identity_pool is not required, and if required we could just create a new identity_pool in the app itself instead of adding it to the existing one.

@victorskl
Copy link
Member

SSM Parameter for cog_user_pool_id, cog_app_client_id_local, oauth_domain from the main stack

This are already in SSM; just that, they still bear /data_portal/... coordinate for now. We could change this to /umccr/... or something else later. But that's pure textual naming issue we can tackle in next iteration. For now, we just focus on splitting out code and migrating existing states.

@victorskl
Copy link
Member

The trouble was adding a new app_client to the same identity_pool. Realising that identity_pool is not required

Ah! Right, I remember now! Okay.

and if required we could just create a new identity_pool in the app itself instead of adding it to the existing one.

Understood. This can be done, yes. But, we probably wish to reduce multiple/many Identity Pools spinning up. We shall see; case by case basis, though.

@williamputraintan
Copy link
Member Author

This are already in SSM; just that, they still bear /data_portal/... coordinate for now. We could change this to /umccr/... or something else later. But that's pure textual naming issue we can tackle in next iteration. For now, we just focus on splitting out code and migrating existing states.

Yup sure! I was planning to move out sscheck and status_page from this stack

@williamputraintan
Copy link
Member Author

williamputraintan commented Apr 12, 2022

Understood. This can be done, yes. But, we probably wish to reduce multiple/many Identity Pools spinning up. We shall see; case by case basis, though.

Sure! ( My consideration is spinning up Identity Pool is free and I assume needing identity pool means that there is a specific need for that app 😅 )

@victorskl
Copy link
Member

Yup, yup, correct!

@victorskl
Copy link
Member

Merging...

@victorskl victorskl merged commit 046aa81 into master Apr 12, 2022
@victorskl victorskl deleted the add-authentication-stack branch April 12, 2022 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup Cognito AAI - To refactor out from Portal Stack
2 participants