Skip to content

Commit

Permalink
Adding China Handling and some extra version logging
Browse files Browse the repository at this point in the history
  • Loading branch information
aldrinleal committed Jul 24, 2017
1 parent 07a3ce0 commit 5a44d05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,14 @@ public <T> T getService(Class<T> serviceClazz)
}

protected String getEndpointFor(ServiceEndpointFormatter formatter) {
return String.format(formatter.serviceMask, region);
String endpointStr = String.format(formatter.serviceMask, region);

// Extra Handling for CN_Beijing Region
if (region.equalsIgnoreCase("cn-north-1")) {
endpointStr += ".cn";
}

return endpointStr;
}

public <T extends AmazonWebServiceClient> String getEndpointFor(T client) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.amazonaws.services.elasticbeanstalk.model.S3Location;
import com.amazonaws.services.elasticbeanstalk.model.UpdateEnvironmentRequest;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.util.VersionInfoUtils;

import com.google.common.collect.Lists;
import org.apache.commons.lang.Validate;
Expand Down Expand Up @@ -100,7 +101,7 @@ public boolean perform() throws Exception {
if (null == getLogger())
setLogger(getListener().getLogger());

log("AWSEB Deployment Plugin Version %s", Utils.getVersion());
log("AWSEB Deployment Plugin Version %s (aws-java-sdk version: %s)", Utils.getVersion(), VersionInfoUtils.getVersion());

return false;
}
Expand Down Expand Up @@ -145,6 +146,8 @@ public boolean perform() throws Exception {
factory = AWSClientFactory.getClientFactory("", getDeployerConfig().getAwsRegion());
}

log ("Using region: '%s'", getDeployerConfig().getAwsRegion());

setS3(factory.getService(AmazonS3Client.class));
setAwseb(factory.getService(AWSElasticBeanstalkClient.class));

Expand Down

0 comments on commit 5a44d05

Please sign in to comment.