Here is my s3_policy.json
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"mybucket",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
"Resource":[
"arn:aws:s3:::${bucket_name}/*"
],
"Condition": {
"IpAddress": {
"aws:SourceIp": [
"10.xx.xxx.x",
"172.168.xx.x",
........,
.........,
..........,
...........,
]
}
}
}
]
}
I have common repo which I use it for different projects. This common repo has a CIDR IP list in yaml format.
I would like to pull it into my Terraform project so that I can re use the same file instead of hardcoding IP addresses.
I'm unable to figure out a way to automate this instead of hardcoding IP addresses in this repo.