From df65dad041a6b1c1eba5ae5c1d0118a04f9affaf Mon Sep 17 00:00:00 2001 From: Roman Valls Guimera Date: Wed, 8 Apr 2020 12:55:45 +1000 Subject: [PATCH] Bumping up the CDK exposes a couple more methods that were missing from CDK 1.26.0, but apparently there are a few rough corners to fix still according to CDK tracking issue https://github.com/aws/aws-cdk/issues/6765 --- build.gradle | 6 +++--- .../org/umccr/awscdk/IGVAmazonCognitoStack.java | 15 +++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 8a1dd594cf..32d467c93d 100644 --- a/build.gradle +++ b/build.gradle @@ -137,9 +137,9 @@ dependencies { [group: 'software.amazon.awssdk', name: 's3', version: '2.8.5'], // Amazon server side dependencies (used to deploy the serverless Amazon IGV backend) - [group: 'software.amazon.awscdk', name: 'core', version: '1.26.0'], - [group: 'software.amazon.awscdk', name: 'cognito', version: '1.26.0'], - [group: 'software.amazon.awscdk', name: 's3', version: '1.26.0'], + [group: 'software.amazon.awscdk', name: 'core', version: '1.31.0'], + [group: 'software.amazon.awscdk', name: 'cognito', version: '1.31.0'], + [group: 'software.amazon.awscdk', name: 's3', version: '1.31.0'], ) diff --git a/src/main/java/org/umccr/awscdk/IGVAmazonCognitoStack.java b/src/main/java/org/umccr/awscdk/IGVAmazonCognitoStack.java index 01e1f8030f..88f6e955b4 100644 --- a/src/main/java/org/umccr/awscdk/IGVAmazonCognitoStack.java +++ b/src/main/java/org/umccr/awscdk/IGVAmazonCognitoStack.java @@ -8,12 +8,10 @@ import software.amazon.awscdk.core.Stack; import software.amazon.awscdk.core.StackProps; -import software.amazon.awscdk.services.cognito.UserPool; -import software.amazon.awscdk.services.cognito.CfnUserPoolIdentityProvider; -import software.amazon.awscdk.services.cognito.UserPoolClient; -import software.amazon.awscdk.services.cognito.CfnIdentityPool; -import software.amazon.awscdk.services.cognito.CfnUserPoolDomain; +import software.amazon.awscdk.services.cognito.*; +import software.amazon.awscdk.services.cognito.CfnUserPoolProps; import software.amazon.awscdk.services.s3.Bucket; +import software.amazon.awssdk.services.s3.model.MFADelete; import java.util.HashMap; import java.util.List; @@ -65,11 +63,14 @@ public IGVAmazonCognitoStack(final Construct parent, final String id, final Stac final UserPool userPool = UserPool.Builder.create(this, "IGV User Pool") .selfSignUpEnabled(false) + .mfa(Mfa.OFF) .build(); + + final UserPoolClient userPoolClient = UserPoolClient.Builder.create(this, "IGV User Pool Client") .userPool(userPool) .userPoolClientName("IGV User Pool Client") - .generateSecret(true) + .generateSecret(true).enabledAuthFlows() .build(); @@ -78,6 +79,8 @@ public IGVAmazonCognitoStack(final Construct parent, final String id, final Stac userPoolID = userPool.getUserPoolId(); userPoolARN = userPool.getUserPoolArn(); + + final CfnUserPoolProps cfnUserPoolProps = CfnUserPoolProps. final CfnUserPoolDomain cfnUserPoolDomain = CfnUserPoolDomain.Builder.create(this, "IGV User Pool Domain") .domain(userPoolDomain) .userPoolId(userPoolID)