conditional aws functoin check