Home / Companies / Spacelift / Blog / Post Details
Content Deep Dive

How to Create AWS IAM Role with Terraform [Step-by-Step]

Blog post from Spacelift

Post Details
Company
Date Published
Author
Jack Roper
Word Count
1,493
Language
English
Hacker News Points
-
Summary

This article discusses the creation of an IAM (Identity and Access Management) role in AWS (Amazon Web Services) using Terraform. An IAM role is a security principal that enables delegation of permissions to AWS resources within an account without sharing long-term credentials such as access keys or passwords. The roles are typically used for granting permissions to AWS services, applications, or other accounts. The article provides a step-by-step guide on how to create an IAM role and assign it to a newly created EC2 instance that allows read-only access to a newly created S3 storage bucket. It also covers the configuration of the AWS provider, obtaining Access key ID and secret access key for your AWS user, running 'aws configure', creating a new main.tf file, setting the IAM role, and more. The guide concludes with steps on how to validate, apply, and clean up the Terraform configuration. It also encourages readers to explore Spacelift as a tool for managing Terraform infrastructure and working with AWS credentials per run.