# Nomad(\>1.5.0) artifact from s3 bucket

**URL:** <https://discuss.hashicorp.com/t/nomad-1-5-0-artifact-from-s3-bucket/57842>\
**Category:** Nomad\
**Created:** [August 31, 2023, 6:57pm UTC](https://discuss.hashicorp.com/t/nomad-1-5-0-artifact-from-s3-bucket/57842 "2023-08-31T18:57:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vvarga](https://avatars.discourse-cdn.com/v4/letter/v/4bbf92/32.png) [@vvarga](https://discuss.hashicorp.com/u/vvarga)\
**Post date:** [August 31, 2023, 6:57pm UTC](https://discuss.hashicorp.com/t/nomad-1-5-0-artifact-from-s3-bucket/57842/1 "2023-08-31T18:57:27Z")

</div>

Hi,

So I realized that since 1.5.0 artifact downloads occur in a sub-process.  
And when I configure the artifact stanza with the access key and secret key in it, it works just fine.

```auto
            artifact {
                source = "s3::http://fubar.com:9020/nomad_artifacts/sandbox/wdc/fake-service/gelf.tpl"
                options {
                    aws_access_key_id = "6rMOOHXeW/sfsafas"
                    aws_access_key_secret = "1OnW76rMOOHXeW/sfsafasfasd"
                }
            }

```

However I don’t want to store the credentials in the manifest file. So the idea would be to use environment variables.  
For backward compatibility, the artifact sandbox can be configured to inherit specified environment variables from the Nomad client by setting `set_environment_variables`.  
But where do I set these variables? I am confused about this configuration.

---

<div class="post-metadata">

**Author:** ![vvarga](https://avatars.discourse-cdn.com/v4/letter/v/4bbf92/32.png) [@vvarga](https://discuss.hashicorp.com/u/vvarga)\
**Post date:** [September 1, 2023, 3:23pm UTC](https://discuss.hashicorp.com/t/nomad-1-5-0-artifact-from-s3-bucket/57842/2 "2023-09-01T15:23:40Z")

</div>

So I figured out the systemd service file for nomad pulls environment variables from “/etc/nomad.d/nomad.env”

```auto
[root@xxxxx ~]# grep Environment /usr/lib/systemd/system/nomad.service
EnvironmentFile=-/etc/nomad.d/nomad.env

```

If you set the AWS access id, and secret key there, it works with AWS S3,  
but doesn’t work with an on-prem s3 compatible object storage.
