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

Cognito User Pool UI Customization #8114

Merged
merged 11 commits into from
Feb 25, 2021

Conversation

gdlx
Copy link
Contributor

@gdlx gdlx commented Mar 28, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Fixes #3634

Changes proposed in this pull request:

  • Ability to define Cognito User Pool Client UI Customization
  • Ability to define Cognito User Pool UI Customization (for uncustomized clients, as managed by AWS API)

I've written acceptance tests but didn't run them (I've tested the feature in an existing workspace).

As the feature is usable from 2 different resources, I've tried to avoid code duplication as much as possible.

I've moved loadFileContent function from resource_aws_lambda_function.go to utils.go to make it global.

The remoteFileContent function in utils.go is kind of a hack to allow getting content seamlessly from a local file or a URL, because we send a file to AWS API, but it sends back an URL.

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/cognito service/lambda Issues and PRs that pertain to the lambda service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Mar 28, 2019
@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Mar 28, 2019
@aeschright aeschright requested a review from a team June 26, 2019 00:54
Copy link

@chadasapp chadasapp left a comment

Choose a reason for hiding this comment

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

Just some documentation/error message nitpicks I spotted. Otherwise it looks ok to me, but I'm hardly one to approve this.

website/docs/r/cognito_user_pool.markdown Outdated Show resolved Hide resolved
website/docs/r/cognito_user_pool_client.markdown Outdated Show resolved Hide resolved
aws/resource_aws_cognito_user_pool_client.go Outdated Show resolved Hide resolved
aws/resource_aws_cognito_user_pool.go Outdated Show resolved Hide resolved
aws/resource_aws_cognito_user_pool.go Outdated Show resolved Hide resolved
@gdlx
Copy link
Contributor Author

gdlx commented Aug 6, 2019

Thanks @chadasapp !

I'm currently in holiday so I'll unlikely be able to look at this before the end of august.

Utilisez "the" ;-)

No idea why I've written this, I never use French in code 🤔

Copy link
Contributor

@timmjd timmjd left a comment

Choose a reason for hiding this comment

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

Hey @gdlx, are you back from vacation? Would be great to get this feature

website/docs/r/cognito_user_pool.markdown Outdated Show resolved Hide resolved
website/docs/r/cognito_user_pool_client.markdown Outdated Show resolved Hide resolved
Copy link
Contributor

@timmjd timmjd left a comment

Choose a reason for hiding this comment

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

Hey @gdlx, are you back from vacation? Would be great to get this feature

aws/resource_aws_cognito_user_pool_client.go Outdated Show resolved Hide resolved
aws/resource_aws_cognito_user_pool.go Outdated Show resolved Hide resolved
aws/resource_aws_cognito_user_pool.go Outdated Show resolved Hide resolved
@gdlx
Copy link
Contributor Author

gdlx commented Sep 18, 2019

Hey @gdlx, are you back from vacation? Would be great to get this feature

Sorry, I didn't work with Cognito nor Terraform for a few months so it's a bit difficult to go back to this but I'll take a look shortly.

@gdlx
Copy link
Contributor Author

gdlx commented Sep 18, 2019

@timmjd I've rebased and accepted your changes, thanks a lot for helping ! But I fear this won't be enough to get the feature merged. It has to be reviewed by the core team.

@renatoargh
Copy link

I think that CI needs to pass as well, @gdlx - this will be a very useful feature, hope someone with some terraform foo can help you get this merged 🥇

@mubeta06
Copy link
Contributor

👍

@gdlx
Copy link
Contributor Author

gdlx commented Nov 4, 2019

I'm sorry, I don't work with Terraform anymore for now and don't have much time to improve the PR.
I mean, I could blindly apply your change proposals but I'd have no way to test the code behavior.

That and the fact that the tests were passing when I sent the PR and it didn't help merging it then, it doesn't motivate me to spend more time to wait 6 more months before having to fix it again.

However, I'd be pleased to give push access on the repo to whoever wants to fix the code !

@jfharden
Copy link
Contributor

@gdlx I'll pick this up if you are ok with that?

@supergibbs
Copy link
Contributor

@jfharden Did you get access? Happy to help test if you need it. I have a terraform script for Cognito but manually use CLI for this part.

@teamterraform
Copy link

Notification of Recent and Upcoming Changes to Contributions

Thank you for this contribution! There have been a few recent development changes that affect this pull request. We apologize for the inconvenience, especially if there have been long review delays up until now. Please note that this is automated message from an unmonitored account. See the FAQ for additional information on the maintainer team and review prioritization.

If you are unable to complete these updates, please leave a comment for the community and maintainers so someone can potentially continue the work. The maintainers will encourage other contributors to use the existing contribution as the base for additional changes as appropriate. Otherwise, contributions that do not receive updated code or comments from the original contributor may be closed in the future so the maintainers can focus on active items.

For the most up to date information about Terraform AWS Provider development, see the Contributing Guide. Additional technical debt changes can be tracked with the technical-debt label on issues.

As part of updating a pull request with these changes, the most current unit testing and linting will run. These may report issues that were not previously reported.

Action Required: Terraform 0.12 Syntax

Reference: #8950
Reference: #14417

Version 3 and later of the Terraform AWS Provider, which all existing contributions would potentially be added, only supports Terraform 0.12 and later. Certain syntax elements of Terraform 0.11 and earlier show deprecation warnings during runs with Terraform 0.12. Documentation and test configurations, such as those including deprecated string interpolations (some_attribute = "${aws_service_thing.example.id}") should be updated to the newer syntax (some_attribute = aws_service_thing.example.id). Contribution testing will automatically fail on older syntax in the near future. Please see the referenced issues for additional information.

Action Required: Terraform Plugin SDK Version 2

Reference: #14551

The Terraform AWS Provider has been upgraded to the latest version of the Terraform Plugin SDK. Generally, most changes to contributions should only involve updating Go import paths in source code files. Please see the referenced issue for additional information.

Removal of website/aws.erb File

Reference: #14712

Any changes to the website/aws.erb file are no longer necessary and should be removed from this contribution to prevent merge issues in the near future when the file is removed from the repository. Please see the referenced issue for additional information.

Upcoming Change of Git Branch Naming

Reference: #14292

Development environments will need their upstream Git branch updated from master to main in the near future. Please see the referenced issue for additional information and scheduling.

Upcoming Change of GitHub Organization

Reference: #14715

This repository will be migrating from https://github.com/terraform-providers/terraform-provider-aws to https://github.com/hashicorp/terraform-provider-aws. No practitioner or developer action is anticipated and most GitHub functionality will automatically redirect to the new location. Go import paths including terraform-providers can remain for now. Please see the referenced issue for additional information and scheduling.

@alejandrod
Copy link

This will be VERY useful.

@breathingdust
Copy link
Member

Hi all! 👋 Just wanted to direct you to our public roadmap for this quarter (Nov-Jan) in which this item has been mentioned.

Due to the significant community interest in support for this feature, we will be looking at merging existing contributions soon.

We appreciate all the contributions and feedback thus far.

Look out for support in the provider soon!

@alejandrod
Copy link

Waiting for this! Very important. I hope it gets merged soon.

Base automatically changed from master to main January 23, 2021 00:55
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:55
@anGie44 anGie44 force-pushed the cognito-ui-customization branch 2 times, most recently from f31c94b to a0be99a Compare February 23, 2021 05:06
@anGie44
Copy link
Contributor

anGie44 commented Feb 23, 2021

Output of acceptance tests (commercial):

--- PASS: TestAccAWSCognitoUserPoolClient_disappears (16.75s)
--- PASS: TestAccAWSCognitoUserPoolClient_allFields (21.51s)
--- PASS: TestAccAWSCognitoUserPoolClient_basic (23.06s)
--- PASS: TestAccAWSCognitoUserPoolClient_analyticsConfigWithArn (26.42s)
--- PASS: TestAccAWSCognitoUserPoolClient_RefreshTokenValidity (32.59s)
--- PASS: TestAccAWSCognitoUserPoolClient_allFieldsUpdatingOneField (34.37s)
--- PASS: TestAccAWSCognitoUserPoolClient_Name (37.37s)
--- PASS: TestAccAWSCognitoUserPoolClient_analyticsConfig (49.08s)
--- PASS: TestAccAWSCognitoUserPoolClient_UICustomization_ImageFile (56.67s)
--- PASS: TestAccAWSCognitoUserPoolClient_UICustomization_CSSandImageFile (57.25s)
--- PASS: TestAccAWSCognitoUserPoolClient_UICustomization_CSS (59.16s)
--- PASS: TestAccAWSCognitoUserPool_SmsConfiguration_ExternalId (564.96s)
--- PASS: TestAccAWSCognitoUserPool_withPasswordPolicy (566.11s)
--- PASS: TestAccAWSCognitoUserPool_SmsAuthenticationMessage (611.32s)
--- PASS: TestAccAWSCognitoUserPool_MfaConfiguration_SmsConfigurationAndSoftwareTokenMfaConfiguration (612.74s)
--- PASS: TestAccAWSCognitoUserPool_withEmailVerificationMessage (522.71s)
--- PASS: TestAccAWSCognitoUserPool_withAdminCreateUserConfigurationAndPasswordPolicy (254.85s)
--- PASS: TestAccAWSCognitoUserPool_withTags (693.87s)
--- PASS: TestAccAWSCognitoUserPool_withAdvancedSecurityMode (694.62s)
--- PASS: TestAccAWSCognitoUserPool_SmsConfiguration (722.14s)
--- PASS: TestAccAWSCognitoUserPool_withUICustomization_CSS (732.47s)
--- PASS: TestAccAWSCognitoUserPool_update (743.26s)
--- PASS: TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration (438.97s)
--- PASS: TestAccAWSCognitoUserPool_withDeviceConfiguration (315.77s)
--- PASS: TestAccAWSCognitoUserPool_MfaConfiguration_SoftwareTokenMfaConfigurationToSmsConfiguration (288.17s)
--- PASS: TestAccAWSCognitoUserPool_withUICustomization_CSSandImageFile (810.03s)
--- PASS: TestAccAWSCognitoUserPool_MfaConfiguration_SmsConfigurationToSoftwareTokenMfaConfiguration (272.14s)
--- PASS: TestAccAWSCognitoUserPool_withUICustomization_ImageFile (824.50s)
--- PASS: TestAccAWSCognitoUserPool_MfaConfiguration_SmsConfiguration (513.44s)
--- PASS: TestAccAWSCognitoUserPool_MfaConfiguration_SoftwareTokenMfaConfiguration (343.25s)
--- PASS: TestAccAWSCognitoUserPool_recovery (348.39s)

@anGie44 anGie44 force-pushed the cognito-ui-customization branch 2 times, most recently from 01c856e to e11ff34 Compare February 23, 2021 18:16
@anGie44 anGie44 added this to the v3.30.0 milestone Feb 24, 2021
@anGie44 anGie44 removed the service/lambda Issues and PRs that pertain to the lambda service. label Feb 24, 2021
@anGie44
Copy link
Contributor

anGie44 commented Feb 25, 2021

Hi @gdlx 👋 after more robust testing, I came across some unfriendly resource behaviors when configuring the UI Customization feature w/in the existing User Pool and User Pool Client resources including:

  • the computed behavior of the configuration block when it's applied on a user pool and thus is returned on a state refresh of a user pool client
  • possibility of conflicting settings when configured in both resources

With that said, i've moved the "ui_customization" block out into it's own managed resource. I believe there, it'll be more apparent where the customization is applied and updates/deletes can occur without affecting the state of the existing user pool and/or user pool clients. Nonetheless, your contributions will all be merged in. Thank you again !

Output of acceptance tests:

--- PASS: TestAccAWSCognitoUserPoolUICustomization_AllClients_Disappears (26.41s)
--- PASS: TestAccAWSCognitoUserPoolUICustomization_Client_Disappears (32.43s)
--- PASS: TestAccAWSCognitoUserPoolUICustomization_Client_Image (48.04s)
--- PASS: TestAccAWSCognitoUserPoolUICustomization_UpdateAllToClient_CSS (48.08s)
--- PASS: TestAccAWSCognitoUserPoolUICustomization_UpdateClientToAll_CSS (48.33s)
--- PASS: TestAccAWSCognitoUserPoolUICustomization_AllClients_CSS (49.60s)
--- PASS: TestAccAWSCognitoUserPoolUICustomization_Client_CSS (52.42s)
--- PASS: TestAccAWSCognitoUserPoolUICustomization_AllClients_ImageFile (53.60s)
--- PASS: TestAccAWSCognitoUserPoolUICustomization_ClientAndAll_CSS (55.74s)
--- PASS: TestAccAWSCognitoUserPoolUICustomization_AllClients_CSSAndImageFile (64.21s)

@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. labels Feb 25, 2021
@anGie44 anGie44 added new-resource Introduces a new resource. and removed enhancement Requests to existing resources that expand the functionality or scope. labels Feb 25, 2021
@anGie44 anGie44 merged commit bb1478b into hashicorp:main Feb 25, 2021
@ghost
Copy link

ghost commented Feb 26, 2021

This has been released in version 3.30.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Mar 27, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. size/XXL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Cognito user pool client UI customizations