HomePhabricator
Diffusion Comm b683fcc0244c

[terraform] Add missing Instance Profile resource

Description

[terraform] Add missing Instance Profile resource

Summary:

This stack resolves issues encountered when setting up fresh staging AWS account with Terraform.

When creating a fresh EC2 Autoscaling group, it turned out that "instance profile" isn't the same as "instance role". On Prod we created it using AWS Console, which automatically created the instance profile.
When creating it using terraform (AWS API in general), we need to create the instance profile separately and attach the role to it.

AWS Docs: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html

For production, imported the existing instance profile resource using terraform import.

Depends on D8715.

Test Plan: Terraform apply on staging finally was able to create an autoscaling group. Terraform plan on prod shows no changes.

Reviewers: jon, varun

Reviewed By: jon

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D8716

Details

Provenance
bartekAuthored on Aug 3 2023, 2:04 AM
Reviewer
jon
Differential Revision
D8716: [terraform] Add missing Instance Profile resource
Parents
rCOMM35834a687935: [terraform] Expose shared dynamodb tables
Branches
Unknown
Tags
Unknown