I need to create an S3 bucket and a lambda function using CloudFormation. I have the jar file in my local. If I write resources for the S3 bucket and a lambda function in a single template, I have to provide S3bucket and key in the lambda resource. Stack creation fails, as the jar file doesn't exist in the bucket. So, does this mean that I have to create a bucket separately using a template, upload the jar file, and then create a lambda function using another template?
Is there a way to create both the resources using one template?