https://pulumi.com logo
Title
p

plain-parrot-21984

04/03/2023, 11:18 AM
Any idea how to get rid of this warning? I don't want to disable the warning if it's a valid issue, but I can't figure out if I did something wrong from the - very limited - API documentation regarding lambda environment variables
i

incalculable-parrot-23117

04/03/2023, 4:45 PM
Hello! Yep, just change that to the following:
lambda.FunctionEnvironmentArgs{
  Variables: pulumi.StringMap{
    // ...
  },
}
That'll get rid of the warning.
For background, that's a warning generated by Go's default linter set. They consider
Foo{x}
less desirable than
Foo{Bar: x}
because if
Foo
adds a new field, the former will stop compiling. So for exported types, they recommend the latter.
p

plain-parrot-21984

04/04/2023, 5:18 AM
@incalculable-parrot-23117 Super! Thank you. I was reading online about this message and figured that probably something was missing but couldn't figure out what. Where did you find that the missing piece was "Variables" if I may ask?
i

incalculable-parrot-23117

04/04/2023, 4:29 PM
@plain-parrot-21984 Certainly! I looked up the API reference for the lambda package: here's the section on FunctionEnvironmentArgs
p

plain-parrot-21984

04/11/2023, 10:08 AM
Thank you @incalculable-parrot-23117, I appreciate the the insight 💡 It'll help me in the future 😊