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

New Resource: aws_cognito_user_pool #1419

Merged
merged 30 commits into from Nov 16, 2017

Conversation

Projects
None yet
7 participants
@Ninir
Collaborator

Ninir commented Aug 15, 2017

Description

This implements Cognito User pool with original work from @Harrison-Miller.
This work is missing a few attributes & options that will be added ASAP.

API Documentation

Test

make testacc TEST=./aws TESTARGS='-run=TestAccAWSCognitoUserPool_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSCognitoUserPool_ -timeout 120m
=== RUN   TestAccAWSCognitoUserPool_importBasic
--- PASS: TestAccAWSCognitoUserPool_importBasic (17.59s)
=== RUN   TestAccAWSCognitoUserPool_basic
--- PASS: TestAccAWSCognitoUserPool_basic (14.16s)
=== RUN   TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration
--- PASS: TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration (24.01s)
=== RUN   TestAccAWSCognitoUserPool_withDeviceConfiguration
--- PASS: TestAccAWSCognitoUserPool_withDeviceConfiguration (24.74s)
=== RUN   TestAccAWSCognitoUserPool_withEmailVerificationMessage
--- PASS: TestAccAWSCognitoUserPool_withEmailVerificationMessage (23.63s)
=== RUN   TestAccAWSCognitoUserPool_withSmsVerificationMessage
--- PASS: TestAccAWSCognitoUserPool_withSmsVerificationMessage (22.74s)
=== RUN   TestAccAWSCognitoUserPool_withEmailConfiguration
--- PASS: TestAccAWSCognitoUserPool_withEmailConfiguration (23.38s)
=== RUN   TestAccAWSCognitoUserPool_withSmsConfiguration
--- PASS: TestAccAWSCognitoUserPool_withSmsConfiguration (34.88s)
=== RUN   TestAccAWSCognitoUserPool_withSmsConfigurationUpdated
--- PASS: TestAccAWSCognitoUserPool_withSmsConfigurationUpdated (41.22s)
=== RUN   TestAccAWSCognitoUserPool_withTags
--- PASS: TestAccAWSCognitoUserPool_withTags (23.02s)
=== RUN   TestAccAWSCognitoUserPool_withAliasAttributes
--- PASS: TestAccAWSCognitoUserPool_withAliasAttributes (25.68s)
=== RUN   TestAccAWSCognitoUserPool_withPasswordPolicy
--- PASS: TestAccAWSCognitoUserPool_withPasswordPolicy (23.89s)
=== RUN   TestAccAWSCognitoUserPool_withLambdaConfig
--- PASS: TestAccAWSCognitoUserPool_withLambdaConfig (45.36s)
=== RUN   TestAccAWSCognitoUserPool_withSchemaAttributes
--- PASS: TestAccAWSCognitoUserPool_withSchemaAttributes (24.43s)
=== RUN   TestAccAWSCognitoUserPool_withVerificationMessageTemplate
--- PASS: TestAccAWSCognitoUserPool_withVerificationMessageTemplate (27.58s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	396.355s

TODOs

  • Handle MFA
  • Handle Admin options
  • Handle Admin acc tests
  • Handle Email Configurations
  • Handle Email Configurations acc tests
  • Handle Device Configuration
  • Handle Device Configuration acc tests
  • Handle SMS Configurations
  • Handle SMS Configurations acc tests
  • Handle Schema attributes
  • Handle Schema attributes acc tests
  • Handle Password policy
  • Handle Password policy acc tests
  • Handle Lambda Config
  • Handle Lambda Config acc tests
  • Handle Verification Message Template
  • Handle Verification Message Template acc tests
  • Handle Username attributes
  • Improve the documentation
  • Handle Import
@jtopper

This comment has been minimized.

Show comment
Hide comment
@jtopper

jtopper Aug 15, 2017

In case you need any encouragement @Ninir, we came up against this missing feature this week too, and we're keen to see it finished and merged :)

jtopper commented Aug 15, 2017

In case you need any encouragement @Ninir, we came up against this missing feature this week too, and we're keen to see it finished and merged :)

@Ninir

This comment has been minimized.

Show comment
Hide comment
@Ninir

Ninir Aug 16, 2017

Collaborator

Thanks @jtopper

Will let you know on how it goes!
Trying to implement every available option, documentation, validating... lot of work on that :D

Collaborator

Ninir commented Aug 16, 2017

Thanks @jtopper

Will let you know on how it goes!
Trying to implement every available option, documentation, validating... lot of work on that :D

@psyvision

This comment has been minimized.

Show comment
Hide comment
@psyvision
Contributor

psyvision commented Oct 1, 2017

@catsby

Hey @Ninir how do you feel about this PR?

@psyvision

This comment has been minimized.

Show comment
Hide comment
@psyvision

psyvision Oct 2, 2017

Contributor

I've started work on user pool clients in the following fork. I need to add some unit tests and will then submit a pull request: https://github.com/psyvision/terraform-provider-aws

Contributor

psyvision commented Oct 2, 2017

I've started work on user pool clients in the following fork. I need to add some unit tests and will then submit a pull request: https://github.com/psyvision/terraform-provider-aws

@dave-lyric

This comment has been minimized.

Show comment
Hide comment
@dave-lyric

dave-lyric Nov 7, 2017

Does this feature support import?

dave-lyric commented Nov 7, 2017

Does this feature support import?

@Ninir

This comment has been minimized.

Show comment
Hide comment
@Ninir

Ninir Nov 13, 2017

Collaborator

Hi @dave-lyric

It does support it now :)

For any folk around here: I still need to manage AdminCreateUserConfig tests & play a bit with all the edge use-cases... but it's almost mergeable :)

Thanks for waiting!

Collaborator

Ninir commented Nov 13, 2017

Hi @dave-lyric

It does support it now :)

For any folk around here: I still need to manage AdminCreateUserConfig tests & play a bit with all the edge use-cases... but it's almost mergeable :)

Thanks for waiting!

@radeksimko radeksimko added the size/XXL label Nov 15, 2017

@radeksimko radeksimko changed the title from [WIP] Added Cognito User Pool to [WIP] New Resource: aws_cognito_user_pool Nov 15, 2017

@radeksimko

I left you a bunch of nitpicks around error handling and a few more important questions in the schema.

Overall this is looking really good, huge respect for getting it done! 👍

Show outdated Hide outdated aws/resource_aws_cognito_user_pool.go
"admin_create_user_config": {
Type: schema.TypeList,
Optional: true,
Computed: true,

This comment has been minimized.

@radeksimko

radeksimko Nov 15, 2017

Contributor

Just out of curiosity what's the value that comes back from the API if not defined?

@radeksimko

radeksimko Nov 15, 2017

Contributor

Just out of curiosity what's the value that comes back from the API if not defined?

This comment has been minimized.

@Ninir

Ninir Nov 16, 2017

Collaborator

The structure gets back with children having default values:

"AdminCreateUserConfig": {
            "UnusedAccountValidityDays": 7, 
            "AllowAdminCreateUserOnly": false
        }, 
@Ninir

Ninir Nov 16, 2017

Collaborator

The structure gets back with children having default values:

"AdminCreateUserConfig": {
            "UnusedAccountValidityDays": 7, 
            "AllowAdminCreateUserOnly": false
        }, 

This comment has been minimized.

@radeksimko

radeksimko Nov 16, 2017

Contributor

Fair enough - as long as Computed is justified 🤷‍♂️

@radeksimko

radeksimko Nov 16, 2017

Contributor

Fair enough - as long as Computed is justified 🤷‍♂️

Show outdated Hide outdated aws/resource_aws_cognito_user_pool.go
Show outdated Hide outdated aws/resource_aws_cognito_user_pool.go
Show outdated Hide outdated aws/resource_aws_cognito_user_pool.go
Show outdated Hide outdated aws/structure.go
Show outdated Hide outdated aws/structure.go
Show outdated Hide outdated aws/structure.go
es = append(es, fmt.Errorf("%q cannot be longer than 2000 characters", k))
}
if !regexp.MustCompile(`[\p{L}\p{M}\p{S}\p{N}\p{P}\s*]*\{####\}[\p{L}\p{M}\p{S}\p{N}\p{P}\s*]*`).MatchString(value) {

This comment has been minimized.

@radeksimko

radeksimko Nov 15, 2017

Contributor

🙈 😵 😅

@radeksimko

radeksimko Nov 15, 2017

Contributor

🙈 😵 😅

Show outdated Hide outdated website/docs/r/cognito_user_pool.markdown

@radeksimko radeksimko changed the title from [WIP] New Resource: aws_cognito_user_pool to New Resource: aws_cognito_user_pool Nov 15, 2017

@Ninir

This comment has been minimized.

Show comment
Hide comment
@Ninir

Ninir Nov 16, 2017

Collaborator

Here we go!

make testacc TEST=./aws TESTARGS='-run=TestAccAWSCognitoUserPool_'                               
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSCognitoUserPool_ -timeout 120m
=== RUN   TestAccAWSCognitoUserPool_importBasic
--- PASS: TestAccAWSCognitoUserPool_importBasic (18.32s)
=== RUN   TestAccAWSCognitoUserPool_basic
--- PASS: TestAccAWSCognitoUserPool_basic (15.86s)
=== RUN   TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration
--- PASS: TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration (27.09s)
=== RUN   TestAccAWSCognitoUserPool_withDeviceConfiguration
--- PASS: TestAccAWSCognitoUserPool_withDeviceConfiguration (27.78s)
=== RUN   TestAccAWSCognitoUserPool_withEmailVerificationMessage
--- PASS: TestAccAWSCognitoUserPool_withEmailVerificationMessage (25.44s)
=== RUN   TestAccAWSCognitoUserPool_withSmsVerificationMessage
--- PASS: TestAccAWSCognitoUserPool_withSmsVerificationMessage (25.97s)
=== RUN   TestAccAWSCognitoUserPool_withEmailConfiguration
--- PASS: TestAccAWSCognitoUserPool_withEmailConfiguration (26.41s)
=== RUN   TestAccAWSCognitoUserPool_withSmsConfiguration
--- PASS: TestAccAWSCognitoUserPool_withSmsConfiguration (35.05s)
=== RUN   TestAccAWSCognitoUserPool_withSmsConfigurationUpdated
--- PASS: TestAccAWSCognitoUserPool_withSmsConfigurationUpdated (44.02s)
=== RUN   TestAccAWSCognitoUserPool_withTags
--- PASS: TestAccAWSCognitoUserPool_withTags (27.75s)
=== RUN   TestAccAWSCognitoUserPool_withAliasAttributes
--- PASS: TestAccAWSCognitoUserPool_withAliasAttributes (27.68s)
=== RUN   TestAccAWSCognitoUserPool_withPasswordPolicy
--- PASS: TestAccAWSCognitoUserPool_withPasswordPolicy (26.64s)
=== RUN   TestAccAWSCognitoUserPool_withLambdaConfig
--- PASS: TestAccAWSCognitoUserPool_withLambdaConfig (48.30s)
=== RUN   TestAccAWSCognitoUserPool_withSchemaAttributes
--- PASS: TestAccAWSCognitoUserPool_withSchemaAttributes (25.72s)
=== RUN   TestAccAWSCognitoUserPool_withVerificationMessageTemplate
--- PASS: TestAccAWSCognitoUserPool_withVerificationMessageTemplate (30.88s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	432.959s
Collaborator

Ninir commented Nov 16, 2017

Here we go!

make testacc TEST=./aws TESTARGS='-run=TestAccAWSCognitoUserPool_'                               
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSCognitoUserPool_ -timeout 120m
=== RUN   TestAccAWSCognitoUserPool_importBasic
--- PASS: TestAccAWSCognitoUserPool_importBasic (18.32s)
=== RUN   TestAccAWSCognitoUserPool_basic
--- PASS: TestAccAWSCognitoUserPool_basic (15.86s)
=== RUN   TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration
--- PASS: TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration (27.09s)
=== RUN   TestAccAWSCognitoUserPool_withDeviceConfiguration
--- PASS: TestAccAWSCognitoUserPool_withDeviceConfiguration (27.78s)
=== RUN   TestAccAWSCognitoUserPool_withEmailVerificationMessage
--- PASS: TestAccAWSCognitoUserPool_withEmailVerificationMessage (25.44s)
=== RUN   TestAccAWSCognitoUserPool_withSmsVerificationMessage
--- PASS: TestAccAWSCognitoUserPool_withSmsVerificationMessage (25.97s)
=== RUN   TestAccAWSCognitoUserPool_withEmailConfiguration
--- PASS: TestAccAWSCognitoUserPool_withEmailConfiguration (26.41s)
=== RUN   TestAccAWSCognitoUserPool_withSmsConfiguration
--- PASS: TestAccAWSCognitoUserPool_withSmsConfiguration (35.05s)
=== RUN   TestAccAWSCognitoUserPool_withSmsConfigurationUpdated
--- PASS: TestAccAWSCognitoUserPool_withSmsConfigurationUpdated (44.02s)
=== RUN   TestAccAWSCognitoUserPool_withTags
--- PASS: TestAccAWSCognitoUserPool_withTags (27.75s)
=== RUN   TestAccAWSCognitoUserPool_withAliasAttributes
--- PASS: TestAccAWSCognitoUserPool_withAliasAttributes (27.68s)
=== RUN   TestAccAWSCognitoUserPool_withPasswordPolicy
--- PASS: TestAccAWSCognitoUserPool_withPasswordPolicy (26.64s)
=== RUN   TestAccAWSCognitoUserPool_withLambdaConfig
--- PASS: TestAccAWSCognitoUserPool_withLambdaConfig (48.30s)
=== RUN   TestAccAWSCognitoUserPool_withSchemaAttributes
--- PASS: TestAccAWSCognitoUserPool_withSchemaAttributes (25.72s)
=== RUN   TestAccAWSCognitoUserPool_withVerificationMessageTemplate
--- PASS: TestAccAWSCognitoUserPool_withVerificationMessageTemplate (30.88s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	432.959s

@Ninir Ninir merged commit d6d2147 into terraform-providers:master Nov 16, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Ninir Ninir deleted the Ninir:f-cognito-identity-provider-user-pool branch Nov 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment