<p>Do you already manage your resources with Terraform or are you looking for something to iterate through your AWS environment to change those settings?</p>
<p>If you're currently not managing your environment with Terraform, you'll have to import your resources into Terraform before you can begin making changes to your environment.</p>
<p>Your request sounds more like something you'd use the AWS CLI or perhaps Ansible for. Terraform isn't intended to perform scripting tasks on an environment.</p>

CC BY-SA 4.0
2021-01-05T14:13:29.933Z
2021-01-05T14:13:29.933Z
Jeremy Corbello
<p>Would it be possible to create a script or use something like terraform to mass remove/add security group entries across several regions under the one account based on the security group name? Specifically we are allowing remote access to a few instances based on public addresses that are changing frequently, so updating manually has become tedious. Thanks!</p>

<amazon-web-services><terraform>
Mass remove/add to multiple security groups cross region
Yulia
# Mass remove/add to multiple security groups cross region

(Asked by: username_0 on 2020-12-03)

Would it be possible to create a script or use something like terraform to mass remove/add security group entries across several regions under the one account based on the security group name? Specifically we are allowing remote access to a few instances based on public addresses that are changing frequently, so updating manually has become tedious. Thanks!

**Tags:** amazon-web-services, terraform


---

## 1 answers

### Answer by username_1 on 2021-01-05. Score: 1

Do you already manage your resources with Terraform or are you looking for something to iterate through your AWS environment to change those settings?

If you're currently not managing your environment with Terraform, you'll have to import your resources into Terraform before you can begin making changes to your environment.

Your request sounds more like something you'd use the AWS CLI or perhaps Ansible for. Terraform isn't intended to perform scripting tasks on an environment.


---

