In this example, Fastly IP addresses are obtained using the fastly_ip_ranges data resource. Since this resource doesn't require an API token, no_auth is set to true in the provider configuration. The aws_security_groups data resource is used to retrieve the Security Group ID for the target fastly-src-ip, and then the aws_security_group_rule resource is used to update the rules.
This gist is a concise memo summarizing the key points from the following blog post: https://zenn.dev/jrsyo/articles/841c2d73d85a16
terraform {
required_providers {
fastly = {