title: how to get my config values in yml - using dropwizard guice D.I?
body: <p>I am using below <code>config.yml</code></p>
  
  <pre><code># AWS DynamoDB settings
  dynamoDB:
    # Access key
    aws_access_key_id: "access-key"
    #Secret Key
    aws_secret_access_key: "secret-key"
    aws_dynamodb_region: EU_WEST_1 
  </code></pre>
  
  <p>And below class to read the above config values in my <code>DynamoDBConfig</code> class.</p>
  
  <pre><code>public class DynamoDBConfig {
      public DynamoDBConfig() {
      }
  
      @JsonProperty("aws_access_key_id")
      public String accessKey;
  
      @JsonProperty("aws_secret_access_key")
      public String secretKey;
  
      @JsonProperty("aws_dynamodb_region")
      public String region;
  
      // getters and setters
  }
  </code></pre>
  
  <p>Finally <code>ApplicationConfig</code> class which include <code>DynamoDB</code> config.</p>
  
  <pre><code>public class ReadApiConfiguration extends Configuration {
      @NotNull
      private DynamoDBConfig dynamoDBConfig = new DynamoDBConfig();
  
      @JsonProperty("dynamoDB")
      public DynamoDBConfig getDynamoDBConfig() {
          return dynamoDBConfig;
      }
  
      @JsonProperty("dynamoDB")
      public void setDynamoDBConfig(DynamoDBConfig dynamoDBConfig) {
          this.dynamoDBConfig = dynamoDBConfig;
      }
  }
  </code></pre>
  
  <p>Now i want to read <code>aws_access_key</code> and <code>aws_secret_key</code> values in my <code>AWSclient.java</code> class to create a <code>awsclient</code></p>
  
  <pre><code>BasicAWSCredentials awsCreds = new BasicAWSCredentials("access_key_id", "secret_key_id");
  </code></pre>
  
  <p>My problem is, how i read/inject the <strong>config values</strong>, in my <code>AWSClient</code> class. I am using the <code>dropwizard-guice</code> module for DI. and couldn't figure out , how can i bind the <code>configuration</code> object created at the DW startup time to its class. </p>
  
  <p>P.S. :-> I've gone through this <a href="https://stackoverflow.com/questions/35882330/how-to-get-my-configuration-values-in-yml-using-dropwizard-microservice-jers">SO post</a> but it doesn't solve my issue, as its not using guice as a DI module.</p>