Could I get some eyes? Pretty pretty please? I w...
# aws
a
Could I get some eyes? Pretty pretty please? I want to create an alias with the functionVersion being what it is now. Is there a way to fetch the current version so it doesn't get changed each time I
pulumi up
?
Copy code
const lambdaAlias = new aws.lambda.Alias("DEV", {
      functionName: routeKey + "DEV",
   // functionVersion: "1", // how do I get this to pull from the current alias instead of overriding with "1" each time I pulumi up?
  });
(side note, our devops is going to change the function version outside of this project when we canary deploy, so we don't want it overriding)
l
There is no Pulumi-native way to do this. You would have to use the AWS SDK to get the information.
👋 1
w
how do I get this to pull from the current alias instead of overriding with "1" each time I pulumi up?
If I understand your scenarios correctly - I believe you can use https://www.pulumi.com/docs/reference/pkg/aws/lambda/getfunction/#version_nodejs.
Copy code
const lambdaAlias = new aws.lambda.Alias("DEV", {
    functionName: routeKey + "DEV",
    functionVersion: aws.lambda.getFunction({functionName: routeKey + "DEV"}).version,
});
l
That's my learn for the day. I'm off home now.
😉 1