title: Can I execute another script with values created from cdk deploy?
body: <p>I'm trying to create EC2 instance with aws CDK and run some scripts to the newly deployed EC2 instance basically like this.</p>
  <p>(Python would be better but cdk deploy seems to be run in shell anyway.)</p>
  <pre><code>cdk deploy &amp;&amp; python script.py -I {new ec2 id} -s {new sg id}
  </code></pre>
  <p>But I need to get the instance id and security group id from <strong>cdk deploy</strong> result and use it as argument of next script, but not sure how can it be done.</p>
  <p>Is it possible for cdk deploy to pass some values after deployment is done without very complex stdout from shell?</p>
  <p>p.s: Other ways such as userdata and cloud-init which can be included in synth time doesn't work for me since it needs to get some other values as parameters from local scripts as well as some imperative procedures such as opening temporary port and close after script run.</p>