> For the complete documentation index, see [llms.txt](https://academy.shade.inc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://academy.shade.inc/shade-academy/shade-academy-es/byos/connecting-shade-with-aws-s3.md).

# Conectar Shade con AWS S3

**Crea el bucket**

1. Crea un bucket. Toma nota de la región y del nombre del bucket que crees
   1. Solo cambia la entrada del nombre del bucket. Todos los demás valores predeterminados pueden dejarse igual (propósito general, sin ACL, bloquear todo el acceso público, sin versionado del bucket, cifrado del lado del servidor, sin configuraciones avanzadas)

**Configuración de CORS**

1. Haz clic en el bucket y luego en la pestaña de permisos. Desplázate hasta la `Compartición de recursos de origen cruzado (CORS)` sección.

<figure><img src="https://440362858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUNq6h2Bfw7aAK0J2ffnZ%2Fuploads%2FkGVNB69nqWLvUWJIWdNT%2Fimage.png?alt=media&amp;token=857eb17c-3f40-45eb-a29f-f6dac0bcf606" alt=""><figcaption></figcaption></figure>

2\. Haz clic en editar y luego pega este JSON.

{% code fullWidth="false" %}

```
[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "PUT",
            "POST",
            "DELETE",
            "HEAD"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": [
            "ETag",
            "Content-Length",
            "Content-Disposition",
            "Content-Encoding",
            "x-amz-request-id",
            "x-amz-id-2",
            "x-amz-version-id",
            "x-amz-server-side-encryption"
        ],
        "MaxAgeSeconds": 3000
    }
]
```

{% endcode %}

Este JSON se usa para permitir que los navegadores web accedan a este bucket. Esto es seguro porque proporcionamos redirecciones desde nuestro servidor; mantenemos el alcance específico de los permisos de CORS, por lo que esta configuración puede dejarse genérica.

**Crea la política con alcance limitado**

1. En `IAM` haz clic `Políticas` luego haz clic en `Crear política`

   1. La mayoría de los errores que vemos ocurren justo aquí, donde las políticas no se personalizan correctamente

   <figure><img src="https://440362858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUNq6h2Bfw7aAK0J2ffnZ%2Fuploads%2FnZIqNYO9wGBNJ2vby63E%2Fimage.png?alt=media&amp;token=406f35f0-121f-4ce0-a612-7ae0962a6973" alt=""><figcaption></figcaption></figure>
2. Asegúrate de personalizar este archivo JSON de abajo para cambiar la `Resource` entrada de `the-bucket-name-you-provisioned-earlier` por el nombre del bucket que creaste primero. **Esto está en dos lugares: uno debajo de la `bucketname` resource `bucketname/*` resource**

```
{
	"Version": "2012-10-17",
	"Statement": [
		{
			"Effect": "Allow",
			"Action": [
				"s3:ListBucket",
				"s3:GetBucketLocation"
			],
			"Resource": "arn:aws:s3:::the-bucket-name-you-provisioned-earlier"
		},
		{
			"Effect": "Allow",
			"Action": [
				"s3:GetObject",
				"s3:PutObject",
				"s3:DeleteObject"
			],
			"Resource": "arn:aws:s3:::the-bucket-name-you-provisioned-earlier/*"
		}
	]
}
```

3. Usa el editor JSON y pega esto en el editor de políticas
4. Pon a tu política un nombre que sea relevante para el acceso al bucket de Shade que creamos antes y añade una descripción. Crea la política

**Crea el usuario**

1. Ahora, en `Usuarios` en la barra lateral izquierda de IAM, haz clic en `Crear usuario`
2. Dale al usuario un nombre que sea relevante para Shade. Este será el usuario a través del cual los servidores de Shade accederán a tu bucket y firmarán URLs.
3. Elige `Adjuntar políticas directamente` y busca la política que creaste. Marca la casilla para adjuntarla y pulsa siguiente

<figure><img src="https://440362858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUNq6h2Bfw7aAK0J2ffnZ%2Fuploads%2FRuj9ZkYDTY3ECZR8GLEk%2Fimage.png?alt=media&amp;token=dfa64253-4a6a-40fa-9951-5403053cbd3d" alt=""><figcaption></figcaption></figure>

4. Crea el usuario
5. Ahora haz clic en el usuario y pulsa `Crear clave de acceso`

<figure><img src="https://440362858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUNq6h2Bfw7aAK0J2ffnZ%2Fuploads%2FhcWU9ZUSgzxCd7BbAmKJ%2Fimage.png?alt=media&amp;token=b1f860f0-ec54-4de2-b5ec-a695996ad47a" alt=""><figcaption></figcaption></figure>

6. Selecciona `Aplicación que se ejecuta fuera de AWS`

<figure><img src="https://440362858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUNq6h2Bfw7aAK0J2ffnZ%2Fuploads%2FkuUWTk7seBrTDBVIcB6s%2Fimage.png?alt=media&amp;token=5675b7ae-ed8a-4435-bf89-37461a9bc3df" alt=""><figcaption></figcaption></figure>

7. Guarda en tu computadora la clave de acceso y la clave secreta creadas

**Crea drives en Shade**

1. En la app de Shade, crea un drive BYOS

<figure><img src="https://440362858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUNq6h2Bfw7aAK0J2ffnZ%2Fuploads%2FV0QizFJMF15OW53AI0bP%2Fimage.png?alt=media&amp;token=33a55b13-064d-4e53-be9f-f8959a8a844d" alt=""><figcaption></figcaption></figure>

2. Usa la `Personalizada` configuración para crear tu bucket
3. Rellena la configuración con los valores correctos. Presta atención al endpoint. Usa el `s3.<region>.amazonaws.com` formato precedido por `https://`. Encuentra estos endpoints según la región en la que creaste tu bucket en `endpoints de Amazon S3` en esta página: <https://docs.aws.amazon.com/general/latest/gr/s3.html>

<figure><img src="https://440362858-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUNq6h2Bfw7aAK0J2ffnZ%2Fuploads%2FAhQJ4Q5zd8dkAY6KFUCy%2Fimage.png?alt=media&amp;token=21846f1c-1011-4eab-8fd7-5526cb58cb35" alt=""><figcaption></figcaption></figure>

4. Sube un archivo para probar. Deberías ver aparecer objetos en tu bucket de S3; el archivo debería cargarse y obtener previsualizaciones/proxies normalmente.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://academy.shade.inc/shade-academy/shade-academy-es/byos/connecting-shade-with-aws-s3.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
