Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

s3.tf 998 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  1. # New bucket for Lambda deployment packages
  2. resource "aws_s3_bucket" "lambda_code" {
  3. bucket = "${var.project}-lambda-code-bucket"
  4. tags = {
  5. Name = "${var.project}-lambda-code-bucket"
  6. Environment = var.environment
  7. }
  8. }
  9. resource "aws_s3_bucket_public_access_block" "lambda_code_block" {
  10. bucket = aws_s3_bucket.lambda_code.id
  11. block_public_acls = true
  12. block_public_policy = true
  13. ignore_public_acls = true
  14. restrict_public_buckets = true
  15. }
  16. resource "aws_s3_bucket_versioning" "lambda_code_versioning" {
  17. bucket = aws_s3_bucket.lambda_code.id
  18. versioning_configuration {
  19. status = "Enabled"
  20. }
  21. }
  22. # Upload your zipped lambda code to the bucket
  23. resource "aws_s3_object" "lambda_zip" {
  24. bucket = aws_s3_bucket.lambda_code.id
  25. key = "app.zip" # or whatever you name your zip
  26. source = "modules/streaming/lambda/app.zip" # relative path to your zipped code
  27. etag = filemd5("modules/streaming/lambda/app.zip")
  28. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...