private void updateAwsParamsForCrossAccountAccess(AwsParamsDto awsParamsDto, String accountId) { // Retrieve the role ARN and make sure it exists. TrustingAccountEntity trustingAccountEntity = trustingAccountDaoHelper.getTrustingAccountEntity(accountId.trim()); String roleArn = trustingAccountEntity.getRoleArn(); // Assume the role. Set the duration of the role session to 3600 seconds (1 hour). Credentials credentials = stsDao.getTemporarySecurityCredentials(awsParamsDto, UUID.randomUUID().toString(), roleArn, 3600, null); // Update the AWS parameters DTO with the temporary credentials. awsParamsDto.setAwsAccessKeyId(credentials.getAccessKeyId()); awsParamsDto.setAwsSecretKey(credentials.getSecretAccessKey()); awsParamsDto.setSessionToken(credentials.getSessionToken()); }
private void updateAwsParamsForCrossAccountAccess(AwsParamsDto awsParamsDto, String accountId) { // Retrieve the role ARN and make sure it exists. TrustingAccountEntity trustingAccountEntity = trustingAccountDaoHelper.getTrustingAccountEntity(accountId.trim()); String roleArn = trustingAccountEntity.getRoleArn(); // Assume the role. Set the duration of the role session to 3600 seconds (1 hour). Credentials credentials = stsDao.getTemporarySecurityCredentials(awsParamsDto, UUID.randomUUID().toString(), roleArn, 3600, null); // Update the AWS parameters DTO with the temporary credentials. awsParamsDto.setAwsAccessKeyId(credentials.getAccessKeyId()); awsParamsDto.setAwsSecretKey(credentials.getSecretAccessKey()); awsParamsDto.setSessionToken(credentials.getSessionToken()); }
sourceAwsAccessKeyId = this.getAwsAccessKeyId(); String copyAwsAccessKeyId = ((String) strategy.copy(LocatorUtils.property(locator, "awsAccessKeyId", sourceAwsAccessKeyId), sourceAwsAccessKeyId, (this.awsAccessKeyId!= null))); copy.setAwsAccessKeyId(copyAwsAccessKeyId); } else { if (awsAccessKeyIdShouldBeCopiedAndSet == Boolean.FALSE) {