-
Notifications
You must be signed in to change notification settings - Fork 11
feat: PHP + S3 example #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
43177b1
to
e8895ae
Compare
update = "15m" | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use Terraform to zip the function directly:
data "archive_file" "function_archive" { | |
type = "zip" | |
source_dir = "${path.module}/../function/" | |
output_file_mode = "0666" | |
output_path = "${path.module}/../function/function.zip" |
And then add this to the function resource:
zip_file = data.archive_file.function_archive.output_path
zip_hash = data.archive_file.function_archive.output_sha
Stolen from here: https://github.com/scaleway/serverless-examples/blob/main/functions/redis-tls/terraform/main.tf
But a MakeFile is good also because it explains better how to zip 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion, I think I will switch to TF because otherwise we're making another assumption about the environment and existence of a zip
command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Some examples:
Generating the key: https://github.com/cyclimse/severless-pypi/blob/main/deploying/terraform/iam.tf
And passing it to a container: https://github.com/cyclimse/severless-pypi/blob/main/deploying/terraform/main.tf#L57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to keep this as simple as possible, so will leave it for now but will remember for later!
Summary
Demonstration using PHP and S3 via the AWS PHP SDK.
Checklist