Deepak Prasad
Deepak Prasad

Reputation: 301

Modify pre-existing IAM roles using terraform

I want to start managing the policies on pre-existing IAM roles using terraform. I have many IAM roles with policies attached to them in AWS account. These roles were created manually via the console. Now i want to start managing them using terraform. What is the best way to do this? Thanks, Deepak

Upvotes: 3

Views: 2935

Answers (1)

Jamie
Jamie

Reputation: 3372

Here is how I would do it.

  1. Create those roles in Terraform
  2. Import those roles into your Terraform state
  3. Run terraform plan until it returns no changes
  4. Commit to source control

Keep doing that cycle until everything has been migrated over.

Upvotes: 0

Related Questions