This container does the following:
- Read a file from an HTTP request form
- Store the file in S3
- You have an account and are logged into the Scaleway console
- You have created an API key in the console, with at least the
ObjectStorageFullAccess
,ContainerRegistryFullAccess
, andFunctionsFullAccess
permissions, plus access to the relevant project for Object Storage - You have Terraform installed on your machine
- You have logged in to the Scaleway Container Registry (
scw registry login
)
First you need to set the following environment variables:
export TF_VAR_access_key=<your API access key>
export TF_VAR_secret_key=<your API secret key>
export TF_VAR_project_id=<your project id>
Deployment can be done by running:
terraform init
terraform plan
terraform apply
You can then query your function by running:
# Upload a random Terraform file to the bucket
curl -F [email protected] $(terraform output -raw endpoint)
You can get the bucket name with:
terraform output -raw bucket_name
You should then see the requirements.txt
file uploaded to your bucket.