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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Cognito UserPool generates erroneous code #8657

Open
ralscha opened this issue Dec 24, 2021 · 0 comments
Open

Import Cognito UserPool generates erroneous code #8657

ralscha opened this issue Dec 24, 2021 · 0 comments
Labels
area/import kind/bug Some behavior is incorrect or out of spec

Comments

@ralscha
Copy link

ralscha commented Dec 24, 2021

Hello!

  • Vote on this issue by adding a 馃憤 reaction
  • To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already)

Issue details

Importing a AWS Cognito UserPool with pulumi import generates code that has syntax errors. The import into the state works without any problems.

Steps to reproduce

  1. Create a AWS Cognito Userpool manually with the AWS web console. Make sure to select at least one account recovery option
  2. Import with: pulumi import aws:cognito/userPool:UserPool pool <id>

Pulumi shows code that has two errors

Actual:

                _, err := cognito.NewUserPool(ctx, "pool", &cognito.UserPoolArgs{                                          
                        AccountRecoverySetting: &cognito.UserPoolAccountRecoverySettingArgs{                               
                                RecoveryMechanisms: []cognito.UserPoolAccountRecoverySettingRecoveryMechanismArgs{         
                                        &cognito.UserPoolAccountRecoverySettingRecoveryMechanismArgs{                      
                                                Name:     pulumi.String("verified_email"),                                 
                                                Priority: pulumi.Int(0),                                                   
                                        },                                                                                 
                                },                                                                                         
                        },     

RecoveryMechanisms: []cognito.UserPoolAccountRecoverySettingRecoveryMechanismArgs is wrong, this should be RecoveryMechanisms: &cognito.UserPoolAccountRecoverySettingRecoveryMechanismArray.

Priority has a minimum value of 1 and can't be 0.

Expected:

	_, err := cognito.NewUserPool(ctx, "pool", &cognito.UserPoolArgs{
		AccountRecoverySetting: &cognito.UserPoolAccountRecoverySettingArgs{
			RecoveryMechanisms: &cognito.UserPoolAccountRecoverySettingRecoveryMechanismArray{
				&cognito.UserPoolAccountRecoverySettingRecoveryMechanismArgs{
					Name:     pulumi.String("verified_email"),
					Priority: pulumi.Int(1),
				},
			},
		},
@stack72 stack72 transferred this issue from pulumi/pulumi-aws Dec 30, 2021
@stack72 stack72 added area/import kind/bug Some behavior is incorrect or out of spec labels Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/import kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants