title: Spring boot startup error for AWS application : There is not EC2 meta data available
body: <p>I am getting the below error when I am trying to run a Spring boot-AWS application locally :</p>
  <p><strong>There is not EC2 meta data available, because the application is not running in the EC2 environment. Region detection is only possible if the application is running on a EC2 instance</strong></p>
  <p>My aws-config.xml looks like below :</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;aws-context:context-credentials&gt;
  &lt;aws-context:simple-credentials access-key=&quot;*****&quot; secret-key=&quot;*****&quot;/&gt;
  &lt;/aws-context:context-credentials&gt;  
  &lt;aws-context:context-region auto-detect=&quot;false&quot; region=&quot;ap-south-1&quot; /&gt;  
  &lt;aws-context:context-resource-loader/&gt;  
  &lt;aws-messaging:annotation-driven-queue-listener max-number-of-messages=&quot;10&quot; wait-time-out=&quot;20&quot; visibility-timeout=&quot;3600&quot;/&gt; 
  </code></pre>
  <p>I am trying to listen with a SQSListner in the below class :</p>
  <pre class="lang-java prettyprint-override"><code>@Configuration
  @EnableSqs
  @ImportResource(&quot;classpath:/aws-config.xml&quot;)
  @EnableRdsInstance(databaseName = &quot;******&quot;, 
                 dbInstanceIdentifier = &quot;*****&quot;, 
                 password = &quot;******&quot;)
  public class AwsResourceConfig {
      @SqsListener(value = &quot;souviksqs&quot;, deletionPolicy = SqsMessageDeletionPolicy.ON_SUCCESS)
      public void receiveNewFileUpload(S3EventNotification event) {
          try {
              if ( event != null &amp;&amp; !CollectionUtils.isNullOrEmpty( event.getRecords() ) &amp;&amp; event.getRecords().get( 0 ) != null ) {
                  S3Entity entry = event.getRecords().get(0).getS3();
                  System.out.println(&quot;############ File Uploaded to ###################### &quot; + entry.getBucket().getName() + &quot;/&quot; + entry.getObject().getKey());
              }
          } catch (Exception e) {
              System.out.println(&quot;Error reading the SQS message &quot; + e);
              
          }
      }
  }
  </code></pre>
  <p>Edit : Just noticed that the error comes when I include the following aws-messaging maven dependency :</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;dependency&gt;
      &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
      &lt;artifactId&gt;spring-cloud-starter-aws-messaging&lt;/artifactId&gt;
       &lt;version&gt;${spring-cloud-aws-version}&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>I am using spring-cloud-aws-version - 1.2.1.RELEASE</p>