Details
-
Suggestion
-
Resolution: Answered
-
None
-
None
Description
com.atlassian.aws.Ec2ClientFactoryImpl has 2 constructors: default (with endpoint = null) and com.atlassian.aws.Ec2ClientFactoryImpl#Ec2ClientFactoryImpl(java.lang.String) which accepts custom endpoint URL.
In atlassian-bamboo-5.4.1-source/atlassian-bamboo/components/bamboo-web-app/src/main/resources/applicationContextAgentServer.xml the default constructor is used:
<bean id="awsAccountBean" class="com.atlassian.bamboo.agent.elastic.aws.AwsAccountBeanImpl" plugin:available="true"> <constructor-arg ref="elasticAccountBean"/> <constructor-arg> <bean class="com.atlassian.aws.AWSManagerImpl"> <constructor-arg> ***<bean class="com.atlassian.aws.Ec2ClientFactoryImpl"/>*** </constructor-arg> <constructor-arg ref="elasticScheduledExecutorService"/> </bean> </constructor-arg> <property name="maximumEbsVolumeStatusAgeSeconds" value="${bamboo.agent.elastic.defaultMaximumAwsResourceStatusAgeSeconds}"/> <property name="maximumInstanceStatusAgeSeconds" value="${bamboo.agent.elastic.defaultMaximumAwsResourceStatusAgeSeconds}"/> <property name="maximumSpotRequestStatusAgeSeconds" value="${bamboo.agent.elastic.defaultMaximumAwsResourceStatusAgeSeconds}"/> </bean>
Method com.atlassian.aws.Ec2ClientFactoryImpl#newAwsAsyncClient(com.atlassian.aws.ec2.awssdk.AwsSupportConstants.Region, com.amazonaws.auth.AWSCredentials, java.util.concurrent.ScheduledExecutorService) throws IllegalArgumentException("No custom endpoint available") when Custom region is selected:
@Override @NotNull public AmazonEC2AsyncClient newAwsAsyncClient(@NotNull final AwsSupportConstants.Region region, @NotNull final AWSCredentials awsCredentials, @NotNull final ScheduledExecutorService scheduledExecutorService) { if (region == AwsSupportConstants.Region.CUSTOM) { if (endpoint==null) { ****throw new IllegalArgumentException("No custom endpoint available");*** } return newAwsAsyncClient(endpoint, awsCredentials, scheduledExecutorService); } return newAwsAsyncClient(region.getEndpoint(), awsCredentials, scheduledExecutorService); }
It would be great if the custom endpoint URL input will be shown when Custom AWS region is selected. For example: