From 95f0f8b6d13559449ccd0bb82a11589911f161a8 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Thu, 13 Jul 2023 14:10:06 -0700 Subject: [PATCH] chore: revert "chore: pr feedback" This reverts commit 74cf0dc89533de82ac269292cddbc6e39c670354. --- .../auth-stack-transform.test.ts.snap | 2 + .../auth-cognito-stack-builder.ts | 3 ++ .../auth-add-all.migration.test.ts.snap | 20 ++++++++-- .../auth-oauth-lambda-migration.test.ts.snap | 40 +++++++++++++++---- 4 files changed, 53 insertions(+), 12 deletions(-) diff --git a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/__snapshots__/auth-stack-transform.test.ts.snap b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/__snapshots__/auth-stack-transform.test.ts.snap index 61042cc16a..ff5f58a8ae 100644 --- a/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/__snapshots__/auth-stack-transform.test.ts.snap +++ b/packages/amplify-category-auth/src/__tests__/provider-utils/awscloudformation/auth-stack-builder/__snapshots__/auth-stack-transform.test.ts.snap @@ -1614,6 +1614,7 @@ exports.handler = (event, context, callback) => { }, "UserPoolClient": { "DependsOn": [ + "HostedUIProvidersCustomResourceInputs", "UserPool", ], "Properties": { @@ -1715,6 +1716,7 @@ exports.handler = (event, context, callback) => { }, "UserPoolClientWeb": { "DependsOn": [ + "HostedUIProvidersCustomResourceInputs", "UserPool", ], "Properties": { diff --git a/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-cognito-stack-builder.ts b/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-cognito-stack-builder.ts index b134f67603..d167527a52 100644 --- a/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-cognito-stack-builder.ts +++ b/packages/amplify-category-auth/src/provider-utils/awscloudformation/auth-stack-builder/auth-cognito-stack-builder.ts @@ -787,6 +787,9 @@ export class AmplifyAuthCognitoStack extends cdk.Stack implements AmplifyAuthCog }, }); this.hostedUIProvidersCustomResourceInputs.node.addDependency(this.hostedUIProvidersCustomResourceLogPolicy); + // this can be removed when hostedUI Custom resource is removed + this.userPoolClient?.node.addDependency(this.hostedUIProvidersCustomResourceInputs); + this.userPoolClientWeb?.node.addDependency(this.hostedUIProvidersCustomResourceInputs); } /** diff --git a/packages/amplify-migration-tests/src/__tests__/migration_tests_v10/__snapshots__/auth-add-all.migration.test.ts.snap b/packages/amplify-migration-tests/src/__tests__/migration_tests_v10/__snapshots__/auth-add-all.migration.test.ts.snap index ccff52446c..7287bd0858 100644 --- a/packages/amplify-migration-tests/src/__tests__/migration_tests_v10/__snapshots__/auth-add-all.migration.test.ts.snap +++ b/packages/amplify-migration-tests/src/__tests__/migration_tests_v10/__snapshots__/auth-add-all.migration.test.ts.snap @@ -54,8 +54,14 @@ Resources │ └─ ["https://signin1/"] ├─ [+] LogoutURLs │ └─ ["https://signout1/"] - └─ [+] SupportedIdentityProviders - └─ ["Facebook","Google","LoginWithAmazon","SignInWithApple","COGNITO"] + ├─ [+] SupportedIdentityProviders + │ └─ ["Facebook","Google","LoginWithAmazon","SignInWithApple","COGNITO"] + └─ [~] DependsOn + └─ @@ -1,3 +1,4 @@ + [ ] [ + [+] "HostedUIProvidersCustomResourceInputs", + [ ] "UserPool" + [ ] ] [~] AWS::Cognito::UserPoolClient UserPoolClient ├─ [+] AllowedOAuthFlows │ └─ ["code"] @@ -67,8 +73,14 @@ Resources │ └─ ["https://signin1/"] ├─ [+] LogoutURLs │ └─ ["https://signout1/"] - └─ [+] SupportedIdentityProviders - └─ ["Facebook","Google","LoginWithAmazon","SignInWithApple","COGNITO"] + ├─ [+] SupportedIdentityProviders + │ └─ ["Facebook","Google","LoginWithAmazon","SignInWithApple","COGNITO"] + └─ [~] DependsOn + └─ @@ -1,3 +1,4 @@ + [ ] [ + [+] "HostedUIProvidersCustomResourceInputs", + [ ] "UserPool" + [ ] ] [~] AWS::IAM::Role UserPoolClientRole └─ [-] DependsOn └─ ["UserPoolClient"] diff --git a/packages/amplify-migration-tests/src/__tests__/migration_tests_v12/__snapshots__/auth-oauth-lambda-migration.test.ts.snap b/packages/amplify-migration-tests/src/__tests__/migration_tests_v12/__snapshots__/auth-oauth-lambda-migration.test.ts.snap index 6c2713945e..087d93db3f 100644 --- a/packages/amplify-migration-tests/src/__tests__/migration_tests_v12/__snapshots__/auth-oauth-lambda-migration.test.ts.snap +++ b/packages/amplify-migration-tests/src/__tests__/migration_tests_v12/__snapshots__/auth-oauth-lambda-migration.test.ts.snap @@ -41,8 +41,14 @@ Resources │ └─ ["https://sin1/","https://sin2/"] ├─ [+] LogoutURLs │ └─ ["https://sout1/","https://sout2/"] - └─ [+] SupportedIdentityProviders - └─ ["Facebook","Google","LoginWithAmazon","SignInWithApple","COGNITO"] + ├─ [+] SupportedIdentityProviders + │ └─ ["Facebook","Google","LoginWithAmazon","SignInWithApple","COGNITO"] + └─ [~] DependsOn + └─ @@ -1,3 +1,4 @@ + [ ] [ + [+] "HostedUIProvidersCustomResourceInputs", + [ ] "UserPool" + [ ] ] [~] AWS::Cognito::UserPoolClient UserPoolClient ├─ [+] AllowedOAuthFlows │ └─ ["code"] @@ -54,8 +60,14 @@ Resources │ └─ ["https://sin1/","https://sin2/"] ├─ [+] LogoutURLs │ └─ ["https://sout1/","https://sout2/"] - └─ [+] SupportedIdentityProviders - └─ ["Facebook","Google","LoginWithAmazon","SignInWithApple","COGNITO"] + ├─ [+] SupportedIdentityProviders + │ └─ ["Facebook","Google","LoginWithAmazon","SignInWithApple","COGNITO"] + └─ [~] DependsOn + └─ @@ -1,3 +1,4 @@ + [ ] [ + [+] "HostedUIProvidersCustomResourceInputs", + [ ] "UserPool" + [ ] ] [~] AWS::IAM::Role UserPoolClientRole └─ [-] DependsOn └─ ["UserPoolClient"] @@ -107,8 +119,14 @@ Resources │ └─ ["https://sin1/","https://sin2/"] ├─ [+] LogoutURLs │ └─ ["https://sout1/","https://sout2/"] - └─ [+] SupportedIdentityProviders - └─ ["Facebook","Google","LoginWithAmazon","SignInWithApple","COGNITO"] + ├─ [+] SupportedIdentityProviders + │ └─ ["Facebook","Google","LoginWithAmazon","SignInWithApple","COGNITO"] + └─ [~] DependsOn + └─ @@ -1,3 +1,4 @@ + [ ] [ + [+] "HostedUIProvidersCustomResourceInputs", + [ ] "UserPool" + [ ] ] [~] AWS::Cognito::UserPoolClient UserPoolClient ├─ [+] AllowedOAuthFlows │ └─ ["code"] @@ -120,8 +138,14 @@ Resources │ └─ ["https://sin1/","https://sin2/"] ├─ [+] LogoutURLs │ └─ ["https://sout1/","https://sout2/"] - └─ [+] SupportedIdentityProviders - └─ ["Facebook","Google","LoginWithAmazon","SignInWithApple","COGNITO"] + ├─ [+] SupportedIdentityProviders + │ └─ ["Facebook","Google","LoginWithAmazon","SignInWithApple","COGNITO"] + └─ [~] DependsOn + └─ @@ -1,3 +1,4 @@ + [ ] [ + [+] "HostedUIProvidersCustomResourceInputs", + [ ] "UserPool" + [ ] ] [~] AWS::IAM::Role UserPoolClientRole └─ [-] DependsOn └─ ["UserPoolClient"]