title: How to run the following command on 3 different regions?
body: <p>I wrote the following Groovy code:</p>
  
  <pre><code>#!/usr/local/bin/groovy
  def p = ['/usr/local/bin/aws', 'ec2', 'describe-vpcs'].execute() | 'grep -w CidrBlock'.execute() | ['awk', '{print $2}'].execute() | ['tr', '-d', '"\\"\\|,\\|\\{\\|\\\\["'].execute() | 'uniq'.execute()
  p.waitFor()
  def output = []
  p.text.eachLine { line -&gt;
          output &lt;&lt; line
  }
  
  output.each {
          println it
  }
  </code></pre>
  
  <p>The output looks like so:</p>
  
  <pre><code>172.31.0.0/16
  172.60.0.0/16
  172.54.0.0/16
  172.59.0.0/16
  </code></pre>
  
  <p>The output of this code is being added to an Extended Parameter in Jenkins and displays a list of CIDR blocks in use.</p>
  
  <p>Currently, the command only returns output for the default region which is us-west-2.</p>
  
  <p>I would like to run this code and collect all CIDR blocks in use from all regions (in my case it's Oregon [us-west-2], Ireland [eu-west-1] and Virginia [us-east-1]).</p>
  
  <p>How can it be done?</p>