Instead of hard-coding the AMI ID of the Fedora build we want, we can use the `aws_ami` data source to search for it. The Fedora release team has a consistent naming scheme for AMIs, so finding the correct one is straightforward.
Configuring AWS Using Terraform
Prerequisites
The IAM user or role that runs Terraform must have the appropriate permissions.
The iam-policy.json file defines a policy that will allow the Terraform to
manage all of the necessary resources. Before running Terraform, create an IAM
policy and assign it to a user, group, or role. Be sure to replace the AWS
account ID in the various target resource names.
To use an IAM role, set the iam_role Terraform variable when executing
terraform plan/terraform apply.
Create Resources
Terraform will create all resources automatically:
terraform apply