On initial setup, after providing the required AWS Connector Credentials and saving the config form getting following error.

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">InvalidArgumentException</em>: Missing required client configuration options: 

region: (string)

  A &quot;region&quot; configuration value is required for the &quot;iot&quot; service
  (e.g., &quot;us-west-2&quot;). A list of available public regions and endpoints can be
  found at http://docs.aws.amazon.com/general/latest/gr/rande.html. in <em class="placeholder">Aws\ClientResolver-&gt;throwRequired()</em> (line <em class="placeholder">377</em> of <em class="placeholder">/var/www/newell/vendor/aws/aws-sdk-php/src/ClientResolver.php</em>). <pre class="backtrace">Aws\ClientResolver-&gt;resolve(Array, Object) (Line: 166)
Aws\AwsClient-&gt;__construct(Array) (Line: 117)
Drupal\aws_connector\Credentials\AWSCredentialProvider::validateCredentials(&#039;AKIAI7WVQBD574QSWFCQ&#039;, &#039;KIAI7WVQBD574QSWFCQ.X5VQKgmTSw2Awq0SP2wYq5LEhGd4thTDgbWg45sx&#039;) (Line: 90)
Drupal\aws_connector\Form\AWSConnectorForm-&gt;validateForm(Array, Object)
call_user_func_array(Array, Array) (Line: 82)
Drupal\Core\Form\FormValidator-&gt;executeValidateHandlers(Array, Object) (Line: 275)
Drupal\Core\Form\FormValidator-&gt;doValidateForm(Array, Object, &#039;aws_connector_form&#039;) (Line: 118)
Drupal\Core\Form\FormValidator-&gt;validateForm(&#039;aws_connector_form&#039;, Array, Object) (Line: 575)
Drupal\Core\Form\FormBuilder-&gt;processForm(&#039;aws_connector_form&#039;, Array, Object) (Line: 318)
Drupal\Core\Form\FormBuilder-&gt;buildForm(&#039;aws_connector_form&#039;, Object) (Line: 93)
Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 67)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 51)
Drupal\jsonapi\StackMiddleware\FormatSetter-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\shield\ShieldMiddleware-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 669)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
</pre>

Although, the AWS Region value was present on the form.
However, while validating the credentials, following always returns NULL as the config for region(aws_region) was not set during module install.
return $aws_connector_config->get('aws_connector.' . $key);

As the AWS Region is required, the default config should be set when module gets installed.

Comments

Gaurav_drupal created an issue. See original summary.

gaurav_drupal’s picture

Attaching patch.

gaurav_drupal’s picture

Status: Active » Needs review

  • mikemadison committed 346628d on 8.x-1.x
    #3020503 adding default configuration on install for region.
    
mikemadison’s picture

Status: Needs review » Fixed
mikemadison’s picture

Status: Fixed » Closed (fixed)