This message was deleted.
# aws
s
This message was deleted.
s
@elegant-pager-5412, you need to make sure that your Lambda has the
AWSLambdaBasicExecutionRole
specified.
Or an equivalent custom policy of course.
e
@shy-house-53993 Hey Simon! How do I ensure that? The way I got around it at the moment is by using the
Copy code
aws.iam.ManagedPolicy.CloudWatchLogsFullAccess
policy, which isn’t ideal. I would love to be able to great a log group with specific retention days
Also would love to give each lambda specific queue access and not
AmaazonSQSFullAccess
s
One moment. Grabbing the code I have.
e
Thing is that I can’t pass
Output
objects to the
policies
property on the
CallbackFunction
s
Copy code
aws.cloudwatch.onSchedule(
  'rate(1 minute)',
  new aws.lambda.CallbackFunction('get-team-leads', {
    policies: [aws.iam.ManagedPolicy.AWSLambdaBasicExecutionRole, aws.iam.ManagedPolicy.AWSLambdaRole],
    callback: async (e) => {
      console.log('Running...');
Etc...
e
I see
but this isn’t very specific, isn’t it?
s
That's not what you asked for...
e
I mean, how can you send all logs to a specific log group with retention days?
Yea you’re right, sorry
s
Totally different question 🙂
e
Yea you’re right 😕
got greedy haha
s
Sorry, don't have any insight on your more specific problem. Only been playing with Pulumi a week myself.
e
Yea
Playing for Pulumi for the past few days
It’s nice, but missing more concrete examples, in my opinion
r
@elegant-pager-5412 when you say “missing more concrete examples”, are you referring to things outside the ones available here: https://github.com/pulumi/examples?
e
@red-match-15116 yea. While there are various examples for all supported languages, the examples are simple and do not reflect real life scenarios (in my opinion). I would love it if the examples would also nourish a style guide and best practices as-well. I don’t think anyone here would go ahead and create an
index.ts
file with 600 lines of code as a production code. They would split the code and will also split the logic from the infrastructure, so I don’t expect to see actual handler code along with the infrastructure definition
r
They would split the code and will also split the logic from the infrastructure, so I don’t expect to see actual handler code along with the infrastructure definition
It seems like you are looking for a very specific real world scenario that matches your exact use case. It is expected that users will decide what works best for them. The purpose of the examples is to demonstrate how Pulumi would fit into those scenarios, but we have built a purposefully generalized tool and providing examples for all possible use cases would be frankly impossible 😄
e
@red-match-15116 I’m not really looking for a very specific real world scenario. I’m looking for “best practices”, but sure, we just eventually do whatever we feel comfortable with. Giving examples for every possible scenario is indeed impossible 🙂