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, andFunctionsFullAccesspermissions, 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 applyYou can then query your function by running:
# Upload a random Terraform file to the bucket
curl -F file=@container.tf $(terraform output -raw endpoint)You can get the bucket name with:
terraform output -raw bucket_nameYou should then see the requirements.txt file uploaded to your bucket.