title: Get secrets from AWS Secret manager without passing access key and secret key from config
body: <p>I am using AWS Secret Manager Service to retrieve some confidential information like SMTP details or connection strings. However, to get secret value from AWS Secret Manager Service it seems like we need to pass the Access key and secret key apart from which secret we want to retrieve. So I am maintaining those values in config file. </p>
  
  <pre><code>        public AwsSecretManagerService(IOptions&lt;AwsAppSettings&gt; settings)
          {
              awsAppSettings = settings.Value;
              amazonSecretsManagerClient = new AmazonSecretsManagerClient
                  (awsAppSettings.Accesskey, awsAppSettings.SecretKey, RegionEndpoint.GetBySystemName(awsAppSettings.Region));
          }
  
          public async Task&lt;SecretValueResponse&gt; GetSecretValueAsync(SecretValueRequest secretValueRequest)
          {
              return _mapper.Map&lt;SecretValueResponse&gt;(await amazonSecretsManagerClient.GetSecretValueAsync(_mapper.Map&lt;GetSecretValueRequest&gt;(secretValueRequest)));
          }
  </code></pre>
  
  <p>So I am thinking I am kind of defeating the whole purpose of using secret manager by maintaining the AWS credentials in app settings file. I am wondering what is the right way to do this</p>