Integrating AWS using Terraform

Run the Terraform integration code from a dedicated workspace/state. Do not interfere with Production resource provisioning.

Before you begin

  • Use Terraform v0.13 or later. To check your version of Terraform, run: terraform --version

  • AWS CLI must be installed on your workstation. Go here for instructions.

  • Configure AWS credentials on your workstation. To configure AWS CLI installation, run: aws configure

  • Create IAM user with the roles needed to run AWS

  • Select your AWS region or select all regions

  • To verify you fulfilled these requirements, at your terminal, run the command: cat ~/.aws/credentials && terraform init && terraform --version

Procedure

  1. In Firefly, go to the left pane > Settings > Integrations.

  2. Select Add New > AWS > Terraform.

  3. Add an Integration Nickname.

  4. (Optional) Select the Event-driven checkbox and select your AWS region(s) OR Select all regions.

  5. (Optional) Select S3 Event Notifications of TF State Files, enter your Region and Bucket Names, and select Add.

  6. Select Next.

  7. Copy the details created by the wizard, and paste them into the Terraform code file.

  8. In same the directory that contains the provided code, run: terraform init

  9. Run the command: terraform apply

  10. Select Done.

Using the Event-driven method for fetching your IaC stacks ensures that Firefly refreshes your assets in the inventory in near real-time as soon as they change. This method is the optimal choice for maintaining an up-to-date inventory of your assets.

By setting up S3 Event Notifications for Terraform State Files, Firefly can monitor updates to your IaC stacks stored in S3 buckets and optimize the IaC status in the system.

Last updated