def _depend_on_lambda_permissions_using_tag(self, bucket, permission):
properties = bucket.get('<STR_LIT>', None)<EOL>if properties is None:<EOL><INDENT>properties = {}<EOL>bucket['<STR_LIT>'] = properties<EOL><DEDENT>tags = properties.get('<STR_LIT>', None)<EOL>if tags is None:<EOL><INDENT>tags = []<EOL>properties['<STR_LIT>'] = tags<EOL><DEDENT>dep_tag = {<EOL>'<STR_LIT>' + permission.logical_id: {<EOL>'<STR_LIT>': [<EOL>permission.resource_attributes[CONDITION],<EOL>ref(permission.logical_id),<EOL>'<STR_LIT>'<EOL>]<EOL>}<EOL>}<EOL>properties['<STR_LIT>'] = tags + get_tag_list(dep_tag)<EOL>return bucket<EOL>
Since conditional DependsOn is not supported this undocumented way of
implicitely  making dependency through tags is used.

See https://stackoverflow.com/questions/34607476/cloudformation-apply-condition-on-dependson

It is done by using Ref wrapped in a conditional Fn::If. Using Ref implies a
dependency, so CloudFormation will automatically wait once it reaches that function, the same
as if you were using a DependsOn.