This project provides a simple scaffolding for creating an AWS S3 bucket using Terraform. It is designed for experimenting with the module import feature in Resourcely.
This Terraform setup creates an S3 bucket with the following features:
- Versioning: Controlling versioning for an S3 bucket.
- Public Access Blocking: Restricts public access by default.
The goal is to provide a minimal infrastructure to experiment with Resourcely’s module import feature.
This project includes three key Terraform files:
variables.tf
: Defines input variables for the bucket name and versioning_status.main.tf
: Contains the resource definition to create the S3 bucket.outputs.tf
: Displays outputs, such as the bucket name and ARN, after creation.
First, clone this repository to your local machine:
git clone <repository-url>
cd <repository-folder>
Initialize the Terraform configuration:
terraform init
Preview the changes Terraform will apply:
terraform plan
Apply the Terraform plan to create the S3 bucket:
terraform apply
After applying, you’ll see the bucket name and ARN in the outputs.
The variables.tf
file defines two configurable variables:
Variable | Description | Default |
---|---|---|
bucket_name |
The name of the S3 bucket | |
versioning_status |
Versioning state of the bucket | Enabled |
You can update the values in variables.tf
or pass them as command-line arguments when running Terraform.
After creating the bucket, Terraform will output the following:
Output | Description |
---|---|
bucket_name |
The name of the created S3 bucket |
bucket_arn |
The Amazon Resource Name (ARN) of the S3 bucket |
These outputs provide key details about the created bucket.
This Terraform configuration is intended to be used with Resourcely's module import feature. allowing you to import external modules for managing and experimenting with cloud resources.