Page MenuHomePhabricator

[terraform] Add missing Instance Profile resource
ClosedPublic

Authored by bartek on Aug 3 2023, 2:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 10, 12:07 PM
Unknown Object (File)
Tue, May 7, 9:12 PM
Unknown Object (File)
Tue, May 7, 9:12 PM
Unknown Object (File)
Tue, May 7, 9:12 PM
Unknown Object (File)
Tue, May 7, 9:10 PM
Unknown Object (File)
Mar 27 2024, 11:55 PM
Unknown Object (File)
Mar 27 2024, 11:55 PM
Unknown Object (File)
Mar 27 2024, 11:55 PM
Subscribers

Details

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.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable