[BUG] S3 Module / State Configuration Not Aligned
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
The S3 module expects the s3 configuration to be:
s3.key: key
s3.location: eu-west-1
Code: https://github.com/saltstack/salt/blob/master/salt/modules/s3.py
Docs:
Warning
This is literally the pillar key s3.keyid or the config option s3.keyid, not:
s3:
keyid: blah
However, when using s3:// as a file source - s3_opt uses ['s3']['key']
Setup
This means that a backup and restore state like this will never work unless the s3 configuration is duplicated.
letsencrypt-create-backup:
cmd.run:
- name: tar -cvf /tmp/letsencrypt.tar ./letsencrypt
- cwd: /etc
letsencrypt-upload-backup:
module.run:
- name: s3.put
- bucket: {{ pillar['s3']['bucketName'] }}
- local_file: /tmp/letsencrypt.tar
- path: {{ grains.nodename }}/letsencrypt.tar
teleport-s3-sync-down:
archive.extracted:
- name: /etc
- source: s3://{{ pillar['s3']['bucketName'] }}/{{ grains.nodename }}/letsencrypt.tar
- skip_verify: True
- user: root
- group: root
- if_missing: /etc/letsencrypt
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing configuration handling in salt/modules/s3.py with the s3_opt lookup in salt/fileclient.py around line 554. Reproduce the documented S3 settings with the backup and restore state shown in the issue, then verify that the same configuration works for both s3.put and an s3:// file source without duplication.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100