Amazon Simple Storage Service (Amazon S3) as defined on the AWS docs is an object storage service that offers industry-leading scalability, data availability, security, and performance.
If you already have an AWS account , you can create the bucket or containers on this service via the AWS console and the aws cli. Both of these are more of an imperative model of creating this. In the blog I will show how to use the declarative model of creating the buckets using the Hashicorp terraform.
1. Create a working folder for the configurations.
2. Create a file called providers.tf with contents as follows
3. Create a file called variables.tf with contents as follows
4. Create a file called outputs.tf with contents as follows
5. Create a file called outputs.tf with contents as follows
6. Execute the below commands
Sample output should look like this below:
You can now use the information on he output section above to interact with the bucket. Remember , you will need to use the credentials used to create the bucket or some other credentials that have read or read/write access to the bucket.
The Source code used above can be found on my git repo.