Commit 5c94fabd authored by Bill Wang's avatar Bill Wang Committed by Sutton
Browse files

Squashed commit of the following

commit 04e49a0d 
Author: zhijie wang <wanzhiji@amazon.com> 
Date: Mon Dec 28 2020 19:10:30 GMT-0800 (Pacific Standard Time) 

    fix Cognito region services


commit fca15a32 
Author: zhijie wang <wanzhiji@amazon.com> 
Date: Mon Dec 28 2020 13:56:14 GMT-0800 (Pacific Standard Time) 

commit eaf5dcc4 
Author: zhijie wang <wanzhiji@amazon.com> 
Date: Mon Dec 28 2020 13:35:25 GMT-0800 (Pacific Standard Time) 

    fix cognito client


commit 9ceee335 
Author: zhijie wang <wanzhiji@amazon.com> 
Date: Mon Dec 28 2020 13:20:15 GMT-0800 (Pacific Standard Time) 

    bump core service version


commit 30d44fe4 
Author: zhijie wang <wanzhiji@amazon.com> 
Date: Mon Dec 21 2020 15:03:10 GMT-0800 (Pacific Standard Time) 

    fix pom version
parent 7883a8b8
...@@ -28,8 +28,8 @@ phases: ...@@ -28,8 +28,8 @@ phases:
java: corretto8 java: corretto8
commands: commands:
- if [ $(echo $CODEBUILD_SOURCE_VERSION | grep -c ^refs/heads.*) -eq 1 ]; then echo "Branch name found"; else echo "This build only supports branch builds" && exit 1; fi - if [ $(echo $CODEBUILD_SOURCE_VERSION | grep -c ^refs/heads.*) -eq 1 ]; then echo "Branch name found"; else echo "This build only supports branch builds" && exit 1; fi
- apt-get update -y - apt-get update -y -qq > /dev/null
- apt-get install -y maven - apt-get install -y maven -qq >/dev/null
- java -version - java -version
- mvn -version - mvn -version
- mkdir -p /root/.m2 - mkdir -p /root/.m2
...@@ -56,7 +56,7 @@ phases: ...@@ -56,7 +56,7 @@ phases:
- printenv - printenv
- echo "Building primary service assemblies..." - echo "Building primary service assemblies..."
- mvn -B test install -pl notification-core,provider/notification-aws -Ddeployment.environment=prod - mvn -ntp -B test install -pl notification-core,provider/notification-aws -Ddeployment.environment=prod
- echo "Building integration testing assemblies and gathering artifacts..." - echo "Building integration testing assemblies and gathering artifacts..."
- ./testing/notification-test-aws/build-aws/prepare-dist.sh - ./testing/notification-test-aws/build-aws/prepare-dist.sh
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<dependency> <dependency>
<groupId>org.opengroup.osdu.core.aws</groupId> <groupId>org.opengroup.osdu.core.aws</groupId>
<artifactId>os-core-lib-aws</artifactId> <artifactId>os-core-lib-aws</artifactId>
<version>0.3.14</version> <version>0.3.16</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-secretsmanager --> <!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-secretsmanager -->
......
...@@ -79,10 +79,12 @@ public class AwsCognitoClient { ...@@ -79,10 +79,12 @@ public class AwsCognitoClient {
public static AWSCognitoIdentityProvider generateCognitoClient(String region) public static AWSCognitoIdentityProvider generateCognitoClient(String region)
{ {
return AWSCognitoIdentityProviderClientBuilder.standard() if (System.getenv("AWS_COGNITO_REGION") != null) {
.withCredentials(IAMConfig.amazonAWSCredentials()) region = System.getenv("AWS_COGNITO_REGION");
.withRegion(region) }
.build(); return AWSCognitoIdentityProviderClientBuilder.standard().
withCredentials(IAMConfig.amazonAWSCredentials()).
withRegion(region).build();
} }
public void setPassword(String username, String password,String userPoolId){ public void setPassword(String username, String password,String userPoolId){
......
...@@ -85,9 +85,14 @@ public class AwsCognitoClient { ...@@ -85,9 +85,14 @@ public class AwsCognitoClient {
public static AWSCognitoIdentityProvider generateCognitoClient() public static AWSCognitoIdentityProvider generateCognitoClient()
{ {
return AWSCognitoIdentityProviderClientBuilder.standard() String region = System.getenv("AWS_COGNITO_REGION");
.withCredentials(IAMConfig.amazonAWSCredentials()) AWSCognitoIdentityProviderClientBuilder builder = AWSCognitoIdentityProviderClientBuilder.standard()
.withRegion(AwsConfig.getAwsRegion()) .withCredentials(IAMConfig.amazonAWSCredentials());
.build(); if ( region!= null) {
builder.withRegion(region);
}else{
builder.withRegion(AwsConfig.getAwsRegion());
}
return builder.build();
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment