Hi everyone. Does anyone know if there's a way to...
# general
g
Hi everyone. Does anyone know if there's a way to prevent the GUID from being added to the end of lambda function names? I'm already using a stage safe naming convention and I'd rather not have to set a reference for each lambda name in the env setting for a lambda
v
i think, if you name the lambda resource explicitly, it will use that name, instead of just setting the pulumi resource name
example:
Copy code
new lambda.Function(
  'lambda-function-example',
  {
    code: new pulumi.asset.FileArchive('../target/function.zip'),
    runtime: 'provided.al2',
    handler: 'handler',
    role: functionrole.arn,
    timeout: 30,
    memorySize: 256,
    environment: {
      variables: {
        a: b,
      },
    },
  },
  {
    deleteBeforeReplace: true,
  },
will create a function with the hash/uid at the end
Copy code
new lambda.Function(
  'lambda-function-example',
  {
    name: 'lambda-function-example'
    code: new pulumi.asset.FileArchive('../target/function.zip'),
    runtime: 'provided.al2',
    handler: 'handler',
    role: functionrole.arn,
    timeout: 30,
    memorySize: 256,
    environment: {
      variables: {
        a: b,
      },
    },
  },
  {
    deleteBeforeReplace: true,
  },
will create a lambda function with the name specified
g
Awesome I'll give this a shot. Appreciate the help
v
No worries 🙂 feel free to message if you have any questions