@@ -0,0 +1,2936 @@
+package com.amediamanager.springconfig;%0A%0Aimport org.springframework.context.annotation.Bean;%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.context.annotation.Scope;%0Aimport org.springframework.web.context.WebApplicationContext;%0A%0Aimport com.amazonaws.auth.AWSCredentialsProvider;%0Aimport com.amazonaws.auth.AWSCredentialsProviderChain;%0Aimport com.amazonaws.auth.InstanceProfileCredentialsProvider;%0Aimport com.amazonaws.auth.SystemPropertiesCredentialsProvider;%0Aimport com.amazonaws.regions.Region;%0Aimport com.amazonaws.regions.Regions;%0Aimport com.amazonaws.services.cloudwatch.AmazonCloudWatch;%0Aimport com.amazonaws.services.cloudwatch.AmazonCloudWatchClient;%0Aimport com.amazonaws.services.dynamodbv2.AmazonDynamoDB;%0Aimport com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;%0Aimport com.amazonaws.services.elastictranscoder.AmazonElasticTranscoder;%0Aimport com.amazonaws.services.elastictranscoder.AmazonElasticTranscoderClient;%0Aimport com.amazonaws.services.rds.AmazonRDS;%0Aimport com.amazonaws.services.rds.AmazonRDSClient;%0Aimport com.amazonaws.services.s3.AmazonS3;%0Aimport com.amazonaws.services.s3.AmazonS3Client;%0Aimport com.amediamanager.config.ConfigurationSettings;%0A%0A@Configuration%0Apublic class ServerConfig %7B%0A%09%0A%09@Bean%0A%09@Scope(WebApplicationContext.SCOPE_APPLICATION)%0A%09public AWSCredentialsProvider credentials() %7B%0A%09%09return new AWSCredentialsProviderChain(%0A%09%09%09%09new SystemPropertiesCredentialsProvider(),%0A%09%09%09%09new InstanceProfileCredentialsProvider()%0A%09%09%09%09);%0A%09%7D%0A%09%0A%09@Bean%0A%09@Scope(WebApplicationContext.SCOPE_APPLICATION)%0A%09public Region region(final ConfigurationSettings settings) %7B%0A%09%09return Region.getRegion(Regions.fromName(settings.getProperty(ConfigurationSettings.ConfigProps.AWS_REGION)));%0A%0A%09%7D%0A%0A%09@Bean%0A%09@Scope(WebApplicationContext.SCOPE_APPLICATION)%0A%09public AmazonElasticTranscoder transcodeClient(final AWSCredentialsProvider creds,%0A%09%09%09%09%09%09%09%09%09%09%09%09   final Region region) %7B%0A%09%09return region.createClient(AmazonElasticTranscoderClient.class, creds, null);%0A%09%7D%0A%0A%09@Bean%0A%09@Scope(WebApplicationContext.SCOPE_APPLICATION)%0A%09public AmazonS3 s3Client(final AWSCredentialsProvider creds,%0A%09%09%09%09%09%09%09 final Region region) %7B%0A%09%09return region.createClient(AmazonS3Client.class, creds, null);%0A%09%7D%0A%0A%09@Bean%0A%09@Scope(WebApplicationContext.SCOPE_APPLICATION)%0A%09public AmazonRDS rdsClient(final AWSCredentialsProvider creds,%0A%09%09%09%09%09%09%09   final Region region) %7B%0A%09%09return region.createClient(AmazonRDSClient.class, creds, null);%0A%09%7D%0A%0A%09@Bean%0A%09@Scope(WebApplicationContext.SCOPE_APPLICATION)%0A%09public AmazonDynamoDB dynamoClient(final AWSCredentialsProvider creds,%0A%09%09%09%09%09%09%09   final Region region) %7B%0A%09%09return region.createClient(AmazonDynamoDBClient.class, creds, null);%0A%09%7D%0A%0A%09@Bean%0A%09@Scope(WebApplicationContext.SCOPE_APPLICATION)%0A%09public AmazonCloudWatch cloudwatchClient(final AWSCredentialsProvider creds,%0A%09%09%09%09%09%09%09   %09%09%09%09 final Region region) %7B%0A%09%09return region.createClient(AmazonCloudWatchClient.class, creds, null);%0A%09%7D%0A%09%0A%7D%0A

Add ServerConfig