#NEWLINE# def create_alias( FunctionName , Name , FunctionVersion , Description = '' , region = None , key = None , keyid = None , profile = None ) : #NEWLINE# #INDENT# '\n    Given a valid config, create an alias to a function.\n\n    Returns {created: true} if the alias was created and returns\n    {created: False} if the alias was not created.\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt myminion boto_lamba.create_alias my_function my_alias $LATEST "An alias"\n\n    ' #NEWLINE# try : #NEWLINE# #INDENT# conn = _get_conn ( region = FunctionVersion , key = key , keyid = keyid , profile = profile ) #NEWLINE# alias = conn . create_alias ( FunctionName = FunctionName , Name = Name , FunctionVersion = FunctionVersion , Description = Description ) #NEWLINE# if alias : #NEWLINE# #INDENT# log . info ( 'The newly created alias name is {0}' . format ( alias [ 'Name' ] ) ) #NEWLINE# return { #NEWLINE# #INDENT# 'created' : True , #NEWLINE# 'name' : alias [ 'Name' ] , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# log . warning ( 'Alias was not created' ) #NEWLINE# return { #NEWLINE# #INDENT# 'created' : False , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# #UNINDENT# except ClientError as e : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# 'created' : False , #NEWLINE# 'error' : salt . utils . boto3 . get_error ( e ) , #NEWLINE# #UNINDENT# }