# Environment variables error for AWS secret\_access\_key

**URL:** <https://discuss.elastic.co/t/environment-variables-error-for-aws-secret-access-key/103255>\
**Category:** Logstash\
**Created:** [October 9, 2017, 4:59pm UTC](https://discuss.elastic.co/t/environment-variables-error-for-aws-secret-access-key/103255 "2017-10-09T16:59:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![erikkn](https://avatars.discourse-cdn.com/v4/letter/e/e95f7d/32.png) [@erikkn](https://discuss.elastic.co/u/erikkn)\
**Post date:** [October 9, 2017, 4:59pm UTC](https://discuss.elastic.co/t/environment-variables-error-for-aws-secret-access-key/103255/1 "2017-10-09T16:59:25Z")

</div>

Hey guys :),,

I am using the S3 plugin (logstash-input-s3) . I would like to use environment variables for the AWS\_ACCESS\_KEY\_ID and the AWS\_SECRET\_ACCESS\_KEY variables, but I am getting an error with the secret access key. My config:

```
access_key_id => "${AWS_ACCESS_KEY_ID}"
secret_access_key => "${AWS_SECRET_ACCESS_KEY}"

```

The error I get:

`Plugin: <LogStash::Inputs::S3 bucket=>"<bucket-name>", access_key_id=>"<access-key>" secret_access_key=>"{<secret-access-key>}", codec=><LogStash::Codecs::Multiline pattern=>"Started", negate=>true, what=>"previous", id=>"af4b25dabcd7b02460edde8b5529e818b7314e12-1", enable_metric=>true, charset=>"UTF-8", multiline_tag=>"multiline", max_lines=>500, max_bytes=>10485760>, id=>"af4b25dabcd7b02460edde8b5529e818b7314e12-2", enable_metric=>true, region=>"us-east-1", delete=>false, interval=>60, temporary_directory=>"/tmp/logstash">`

So it's working fine for the AWS\_ACCESS\_KEY\_ID , but not for the AWS\_SECRET\_ACCESS\_KEY, it puts the right secret key there, but with the brackets {} .

Does someone know how to fix this?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 9, 2017, 5:00pm UTC](https://discuss.elastic.co/t/environment-variables-error-for-aws-secret-access-key/103255/2 "2017-10-09T17:00:53Z")

</div>

Looks like you are missing a curly brace after `AWS_SECRET_ACCESS_KEY`.

---

<div class="post-metadata">

**Author:** ![erikkn](https://avatars.discourse-cdn.com/v4/letter/e/e95f7d/32.png) [@erikkn](https://discuss.elastic.co/u/erikkn)\
**Post date:** [October 9, 2017, 5:07pm UTC](https://discuss.elastic.co/t/environment-variables-error-for-aws-secret-access-key/103255/3 "2017-10-09T17:07:43Z")

</div>

Oeps, my bad. I have the last bracket in my config, something went wrong with the copy paste.

Updated: secret\_access\_key =\> "${AWS\_SECRET\_ACCESS\_KEY}"  
And unfortunately it is not working

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 6, 2017, 5:08pm UTC](https://discuss.elastic.co/t/environment-variables-error-for-aws-secret-access-key/103255/4 "2017-11-06T17:08:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
