From b3702bc4c94336251419f93adc7b33c2c40f5375 Mon Sep 17 00:00:00 2001 From: SamyOubouaziz Date: Tue, 19 Mar 2024 10:13:27 +0100 Subject: [PATCH] docs(GEN): content review MTA-4314 (#2866) * docs(GEN): content review MTA-4314 * docs(GEN): udapte * docs(GEN): udapte * Apply suggestions from code review Co-authored-by: Jessica <113192637+jcirinosclwy@users.noreply.github.com> * docs(GEN): update * Update package-function-dependencies-in-zip.mdx * Apply suggestions from code review Co-authored-by: Jessica <113192637+jcirinosclwy@users.noreply.github.com> * docs(GEN): update --------- Co-authored-by: Jessica <113192637+jcirinosclwy@users.noreply.github.com> --- .../how-to/switch-account-to-corporate.mdx | 22 +++--- menu/navigation.json | 2 +- .../package-function-dependencies-in-zip.mdx | 73 ++++++++++--------- .../how-to/access-objects-via-https.mdx | 19 ++--- 4 files changed, 59 insertions(+), 57 deletions(-) diff --git a/console/account/how-to/switch-account-to-corporate.mdx b/console/account/how-to/switch-account-to-corporate.mdx index f4bd97d5e9..65dae4e467 100644 --- a/console/account/how-to/switch-account-to-corporate.mdx +++ b/console/account/how-to/switch-account-to-corporate.mdx @@ -7,38 +7,34 @@ content: paragraph: This page explains how to switch from a personal to a corporate account using the Scaleway console. tags: change switch account personal corporate business account dates: - validation: 2023-09-03 + validation: 2024-03-12 posted: 2023-09-03 categories: - console --- - -Scaleway offers two profile types: Personal and Corporate. All users are given the possibility to select one or the other option when first signing up for a Scaleway account. If you signed up for a personal account and need to convert to a corporate one, follow these instructions. - +Scaleway allows you to choose between two types of account: Personal and Corporate. All users are given the possibility to select one or the other option when first signing up for a Scaleway account. If you signed up for a personal account and need to convert to a corporate one, follow these instructions. Switching to a corporate account is permanent. You will not be able to switch back to a personal account once the conversion to corporate is completed. + +- A Scaleway account logged into the [console](https://console.scaleway.com) - - - You have a [Scaleway](https://www.scaleway.com/en/) account. - +1. From your [Organization dashboard](https://console.scaleway.com/organization), click [Billing](https://www.scaleway.com/en/docs/faq/billing) in the top right drop-down menu. The **Billing** dashboard displays. +2. Click the **Payment and billing tab**. -1. Log into the [Scaleway console](https://console.scaleway.com). -2. Navigate to the [Billing](https://www.scaleway.com/en/docs/faq/billing) tab of your Organization dashboard. Your billing information displays: - -3. Click **Edit** to modify your account information. A pop-up displays with your personal information. +3. Scroll down to billing information, then click **Edit**. A pop-up with your billing information displays. 4. Check the box at the top to confirm you wish to have a corporate account. A new form displays. -5. Enter your company's information including a name, address and valid VAT number. +5. Enter your company's information, including name, address and valid VAT number. European B2B customers are exempted from VAT, as long as they provide a registered VAT number. Learn more about our [tax policy](/faq/billing/#do-the-prices-shown-on-the-website-include-eu-vat). -6. Click **Confirm changes** to effectively convert your account from personal to corporate. +6. Click **Confirm changes** to permanently convert your account from personal to corporate. diff --git a/menu/navigation.json b/menu/navigation.json index e3493bbcf4..13391d5cf3 100644 --- a/menu/navigation.json +++ b/menu/navigation.json @@ -1133,7 +1133,7 @@ "slug": "test-a-function" }, { - "label": "Package function dependencies in a zip-file", + "label": "Package function dependencies in a zip file", "slug": "package-function-dependencies-in-zip" }, { diff --git a/serverless/functions/how-to/package-function-dependencies-in-zip.mdx b/serverless/functions/how-to/package-function-dependencies-in-zip.mdx index e8a8cf6d88..af28d51fe7 100644 --- a/serverless/functions/how-to/package-function-dependencies-in-zip.mdx +++ b/serverless/functions/how-to/package-function-dependencies-in-zip.mdx @@ -7,65 +7,72 @@ content: paragraph: This page explains how to package your code and upload it as a zip to Serverless Functions Console tags: functions zip-file dates: - validation: 2023-08-28 + validation: 2024-03-18 posted: 2021-05-26 categories: - serverless --- -This page explains how to upload your functions and their dependencies as a ZIP file using the Scaleway console. -This feature can help you to add your libraries or static files to your function. +This page explains how to upload your functions and their dependencies as a zip file using the Scaleway console. +This feature allows you to add your libraries or static files to your function. - - - You have an account and are logged into the [Scaleway console](https://console.scaleway.com) - - You have [created a functions namespace](/serverless/functions/how-to/create-a-functions-namespace/) - - You know how to [create a Function](/serverless/functions/how-to/create-a-function/) - - -There are [different methods to deploy functions](/serverless/functions/reference-content/deploy-function/) and some of them require -the function to be packaged into a `zip` file. +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization +- A [Functions namespace](/serverless/functions/how-to/create-a-functions-namespace/) ## How to package a function into zip file +There are [different methods to deploy functions](/serverless/functions/reference-content/deploy-function/) and some of them require the function to be packaged into a `zip` file. + To match the Scaleway build pipelines requirements, functions zip files must contain the content of the root folder you want to publish. -✅ Example of a good archive: +### Example of a good archive + +The file containing the [handler](/serverless/functions/concepts/#handler) of the function is located at the root of the archive. + ``` -myFunc.zip contains: +myFunction.zip └── handler.js ``` -❌ Example of a bad archive: +### Example of a bad archive + +The file containing the [handler](/serverless/functions/concepts/#handler) of the function is located in a folder, and not at the root of the archive. + ``` -myFunc.zip contains: -└── myFunc/ (a folder) +myFunction.zip +└── myFunction/ └── handler.js ``` +### Creating a zip file + To create an archive of folder content, you can use the `zip` command: ```sh -zip -r handler.zip handler/ +zip -r myFunction.zip myFunction/ ``` To check if your archive is well-formed, ensure you have your function code as soon as you `unzip` it. - ## How to upload your zip file to the Scaleway console 1. Package your dependencies on your local computer, as explained in the [Configure your package](/serverless/functions/how-to/package-function-dependencies-in-zip/#how-to-zip-your-function) section. -2. Create a **ZIP** archive containing the files and folders you need. -3. Go to the [Functions](https://console.scaleway.com/functions/namespaces) section of the Scaleway console and click on the function namespace you want to configure. +2. Create a **zip** archive containing the files and folders you need. +3. Go to the [Functions](https://console.scaleway.com/functions/namespaces) section of the Scaleway console and click on the functions namespace you want to use. 4. Click **+ Create function**. The function creation page displays. 5. On the function creation page, choose your desired runtime. -6. Select **Upload a ZIP** in **Function code**. -7. Drag and drop your ZIP file in the reserved field or upload it. +6. Select **Upload a ZIP** under **Function code**. +7. Drag and drop your zip file in the reserved field or upload it. 8. Specify your **handler** path. 9. Configure your function. 10. Click **Create function** to finish. + + Refer to our [dedicated documentation](/serverless/functions/how-to/create-a-function/) for more information on how to create Serverless Functions + ## How to upload your zip file using the Scaleway API @@ -76,7 +83,7 @@ To check if your archive is well-formed, ensure you have your function code as s In this section, you will upload your code to a S3 bucket, which we will package and build into a container image. The created container image will then be available in a registry namespace associated to your functions namespace. -1. Set an environment variable to name the ZIP file automatically. +1. Set an environment variable to name the zip file automatically. ```bash export FUNCTION_ARCHIVE="function-$SCW_FUNCTION_ID.zip" ``` @@ -199,7 +206,7 @@ In some specific cases, you might need to install libraries that require specifi - psycopg2 and others. -Our Python runtimes run on top of [Alpine linux](https://alpinelinux.org/) environments, for these specific dependencies, you will have to install your dependencies inside a **Docker container**, with a specific image, that we are providing to our users. +Our Python runtimes run on top of [Alpine Linux](https://alpinelinux.org/) environments, for these specific dependencies, you will have to install your dependencies inside a **Docker container**, with a specific image, that we are providing to our users. Run the following command from the root of your project to install your dependencies before uploading your source code and deploying your function: ```bash @@ -207,7 +214,7 @@ PYTHON_VERSION=3.10 # or 3.7, 3.8, ... docker run --rm -v $(pwd):/home/app/function --workdir /home/app/function rg.fr-par.scw.cloud/scwfunctionsruntimes-public/python-dep:$PYTHON_VERSION pip install -r requirements.txt --target ./package ``` -This command will run `pip install` with the given `requirements.txt` file inside a docker container compatible with our function runtimes, and pull the installed dependencies locally to your package directory. As these dependencies have been installed on top of alpine Linux with our compatible system libraries, you will be able to upload your source code and deploy your function properly. +This command will run `pip install` with the given `requirements.txt` file inside a docker container compatible with our function runtimes, and pull the installed dependencies locally to your package directory. As these dependencies have been installed on top of Alpine Linux with our compatible system libraries, you will be able to upload your source code and deploy your function properly. ## How to configure your package using Node @@ -269,7 +276,7 @@ If your handler is in a subdirectory, the handler name should be prefixed by the ``` 2. Upload the archive in the console. -3. Provide a custom handler name. Each of your function will know which handler file to run: +3. Provide a custom handler name. Each of your functions will know which handler file to run: - For the file `handler.go` at the root of the project → `Handle`. @@ -358,12 +365,6 @@ Our runtimes automatically install your dependencies at **Build time** (once you Dependencies installation at the build-time results in longer builds. - - How to create a function - How to manage a function - - - ## How to manage multiple handles in the same zip file To enhance deployment simplicity, all runtimes support the inclusion of multiple handlers, either within a single file or across multiple files. @@ -376,5 +377,9 @@ Example: └── myFuncB.lang (contains handlerC()) ``` -Like that, you can create 3 functions with the same zip file by just changing the `handler` parameter -to match the handler you want. +This way, you can package 3 functions within the same zip file, and execute the desired one by changing the `handler` parameter to match the handler you want. + + + How to create a function + How to manage a function + diff --git a/storage/object/how-to/access-objects-via-https.mdx b/storage/object/how-to/access-objects-via-https.mdx index 1af8731423..0acf27a0ea 100644 --- a/storage/object/how-to/access-objects-via-https.mdx +++ b/storage/object/how-to/access-objects-via-https.mdx @@ -7,32 +7,33 @@ content: paragraph: This page explains how to access objects via HTTPS. tags: object storage object-storage download https dates: - validation: 2023-09-05 + validation: 2024-03-12 posted: 2023-09-05 categories: - storage - object-storage --- - +Scaleway Object Storage allows you to access your objects via HTTPS. -- A Scaleway account logged into the [console](https://console.scaleway.com) -- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization -- An [Object Storage bucket](/storage/object/how-to/create-a-bucket/) -- An object whose [visibility](/storage/object/how-to/manage-object-visibility) is set to public +If an object is [private](/storage/object/how-to/manage-object-visibility/), you can create a temporary public link from the [Scaleway console](https://console.scaleway.com). +If an object is public, you can retreive the link to access it from the [Scaleway console](https://console.scaleway.com). -You can access your files via HTTPS by creating a public link from the Scaleway console. + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Created an Object Storage bucket](/storage/object/how-to/create-a-bucket/) and have [uploaded objects](storage/object/how-to/upload-files-into-a-bucket) to it 1. Click **Object Storage** on the side menu. The list of your buckets displays. 2. Click the bucket that contains the file you want to access. A list of your objects displays. 3. Click next to the file you want to access. 4. Select **Get public link**. 5. Set an expiration date. -6. Click **Generate link**. Your temporary file public link displays. +6. Click **Generate link**. Your temporary public link displays. - To get a permanent link to an object, [change its visibility](/storage/object/how-to/manage-object-visibility/) to **public**. + To make the link to an object permanent, [change its visibility](/storage/object/how-to/manage-object-visibility/) to **public**. The link will work as long as the object is public.