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

resource/aws_cognito_user_pool: Trim custom: prefix of developer_only_attribute = false schema attributes #4041

Merged
merged 1 commit into from
Apr 5, 2018

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Apr 4, 2018

Closes #4036

Previously before code change:

make testacc TEST=./aws TESTARGS='-run=TestAccAWSCognitoUserPool_withSchemaAttributes'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSCognitoUserPool_withSchemaAttributes -timeout 120m
=== RUN   TestAccAWSCognitoUserPool_withSchemaAttributes
--- FAIL: TestAccAWSCognitoUserPool_withSchemaAttributes (21.38s)
	testing.go:518: Step 1 error: After applying this step, the plan was not empty:

		DIFF:

		DESTROY/CREATE: aws_cognito_user_pool.main
		  admin_create_user_config.#:                                  "1" => "<computed>"
		  arn:                                                         "arn:aws:cognito-idp:us-west-2:187416307283:userpool/us-west-2_b79eqbrrp" => "<computed>"
		  creation_date:                                               "2018-04-04T15:24:46Z" => "<computed>"
		  email_verification_message:                                  "" => "<computed>"
		  email_verification_subject:                                  "" => "<computed>"
		  lambda_config.#:                                             "0" => "<computed>"
		  last_modified_date:                                          "2018-04-04T15:24:46Z" => "<computed>"
		  mfa_configuration:                                           "OFF" => "OFF"
		  name:                                                        "1laln" => "1laln"
		  password_policy.#:                                           "1" => "<computed>"
		  schema.#:                                                    "3" => "3"
		  schema.2078884933.attribute_data_type:                       "String" => "String"
		  schema.2078884933.developer_only_attribute:                  "false" => "false"
		  schema.2078884933.mutable:                                   "false" => "false"
		  schema.2078884933.name:                                      "email" => "email"
		  schema.2078884933.number_attribute_constraints.#:            "0" => "0"
		  schema.2078884933.required:                                  "true" => "true"
		  schema.2078884933.string_attribute_constraints.#:            "1" => "1"
		  schema.2078884933.string_attribute_constraints.0.max_length: "15" => "15"
		  schema.2078884933.string_attribute_constraints.0.min_length: "7" => "7"
		  schema.2410726534.attribute_data_type:                       "Number" => "" (forces new resource)
		  schema.2410726534.developer_only_attribute:                  "false" => "false"
		  schema.2410726534.mutable:                                   "true" => "false" (forces new resource)
		  schema.2410726534.name:                                      "custom:mynondevnumber" => "" (forces new resource)
		  schema.2410726534.number_attribute_constraints.#:            "1" => "0" (forces new resource)
		  schema.2410726534.number_attribute_constraints.0.max_value:  "6" => "" (forces new resource)
		  schema.2410726534.number_attribute_constraints.0.min_value:  "2" => "" (forces new resource)
		  schema.2410726534.required:                                  "false" => "false"
		  schema.2410726534.string_attribute_constraints.#:            "0" => "0"
		  schema.2718111653.attribute_data_type:                       "Number" => "Number"
		  schema.2718111653.developer_only_attribute:                  "true" => "true"
		  schema.2718111653.mutable:                                   "true" => "true"
		  schema.2718111653.name:                                      "mynumber" => "mynumber"
		  schema.2718111653.number_attribute_constraints.#:            "1" => "1"
		  schema.2718111653.number_attribute_constraints.0.max_value:  "6" => "6"
		  schema.2718111653.number_attribute_constraints.0.min_value:  "2" => "2"
		  schema.2718111653.required:                                  "false" => "false"
		  schema.2718111653.string_attribute_constraints.#:            "0" => "0"
		  schema.2753746449.attribute_data_type:                       "" => "Number" (forces new resource)
		  schema.2753746449.developer_only_attribute:                  "" => "false" (forces new resource)
		  schema.2753746449.mutable:                                   "" => "true" (forces new resource)
		  schema.2753746449.name:                                      "" => "mynondevnumber" (forces new resource)
		  schema.2753746449.number_attribute_constraints.#:            "" => "1" (forces new resource)
		  schema.2753746449.number_attribute_constraints.0.max_value:  "" => "6" (forces new resource)
		  schema.2753746449.number_attribute_constraints.0.min_value:  "" => "2" (forces new resource)
		  schema.2753746449.required:                                  "" => "false" (forces new resource)
		  schema.2753746449.string_attribute_constraints.#:            "" => "0"
		  verification_message_template.#:                             "1" => "<computed>"

After code change:

19 tests passed (all tests)
=== RUN   TestAccAWSCognitoUserPoolClient_allFields
--- PASS: TestAccAWSCognitoUserPoolClient_allFields (10.88s)
=== RUN   TestAccAWSCognitoUserPool_importBasic
--- PASS: TestAccAWSCognitoUserPool_importBasic (13.97s)
=== RUN   TestAccAWSCognitoUserPool_withEmailVerificationMessage
--- PASS: TestAccAWSCognitoUserPool_withEmailVerificationMessage (24.21s)
=== RUN   TestAccAWSCognitoUserPoolClient_basic
--- PASS: TestAccAWSCognitoUserPoolClient_basic (29.33s)
=== RUN   TestAccAWSCognitoUserPool_withSmsVerificationMessage
--- PASS: TestAccAWSCognitoUserPool_withSmsVerificationMessage (29.84s)
=== RUN   TestAccAWSCognitoUserPoolDomain_import
--- PASS: TestAccAWSCognitoUserPoolDomain_import (30.71s)
=== RUN   TestAccAWSCognitoUserPool_withSmsConfiguration
--- PASS: TestAccAWSCognitoUserPool_withSmsConfiguration (32.50s)
=== RUN   TestAccAWSCognitoUserPool_withTags
--- PASS: TestAccAWSCognitoUserPool_withTags (33.41s)
=== RUN   TestAccAWSCognitoUserPool_withEmailConfiguration
--- PASS: TestAccAWSCognitoUserPool_withEmailConfiguration (33.65s)
=== RUN   TestAccAWSCognitoUserPool_basic
--- PASS: TestAccAWSCognitoUserPool_basic (36.77s)
=== RUN   TestAccAWSCognitoUserPool_withDeviceConfiguration
--- PASS: TestAccAWSCognitoUserPool_withDeviceConfiguration (37.25s)
=== RUN   TestAccAWSCognitoUserPool_withVerificationMessageTemplate
--- PASS: TestAccAWSCognitoUserPool_withVerificationMessageTemplate (37.49s)
=== RUN   TestAccAWSCognitoUserPool_withAliasAttributes
--- PASS: TestAccAWSCognitoUserPool_withAliasAttributes (37.47s)
=== RUN   TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration
--- PASS: TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration (40.29s)
=== RUN   TestAccAWSCognitoUserPoolDomain_basic
--- PASS: TestAccAWSCognitoUserPoolDomain_basic (40.40s)
=== RUN   TestAccAWSCognitoUserPool_withSchemaAttributes
--- PASS: TestAccAWSCognitoUserPool_withSchemaAttributes (40.65s)
=== RUN   TestAccAWSCognitoUserPool_withPasswordPolicy
--- PASS: TestAccAWSCognitoUserPool_withPasswordPolicy (44.58s)
=== RUN   TestAccAWSCognitoUserPool_withLambdaConfig
--- PASS: TestAccAWSCognitoUserPool_withLambdaConfig (45.25s)
=== RUN   TestAccAWSCognitoUserPool_withSmsConfigurationUpdated
--- PASS: TestAccAWSCognitoUserPool_withSmsConfigurationUpdated (63.51s)

@bflad bflad added bug Addresses a defect in current functionality. service/cognito labels Apr 4, 2018
@bflad bflad added this to the v1.14.0 milestone Apr 4, 2018
@bflad bflad requested a review from a team April 4, 2018 15:32
@ghost ghost added the size/S Managed by automation to categorize the size of a PR. label Apr 4, 2018
@Puneeth-n
Copy link
Contributor

So to continue the conversation from #3405 (comment), this PR is supposed to fix the issue I am having as mentioned in #3405 (comment) ?

@bflad
Copy link
Contributor Author

bflad commented Apr 5, 2018

@Puneeth-n correct

@Puneeth-n
Copy link
Contributor

@bflad any idea what happened to the patch releases x.x.1 x.x.2 x.x.3 Aren't we doing it anymore?

@bflad
Copy link
Contributor Author

bflad commented Apr 5, 2018

We only release patch versions if there are only bug fixes. New enhancements/resources automatically cause a minor version bump. We don't have any bug fix only releases planned right now.

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

LGTM

@Puneeth-n
Copy link
Contributor

@bflad This is a bug fix :) If I hadn't got the prevent_destroy flag, all our uses would have vanished in thin air! 😅

@bflad bflad merged commit 45ead8d into master Apr 5, 2018
@bflad bflad deleted the b-aws_cognito_user_pool-non-dev-custom-schema branch April 5, 2018 16:48
bflad added a commit that referenced this pull request Apr 5, 2018
@JBirdVegas
Copy link
Contributor

JBirdVegas commented Apr 5, 2018

@Puneeth-n luckily we only lost our dev users but we are blocked from upper environments till this patch goes out. Only other option is to create all the resources by hand and not let terraform manage the user pool.

Lord help the dev that finds this bug on their prod account.

@Puneeth-n
Copy link
Contributor

@JBirdVegas I can imagine my situation had I not put that prevent_destroy flag. Luckily I treated this as a database. We have 5 environments. Creating each by hand is a pain. Now we are in a situation wherein creating the cognito pool with v1.13.0 plugin is futile because the pool will be destroyed and created (again) in v1.14.0 because of this merge.

@bflad
Copy link
Contributor Author

bflad commented Apr 6, 2018

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

@ghost
Copy link

ghost commented Apr 6, 2020

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 and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. size/S Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_cognito_user_pool recreate resource if custom attributes are defined
4 participants