title: I want to identify the public ip of the terraform execution environment and add it to the security group
body: <p>I want to identify the public IP of the terraform execution environment
  and add it to aws security group inbound to prevent access from other environments.</p>
  
  <p>Currently, I am manually editing the values in the variables.tf file.</p>
  
  <p>variables.tf</p>
  
  <pre><code>variable public_ip_address {
    default     = "xx"
  }
  </code></pre>
  
  <p>I would like to execute the "curl ifconfig.co" command on the local host and automatically set the security group based on the result</p>
  
  <p>Is there a way to do such things?</p>
  
  <p>I could do it by putting the result of local-exec in some variable
  but I don't know how to do it.</p>
  
  <p>Thank you for reading my question.</p>