public static function get()
    {
        // Use DynamoDB for distributed session storage if it's configured
        $awsDynamoDBSessionTable = Environment::getEnv('AWS_DYNAMODB_SESSION_TABLE');
        if (!empty($awsDynamoDBSessionTable)) {
            $awsRegionName = Environment::getEnv('AWS_REGION_NAME');
            $awsDynamoDBEndpoint = Environment::getEnv('AWS_DYNAMODB_ENDPOINT');
            $awsAccessKey = Environment::getEnv('AWS_ACCESS_KEY');
            $awsSecretKey = Environment::getEnv('AWS_SECRET_KEY');

            $dynamoOptions = array('region' => $awsRegionName);

            // This endpoint can be set for locally testing DynamoDB.
            // see http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html
            if (!empty($awsDynamoDBEndpoint)) {
                $dynamoOptions['endpoint'] = $awsDynamoDBEndpoint;
            }

            if (!empty($awsAccessKey) && !empty($awsSecretKey)) {
                $dynamoOptions['credentials']['key'] = $awsAccessKey;
                $dynamoOptions['credentials']['secret'] = $awsSecretKey;
            } else {
                // cache credentials when IAM fetches the credentials from EC2 metadata service
                // this will use doctrine/cache (included via composer) to do the actual caching into APCu
                // http://docs.aws.amazon.com/aws-sdk-php/guide/latest/performance.html#cache-instance-profile-credentials
                $dynamoOptions['credentials'] = new DoctrineCacheAdapter(new ApcuCache());
            }

            return new static($dynamoOptions, $awsDynamoDBSessionTable);
        }

        return null;
    }