community.general.scaleway_function module – Scaleway Function management
Note
This module is part of the community.general collection (version 8.6.4).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.general.scaleway_function
.
New in community.general 6.0.0
Synopsis
This module manages function on Scaleway account.
Requirements
The below requirements are needed on the host that executes this module.
passlib[argon2] >= 1.7.4
Parameters
Parameter |
Comments |
---|---|
HTTP timeout to Scaleway API in seconds. Default: |
|
Scaleway OAuth token. |
|
Scaleway API URL. Default: |
|
Description of the function. Default: |
|
Environment variables of the function. Injected in function at runtime. Default: |
|
The length of time your handler can spend processing a request before being stopped. |
|
The |
|
Maximum number of replicas for the function. |
|
Resources define performance characteristics of your function. They are allocated to your function at runtime. |
|
Minimum number of replicas for the function. |
|
Name of the function. |
|
Function namespace identifier. |
|
Privacy policies define whether a function can be executed anonymously. Choose Choices:
|
|
List of parameters passed to the query string. Default: |
|
Redeploy the function if update is required. Choices:
|
|
Scaleway region to use (for example Choices:
|
|
Runtime of the function See https://www.scaleway.com/en/docs/compute/functions/reference-content/functions-lifecycle/ for all available runtimes |
|
Secret environment variables of the function. Updating those values will not output a Injected in function at runtime. Default: |
|
Indicate desired state of the function. Choices:
|
|
Validate SSL certs of the Scaleway API. Choices:
|
|
Wait for the resource to reach its desired state before returning. Choices:
|
|
Time to wait before every attempt to check the state of the resource. Default: |
|
Time to wait for the resource to reach the expected state. Default: |
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Notes
Note
Also see the API documentation on https://developer.scaleway.com/.
If
api_token
is not set within the module, the following environment variables can be used in decreasing order of precedenceSCW_TOKEN
,SCW_API_KEY
,SCW_OAUTH_TOKEN
orSCW_API_TOKEN
.If one wants to use a different
api_url
one can also set theSCW_API_URL
environment variable.
Examples
- name: Create a function
community.general.scaleway_function:
namespace_id: '{{ scw_function_namespace }}'
region: fr-par
state: present
name: my-awesome-function
runtime: python3
environment_variables:
MY_VAR: my_value
secret_environment_variables:
MY_SECRET_VAR: my_secret_value
register: function_creation_task
- name: Make sure function is deleted
community.general.scaleway_function:
namespace_id: '{{ scw_function_namespace }}'
region: fr-par
state: absent
name: my-awesome-function
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The function information. Returned: when Sample: |