use of com.netflix.spinnaker.halyard.config.model.v1.persistentStorage.S3PersistentStore in project halyard by spinnaker.
the class Front50Service method generateAwsProfile.
protected Optional<Profile> generateAwsProfile(DeploymentConfiguration deploymentConfiguration, SpinnakerRuntimeSettings endpoints, String spinnakerHome) {
PersistentStore.PersistentStoreType type = deploymentConfiguration.getPersistentStorage().getPersistentStoreType();
S3PersistentStore store = deploymentConfiguration.getPersistentStorage().getS3();
if (type == PersistentStore.PersistentStoreType.S3 && !StringUtils.isEmpty(store.getAccessKeyId()) && !StringUtils.isEmpty(store.getSecretAccessKey())) {
String outputFile = awsCredentialsProfileFactoryBuilder.getOutputFile(spinnakerHome);
return Optional.of(awsCredentialsProfileFactoryBuilder.setArtifact(SpinnakerArtifact.FRONT50).setAccessKeyId(store.getAccessKeyId()).setSecretAccessKey(store.getSecretAccessKey()).build().getProfile("aws/front50-credentials", outputFile, deploymentConfiguration, endpoints));
} else {
return Optional.empty();
}
}
Aggregations