```const filesBucket = new aws.s3.Bucket('filesBuc...
# getting-started
Copy code
const filesBucket = new aws.s3.Bucket('filesBucket')

const createNewFile = () => {
    new aws.s3.BucketObject(
            bucket: filesBucket,
            content: ''

const createNewFileSchedule: aws.cloudwatch.EventRuleEventSubscription = aws.cloudwatch.onSchedule(
    "rate(2 minutes)",
Is there something I’m doing wrong with the
function? I’m not seeing new files show up in the Bucket on AWS
This isn't going to work, when you pass a function like that with pulumi the function is serialized so that it can be passed to the resource. Then that function is executed later with a different process, in a different context. So it no longer occurs during your pulumi up invocation, and pulumi is not available when it is executed, nor is your stack or any other state information about that deployment. The deployment has finished at that point.
👍 1