package com.otognan.driverpete.logic;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.BasicAWSCredentials;


@Configuration
public class AWSConfiguration {
    
    @Value("${AWS_ACCESS_KEY_ID}")
    private String amazonAWSAccessKey;

    @Value("${AWS_SECRET_KEY}")
    private String amazonAWSSecretKey;
    
    @Bean
    public AWSCredentials amazonAWSCredentials() {
        return new BasicAWSCredentials(amazonAWSAccessKey, amazonAWSSecretKey);
    }
}

@@ -560,16 +560,423 @@
 als() %7B%0A
+        // Beanstalk defines empty keys by default, so we better check it here%0A        if(amazonAWSAccessKey == null %7C%7C amazonAWSAccessKey.isEmpty()) %7B%0A            throw new IllegalArgumentException(%22AWSAccessKey is empty or null%22);%0A        %7D%0A        if(amazonAWSSecretKey == null %7C%7C amazonAWSSecretKey.isEmpty()) %7B%0A            throw new IllegalArgumentException(%22AWSSecretKey is empty or null%22);%0A        %7D%0A
         
@@ -1054,9 +1054,8 @@
 %0A    %7D%0A%7D
-%0A

check for empty keys