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 11b3b1b055e..e6a08fcc6ab 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 @@ -2,7 +2,7 @@ exports[`amplify migration test auth ...should add auth with max options and work on the latest version 1`] = ` "Resources -[~] AWS::Lambda::Function RoleMapFunction +[~] AWS::Lambda::Function RoleMapFunction └─ [~] Runtime ├─ [-] nodejs14.x └─ [+] nodejs16.x @@ -43,7 +43,7 @@ Resources [-] AWS::IAM::Policy OAuthCustomResourcePolicy destroy [-] AWS::IAM::Policy OAuthCustomResourceLogPolicy destroy [-] Custom::LambdaCallout OAuthCustomResourceInputs destroy -[~] AWS::Cognito::UserPoolClient UserPoolClientWeb +[~] AWS::Cognito::UserPoolClient UserPoolClientWeb ├─ [+] AllowedOAuthFlows │ └─ ["code"] ├─ [+] AllowedOAuthFlowsUserPoolClient @@ -62,7 +62,7 @@ Resources [+] "HostedUIProvidersCustomResourceInputs", [ ] "UserPool" [ ] ] -[~] AWS::Cognito::UserPoolClient UserPoolClient +[~] AWS::Cognito::UserPoolClient UserPoolClient ├─ [+] AllowedOAuthFlows │ └─ ["code"] ├─ [+] AllowedOAuthFlowsUserPoolClient @@ -81,10 +81,10 @@ Resources [+] "HostedUIProvidersCustomResourceInputs", [ ] "UserPool" [ ] ] -[~] AWS::IAM::Role UserPoolClientRole +[~] AWS::IAM::Role UserPoolClientRole └─ [-] DependsOn └─ ["UserPoolClient"] -[~] AWS::Lambda::Function HostedUICustomResource +[~] AWS::Lambda::Function HostedUICustomResource ├─ [~] Code │ └─ [~] .ZipFile: │ ├─ [-] const response = require('cfn-response'); @@ -132,7 +132,9 @@ exports.handler = (event, context, callback) => { .promise() .then(result => { if (inputDomainName) { - if (result.UserPool.Domain !== inputDomainName) { + if (result.UserPool.Domain === inputDomainName) { + return; + } else { if (!result.UserPool.Domain) { return checkDomainAvailability(inputDomainName).then(isDomainAvailable => { if (isDomainAvailable) { @@ -244,8 +246,8 @@ async function handleEvent(event, context) { └─ [~] Runtime ├─ [-] nodejs14.x - └─ [+] nodejs18.x -[~] AWS::Lambda::Function HostedUIProvidersCustomResource + └─ [+] nodejs16.x +[~] AWS::Lambda::Function HostedUIProvidersCustomResource ├─ [~] Code │ └─ [~] .ZipFile: │ ├─ [-] const response = require('cfn-response'); @@ -461,7 +463,7 @@ exports.handler = (event, context, callback) => { └─ [~] Runtime ├─ [-] nodejs14.x └─ [+] nodejs16.x -[~] AWS::Cognito::IdentityPool IdentityPool +[~] AWS::Cognito::IdentityPool IdentityPool └─ [-] DependsOn └─ ["UserPoolClientInputs"] 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 5bc24d1358f..e8d44474b6e 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 @@ -30,7 +30,7 @@ Resources [-] AWS::IAM::Policy OAuthCustomResourcePolicy destroy [-] AWS::IAM::Policy OAuthCustomResourceLogPolicy destroy [-] Custom::LambdaCallout OAuthCustomResourceInputs destroy -[~] AWS::Cognito::UserPoolClient UserPoolClientWeb +[~] AWS::Cognito::UserPoolClient UserPoolClientWeb ├─ [+] AllowedOAuthFlows │ └─ ["code"] ├─ [+] AllowedOAuthFlowsUserPoolClient @@ -49,7 +49,7 @@ Resources [+] "HostedUIProvidersCustomResourceInputs", [ ] "UserPool" [ ] ] -[~] AWS::Cognito::UserPoolClient UserPoolClient +[~] AWS::Cognito::UserPoolClient UserPoolClient ├─ [+] AllowedOAuthFlows │ └─ ["code"] ├─ [+] AllowedOAuthFlowsUserPoolClient @@ -68,13 +68,13 @@ Resources [+] "HostedUIProvidersCustomResourceInputs", [ ] "UserPool" [ ] ] -[~] AWS::IAM::Role UserPoolClientRole +[~] AWS::IAM::Role UserPoolClientRole └─ [-] DependsOn └─ ["UserPoolClient"] -[~] AWS::Lambda::Function HostedUICustomResource - ├─ [~] Code - │ └─ [~] .ZipFile: - │ ├─ [-] const response = require('cfn-response'); +[~] AWS::Lambda::Function HostedUICustomResource + └─ [~] Code + └─ [~] .ZipFile: + ├─ [-] const response = require('cfn-response'); const aws = require('aws-sdk'); const identity = new aws.CognitoIdentityServiceProvider(); exports.handler = (event, context, callback) => { @@ -119,7 +119,9 @@ exports.handler = (event, context, callback) => { .promise() .then((result) => { if (inputDomainName) { - if (result.UserPool.Domain !== inputDomainName) { + if (result.UserPool.Domain === inputDomainName) { + return; + } else { if (!result.UserPool.Domain) { return checkDomainAvailability(inputDomainName).then((isDomainAvailable) => { if (isDomainAvailable) { @@ -154,7 +156,7 @@ exports.handler = (event, context, callback) => { } }; - │ └─ [+] const response = require('cfn-response'); + └─ [+] const response = require('cfn-response'); const aws = require('aws-sdk'); const identity = new aws.CognitoIdentityServiceProvider(); @@ -229,9 +231,6 @@ async function handleEvent(event, context) { } } - └─ [~] Runtime - ├─ [-] nodejs16.x - └─ [+] nodejs18.x Outputs [-] Output AppClientSecret: {"Value":{"Fn::GetAtt":["UserPoolClientInputs","appSecret"]},"Condition":"ShouldOutputAppClientSecrets"} @@ -269,7 +268,7 @@ Resources [-] AWS::IAM::Policy OAuthCustomResourcePolicy destroy [-] AWS::IAM::Policy OAuthCustomResourceLogPolicy destroy [-] Custom::LambdaCallout OAuthCustomResourceInputs destroy -[~] AWS::Cognito::UserPoolClient UserPoolClientWeb +[~] AWS::Cognito::UserPoolClient UserPoolClientWeb ├─ [+] AllowedOAuthFlows │ └─ ["code"] ├─ [+] AllowedOAuthFlowsUserPoolClient @@ -288,7 +287,7 @@ Resources [+] "HostedUIProvidersCustomResourceInputs", [ ] "UserPool" [ ] ] -[~] AWS::Cognito::UserPoolClient UserPoolClient +[~] AWS::Cognito::UserPoolClient UserPoolClient ├─ [+] AllowedOAuthFlows │ └─ ["code"] ├─ [+] AllowedOAuthFlowsUserPoolClient @@ -307,13 +306,13 @@ Resources [+] "HostedUIProvidersCustomResourceInputs", [ ] "UserPool" [ ] ] -[~] AWS::IAM::Role UserPoolClientRole +[~] AWS::IAM::Role UserPoolClientRole └─ [-] DependsOn └─ ["UserPoolClient"] -[~] AWS::Lambda::Function HostedUICustomResource - ├─ [~] Code - │ └─ [~] .ZipFile: - │ ├─ [-] const response = require('cfn-response'); +[~] AWS::Lambda::Function HostedUICustomResource + └─ [~] Code + └─ [~] .ZipFile: + ├─ [-] const response = require('cfn-response'); const aws = require('aws-sdk'); const identity = new aws.CognitoIdentityServiceProvider(); exports.handler = (event, context, callback) => { @@ -358,7 +357,9 @@ exports.handler = (event, context, callback) => { .promise() .then((result) => { if (inputDomainName) { - if (result.UserPool.Domain !== inputDomainName) { + if (result.UserPool.Domain === inputDomainName) { + return; + } else { if (!result.UserPool.Domain) { return checkDomainAvailability(inputDomainName).then((isDomainAvailable) => { if (isDomainAvailable) { @@ -393,7 +394,7 @@ exports.handler = (event, context, callback) => { } }; - │ └─ [+] const response = require('cfn-response'); + └─ [+] const response = require('cfn-response'); const aws = require('aws-sdk'); const identity = new aws.CognitoIdentityServiceProvider(); @@ -468,9 +469,6 @@ async function handleEvent(event, context) { } } - └─ [~] Runtime - ├─ [-] nodejs16.x - └─ [+] nodejs18.x Outputs [-] Output AppClientSecret: {"Value":{"Fn::GetAtt":["UserPoolClientInputs","appSecret"]},"Condition":"ShouldOutputAppClientSecrets"}