Skip to content

Terraform Configuration that Creates and Manages S3 bucket

License

Notifications You must be signed in to change notification settings

TerraformTestLab/HelloS3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Configuration for S3 Bucket Deployment 🪣

This repository contains Terraform configuration to create an AWS S3 bucket. The configuration is flexible, allowing you to define bucket properties such as versioning, access control, and encryption. 🛠️

Features ✨

  • ✅ Creates an S3 bucket with customizable settings.
  • ✅ Supports versioning for object history.
  • ✅ Enables server-side encryption for data security.
  • ✅ Allows configuration of bucket policies and access controls.
  • ✅ Easily extendable for logging or lifecycle policies.

Prerequisites ⚠️

Before using this configuration, ensure you have:

  • 🖥️ Terraform installed (v1.0 or later).
  • 💻 AWS CLI installed and configured with appropriate permissions.
  • 🔑 An AWS IAM user or role with s3:CreateBucket and s3:PutBucket* permissions.

Usage 📚

1. Clone the Repository

git clone https://github.com/yourusername/terraform-s3-bucket.git
cd terraform-s3-bucket

2. Configure Variables

Update the terraform.tfvars file or pass variables during the apply step. Here are the primary variables you can customize:

bucket_name         = "my-unique-bucket-name" # Replace with your unique bucket name
enable_versioning   = true                    # Set to true to enable versioning
enable_encryption   = true                    # Set to true for server-side encryption

3. Initialize Terraform

Initialize the Terraform workspace by running:

terraform init

4. Apply the Configuration

Run the following command to create the S3 bucket:

terraform apply

Type yes when prompted to approve the changes.

Outputs 📤

After applying, the following outputs will be available:

  • Bucket Name: The name of the created S3 bucket.
  • Bucket ARN: The Amazon Resource Name (ARN) of the S3 bucket.
  • Bucket Region: The region where the bucket is created.

Example:

Bucket Name   = my-unique-bucket-name
Bucket ARN    = arn:aws:s3:::my-unique-bucket-name
Bucket Region = us-west-1

Clean Up 🧹

To delete the S3 bucket and all associated resources, run:

terraform destroy

⚠️ Note: If the bucket contains objects, you’ll need to empty it before deletion.

Contributing 🤝

Contributions are welcome! Feel free to fork this repository, make improvements, and open a pull request.

License 📜

This project is licensed under the MIT License - see the LICENSE file for details.


Highlights

  1. User-Friendly Structure: Includes sections like features, prerequisites, usage, and outputs.
  2. Customization: Mentions key customizable variables.
  3. Clear Instructions: Provides step-by-step guidance for setup, usage, and cleanup.
  4. Engaging Emojis: Adds visual appeal and organizes content effectively.

About

Terraform Configuration that Creates and Manages S3 bucket

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages