1 - Bucket S3 estático 🪣
🗂️ Crear bucket S3 como sitio web estático
Este lab crea un bucket S3 configurado como sitio web estático público.
El bucket contendrá una página HTML simple (index.html) y una de error (error.html).
Se aplica una política pública para permitir acceso de solo lectura.
🎯 Qué vas a crear
- Bucket S3 con
websiteconfigurado - Política de acceso público (
s3:GetObject) - Carga inicial de archivos HTML básicos (
index.html,error.html) - Etiquetado por entorno
🧠 ¿Para qué sirve?
Este tipo de bucket es ideal para servir contenido público, documentaciones, landings, o como backend para CloudFront.
📄 Archivos del lab
📁 Terraform:
main.tfvariables.tfoutputs.tfterraform.tfvars.exampleindex.htmlerror.html
▶️ Comandos sugeridos
mkdir -p terraform-labs/04_S3/1_s3_bucket
cd terraform-labs/04_S3/1_s3_bucket
# Descargar archivos
curl -O https://aws-terraform-labs.rofriday.com/labs/04_S3/1_s3_bucket/main.tf
curl -O https://aws-terraform-labs.rofriday.com/labs/04_S3/1_s3_bucket/variables.tf
curl -O https://aws-terraform-labs.rofriday.com/labs/04_S3/1_s3_bucket/outputs.tf
curl -O https://aws-terraform-labs.rofriday.com/labs/04_S3/1_s3_bucket/terraform.tfvars.example
curl -O https://aws-terraform-labs.rofriday.com/labs/04_S3/1_s3_bucket/index.html
curl -O https://aws-terraform-labs.rofriday.com/labs/04_S3/1_s3_bucket/error.html
# Ejecutar
terraform init
terraform apply -var-file="terraform.tfvars"