Search in sources :

Example 1 with S3PersistentStore

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();
    }
}
Also used : PersistentStore(com.netflix.spinnaker.halyard.config.model.v1.node.PersistentStore) S3PersistentStore(com.netflix.spinnaker.halyard.config.model.v1.persistentStorage.S3PersistentStore) S3PersistentStore(com.netflix.spinnaker.halyard.config.model.v1.persistentStorage.S3PersistentStore)

Aggregations

PersistentStore (com.netflix.spinnaker.halyard.config.model.v1.node.PersistentStore)1 S3PersistentStore (com.netflix.spinnaker.halyard.config.model.v1.persistentStorage.S3PersistentStore)1