---
# System prepended metadata

title: Acesso AWS S3
tags: [WIKI]

---

---
tags: WIKI
---

# Acesso AWS S3

Doc para alguns know-how, ou não :laughing: 

## Referencias para acessar o AWS S3

1 - Instalar o [AWS CLI](https://docs.aws.amazon.com/pt_br/cli/latest/userguide/install-cliv2.html):

2 - Criar o arquivo chamado de `config` na pasta `/${user.home}/.aws/`

3 - Colocar os respectivos arquivos em ~/.aws/:

config
```
[default]
region = us-east-1
output = text

[profile activation-product-hlg]
region = us-east-1
output = text

[profile activation-product-prd]
region = sa-east-1
output = text

[profile images]
region = us-east-1
output = text

[profile rpa-dev2]
region = us-east-1
output = text

[profile rpa-hlg]
region = us-east-1
output = text

[profile rpa-prod]
region = us-east-1
output = text

[profile NexusRelease]
region = us-east-1
output = text
```

credentials
```
[default]
aws_access_key_id = AKIAY4ITBU2WXBPNMDB7
aws_secret_access_key = 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

[activation-product-hlg]
aws_access_key_id = AKIAY4ITBU2W3MTFMFOI
aws_secret_access_key = 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

[images]
aws_access_key_id = AKIAY4ITBU2WWT75IIEJ
aws_secret_access_key = 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

[activation-product-prd]
aws_access_key_id = AKIAY4ITBU2WUX3XFDNP
aws_secret_access_key = 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

[rpa-dev2]
aws_access_key_id = AKIAY4ITBU2W6CPOSS4Y
aws_secret_access_key = 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

[rpa-hlg]
aws_access_key_id = AKIAY4ITBU2W7U47ISRK
aws_secret_access_key = 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

[rpa-prod]
aws_access_key_id = AKIAY4ITBU2WVTUJJ3MK
aws_secret_access_key = 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

[NexusRelease]
aws_access_key_id = AKIAJOSIWD6WXKB33NXQ
aws_secret_access_key = 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
```

Mais infos aqui no [link do vírus](https://docs.aws.amazon.com/pt_br/cli/latest/userguide/cli-chap-configure.html)

4 - Testar um dos buckets


e.g.: Listar um bucket de um determinado profile de imagens
```sh
aws s3 ls s3://gpa-media-dev2 --profile images
```

e.g.: Copiar arquivos para uma pasta no bucket
```sh
aws s3 sync ARQUIVOS_FLUXO_ECOM/ s3://ecom-ativacao-produto-hlg/hlg --profile activation-product-hlg
```

Mais infos aqui no [link do vírus](https://docs.aws.amazon.com/pt_br/cli/latest/userguide/cli-services-s3.html)
