title: Lambda versions are incremented even i delete the lambda stack(ie.CFN)?
body: <p>I am publishing the NEW lambda version for each of my each lambda function in my cloudformation template using custom resource . This invokes when ever there is an update to the lambda function.</p>
  
  <p>I have two lambda functions in my stack(i.e.<code>STACK1</code>) which are created using CFN template. There Arn's are like this .</p>
  
  <pre><code>arn:aws:lambda:us-east-1:xxxx:function:Pikachuu:1
  arn:aws:lambda:us-east-1:xxxx:function:Pythachuu:1
  </code></pre>
  
  <p>After few updates to my stack(i.e.'STACK1`) it became like this</p>
  
  <pre><code>arn:aws:lambda:us-east-1:xxxx:function:Pikachuu:5
  arn:aws:lambda:us-east-1:xxxx:function:Pythachuu:2
  </code></pre>
  
  <p>Next Step, i had deleted the above stack(i.e.'STACK1<code>) and created a new stack with different name(i.e.'STACK2</code>). When i see the created ARN's of the lambda functions they are like this</p>
  
  <pre><code>arn:aws:lambda:us-east-1:xxxx:function:Pikachuu:6
  arn:aws:lambda:us-east-1:xxxx:function:Pythachuu:3
  </code></pre>
  
  <p>Even i deleted the stack and created a new one with new name i dont know why these lambda ARN's versions are incremented.</p>
  
  <p>When i digged this issue deep , i had found that it is published based on the <code>fuctionname</code> so when i changed the function name then it started with <code>version 1</code>. 
  Even deleting the stack, is not deleting the versions on the function because of  that when i used the same function name it is taking the functions version.</p>
  
  <p>I also checked the lambdas are present or not in lambda console just to double check whether cloudformation is deleting it or not . Yes, Cloudformation is deleting it.</p>
  
  <p>How can i able to avoid this scenario ??</p>
  
  <blockquote>
    <p>BTW: This situation is not occuring when i allow <code>AWS</code> to define my
    lambda function name.</p>
  </blockquote>
  
  <p>Thanks.
  Any help is appreciated</p>