title: Guice Configuration Error No implementation was bound
body: <p>I am trying to keep a singleton AmazonSNS to access an SNS. I have written a module for SNS (only one SNS is added currently) and an accessor to publish the message. My code is as follows:</p>
  
  <pre><code>public class SNSModule extends AbstractModule {
  
      @Override
      protected void configure() {
      }
  
      @Provides
      @Named("PSSNSRegionName")
      private Regions getPSSNSRegionName(
              @Named(BeanConstants.P_S_SNS_REGION) final String regionName) {
          return Regions.fromName(regionName);
      }
  
      @Provides
      @Singleton
      @Named(BeanConstants.P_S_SNS)
      public AmazonSNS getPSSNS(
              @NonNull @Named("PaymentSuccessSNSRegionName") final Regions region,
              final Config config) {
          return AmazonSNSClientBuilder.standard()
                  .withCredentials(new AWSCredentialsProviderImpl(config.getSnsMaterialSet()))
                  .withRegion(region)
                  .build();
      }
  
  }
  </code></pre>
  
  <p>The SNS Accessor is as follows:</p>
  
  <pre><code>@RequiredArgsConstructor(access = AccessLevel.PUBLIC, onConstructor = @__(@Inject))
  public class SNSAccessor {
  
      @Named(BeanConstants.P_S_SNS)
      private final AmazonSNS snsClient;
      private static final String COLON = ":";
      private static final short ARN_LENGTH = 6;
  
      public PublishResult publishToSNS(@NonNull final String snsTopicArn, @NonNull final String messageToPublish) {
          try {
              String[] arnParts = snsTopicArn.split(COLON);
              Preconditions.checkArgument(
                      snsTopicArn.split(COLON).length == ARN_LENGTH,
                      "Expected arn to have 6 parts but found: " + arnParts.length
              );
              return snsClient.publish(snsTopicArn, messageToPublish);
          } catch (InternalErrorException e) {
              log.error("InternalErrorException publishing notification to SNS", e);
              throw new RetriableException(e);
          } catch (Exception e) {
              log.error("Exception publishing notification to SNS", e);
              throw new NonRetriableException(e);
          }
      }
  }
  </code></pre>
  
  <p>I was able to build the package but it threw ConfigurationException at runtime.</p>
  
  <pre><code>Caused by: com.google.inject.ConfigurationException: Guice configuration errors:
  
  1) No implementation for com.amazonaws.services.sns.AmazonSNS was bound.
    while locating com.amazonaws.services.sns.AmazonSNS
      for parameter 0 at com.xyz.service.sns.SNSAccessor.&lt;init&gt;(SNSAccessor.java:29)
  </code></pre>
  
  <p>Could you please help me figure out what I am doing wrong? I have installed the SNSModule in main correctly.</p>