source_interfaces:
cloudify.interfaces.relationship_lifecycle:
preconfigure:
implementation: webAppConnectedToLoadBalancer.py
inputs:
process:
env:
LOAD_BALANCER_IP: { get_attribute: [LoadBalancerCompute, ip] }
from cloudify import ctx
import os
ctx.logger.info('Just logging the database IP: _____{0}_____'.format(os.environ.get('LOAD_BALANCER_IP')))
ctx logger info "Just logging the database IP: ${LOAD_BALANCER_IP}"
source_interfaces:
cloudify.interfaces.relationship_lifecycle:
preconfigure:
implementation: webAppConnectedToLoadBalancer.py
inputs:
process:
env:
LOAD_BALANCER_IP: { get_attribute: [ TARGET, ip ] }
def eval_script(script_path, ctx, process=None): | |
ctx logger info "Username is ${SQL_USERNAME}"
Found out that if the script is a python script and eval_script is not set to false in the Process configuration options, the environment variables are not injected (atleast for v 3.1).
Thanks to Dan Kilman for his inputs about the cloudify.state import ctx_parameters