Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUN-2824: rebuild #136

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@

import com.amazonaws.auth.*;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient;
import com.amazonaws.services.securitytoken.AWSSecurityTokenService;
import com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClientBuilder;
import com.amazonaws.services.securitytoken.model.*;
import com.dtolabs.rundeck.core.common.*;
import com.dtolabs.rundeck.core.plugins.configuration.ConfigurationException;
Expand Down Expand Up @@ -248,14 +249,18 @@ private void initialize() {
}

private AWSCredentials createAwsCredentials(AWSCredentialsProvider provider, String assumeRoleArn, String externalId) {
AWSSecurityTokenServiceClient sts_client;
AWSSecurityTokenService sts_client;

if (provider != null) {
sts_client = new AWSSecurityTokenServiceClient(provider, clientConfiguration);
sts_client = AWSSecurityTokenServiceClientBuilder.standard()
.withCredentials(provider)
.withClientConfiguration(clientConfiguration)
.build();
} else {
sts_client = new AWSSecurityTokenServiceClient(clientConfiguration);
sts_client = AWSSecurityTokenServiceClientBuilder.standard()
.withClientConfiguration(clientConfiguration)
.build();
}
// sts_client.setEndpoint("sts-endpoint.amazonaws.com");
AssumeRoleRequest assumeRoleRequest = new AssumeRoleRequest();
assumeRoleRequest.setRoleArn(assumeRoleArn);
if(externalId!=null){
Expand Down
Loading