Hi,
I’m using the data resource aws_security_group to lookup an SG ID. However I require a read timeout as the SG will not be available for a few minutes. By default it seems to timeout after 2 mins. According to the documentation I can add a read timeout like below:
data “aws_security_group” “this” {
vpc_id = module.vpc.vpc_id
tags = {
Name = “some-sg”
}
timeouts {
read = “10m”
}
}
Yet it still times out after 2 mins.
I am using:
Terraform v1.7.4
hashicorp/aws v5.58.0
For anyone wondering why I need a timeout… The code deploys an EC2 & VPC. The EC2 requires a SG. But the SG is created via an AWS firewall manager policy (handled outside of this code). And hence the delay, as it takes several minutes for FW manage to create the SG when a new VPC is created.