tandelDipak commented on issue #13691:
URL: https://github.com/apache/airflow/issues/13691#issuecomment-768127146


   @eladkal Yes, I am suggesting something similar. 
   Let say you have EC2Hook already defined with the host value as 
**http://ec2-154-509-231-157.us-west-2.compute.amazonaws.com:8000/**  and I am 
not using static IP so now if I stop my instance and then start it I will get a 
new DNS hostname, but my EC2Hook has an old value of hostname  
**http://ec2-154-509-231-157.us-west-2.compute.amazonaws.com:8000/**. So I have 
to update it every time after I start my instance. Once I update the host 
parameter of EC2Hook, I can use SSHOperator to run commands on a machine. If I 
don't update the value, SSHOperator will fail because EC2Hook is pointing to 
the old hostname which doesn't exist now.  
   
   This is not the case if you have static public IP and there is a limitation 
of static IP you can buy within a region.  
   
   So we can add an option inside the EC2StartInstanceOperator to changes the 
host value of the EC2Hook if the user wants. This will make 
EC2StartInstanceOperator, EC2StopInstanceOperator  more useable. Right now I am 
using my custom function which starts the EC2 instance  (almost similar to 
EC2StartInstanceOperator) and then updates the host value of EC2Hook if I pass 
the connection_id parameter.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to