Hi I have designed a function to create redshift cluster and getting its properties. How I can automate that function writeinconfig file trigger only when cluster status become available.
def prettyRedshiftProps(props):
pd.set_option('display.max_colwidth', -1)
keysToShow = ["ClusterIdentifier", "NodeType", "ClusterStatus", "MasterUsername", "DBName",
"Endpoint", "NumberOfNodes", 'VpcId']
x = [(k, v) for k,v in props.items() if k in keysToShow]
return pd.DataFrame(data=x, columns=["Key", "Value"])
myClusterProps = redshift.describe_clusters(ClusterIdentifier=DWH_CLUSTER_IDENTIFIER)
['Clusters'][0]
prettyRedshiftProps(myClusterProps)
function for writing values of clusterprop in another config file.
# trigger the function when cluster status become available
def writeinconfig :
{
''' write values of clusterprops in config file'''
}