Packer
Scaleway Builder
Type: scaleway
The scaleway
Packer builder is able to create new images for use with
Scaleway. The builder takes a source image, runs
any provisioning necessary on the image after launching it, then snapshots it
into a reusable image. This reusable image can then be used as the foundation
of new servers that are launched within Scaleway.
The builder does not manage snapshots. Once it creates an image, it is up to you to use it or delete it.
Configuration Reference
There are many configuration options available for the builder. They are segmented below into two categories: required and optional parameters. Within each category, the available configuration keys are alphabetized.
In addition to the options listed here, a communicator can be configured for this builder. In addition to the options defined there, a private key file can also be supplied to override the typical auto-generated key:
ssh_private_key_file
(string) - Path to a PEM encoded private key file to use to authenticate with SSH. The~
can be used in path and will be expanded to the home directory of current user.
Required:
access_key
(string) - The AccessKey corresponding to the secret key. Will be fetched first from the scaleway configuration file. It can also be specified via the environment variable SCW_ACCESS_KEY.secret_key
(string) - The SecretKey to authenticate against the Scaleway API. Will be fetched first from the scaleway configuration file. It can also be specified via the environment variable SCW_SECRET_KEY.project_id
(string) - The Project ID in which the instances, volumes and snapshots will be created. Will be fetched first from the scaleway configuration file. It can also be specified via the environment variable SCW_DEFAULT_PROJECT_ID.zone
(string) - The Zone in which the instances, volumes and snapshots will be created. Will be fetched first from the scaleway configuration file. It can also be specified via the environment variable SCW_DEFAULT_ZONEimage
(string) - The UUID of the base image to use. This is the image that will be used to launch a new server and provision it. See the images list get the complete list of the accepted image UUID. The marketplace image label (egubuntu_focal
) also works.commercial_type
(string) - The name of the server commercial type: C1, C2L, C2M, C2S, DEV1-S, DEV1-M, DEV1-L, DEV1-XL, GP1-XS, GP1-S, GP1-M, GP1-L, GP1-XL, RENDER-S
Optional:
api_url
(string) - The Scaleway API URL to use Will be fetched first from the scaleway configuration file. It can also be specified via the environment variable SCW_API_URLsnapshot_name
(string) - The name of the resulting snapshot that will appear in your account. Default packer-TIMESTAMPimage_name
(string) - The name of the resulting image that will appear in your account. Default packer-TIMESTAMPserver_name
(string) - The name assigned to the server. Default packer-UUIDbootscript
(string) - The id of an existing bootscript to use when booting the server.boottype
(string) - The type of boot, can be either local or bootscript, Default bootscriptremove_volume
(bool) - Remove Volumeapi_token
(string) - The token to use to authenticate with your account. It can also be specified via environment variable SCALEWAY_API_TOKEN. You can see and generate tokens in the "Credentials" section of the control panel. Deprecated, use SecretKey insteadorganization_id
(string) - The organization id to use to identify your organization. It can also be specified via environment variable SCALEWAY_ORGANIZATION. Your organization id is available in the "Account" section of the control panel. Previously named: api_access_key with environment variable: SCALEWAY_API_ACCESS_KEY Deprecated, use ProjectID insteadregion
(string) - The name of the region to launch the server in (par1 or ams1). Consequently, this is the region where the snapshot will be available. Deprecated, use Zone instead
Basic Example
Here is a basic example. It is completely valid as soon as you enter your own access tokens:
{
"type": "scaleway",
"project_id": "YOUR PROJECT ID",
"access_key": "YOUR ACCESS KEY",
"secret_key": "YOUR SECRET KEY",
"image": "UUID OF THE BASE IMAGE",
"zone": "fr-par-1",
"commercial_type": "DEV1-S",
"ssh_username": "root",
"ssh_private_key_file": "~/.ssh/id_rsa"
}
When you do not specify the ssh_private_key_file
, a temporary SSH keypair
is generated to connect the server. This key will only allow the root
user to
connect the server.