Deploy and specify application variables

Spin supports application variables. Instead of being static, their values can be updated without modifying the application, creating a simpler experience for rotating secrets, updating API endpoints, and more.

👍

If this is the first time you're deploying a Spin application or you don't want to specify application variables go to the Quickstart guide. It'll walk you through the process of creating a new Spin application, using JavaScript, TypeScript, or Rust, and deploying it to Akamai Functions.

For example, consider a Spin application with the following variable declaration as part of the application manifest (spin.toml).

[variables]  
compression_level = { default = "1" }

When deploying the Spin application to Akamai Functions, you can set variables by providing --variable flags and passing the key and value using the key=value format. See the following spin aka deploy command, which changes the value of the compression_level variable to 3.

👍

In this example spin aka deploy does not include any code changes. However, the changes are propagated as a new deployment, so you will see the version increment.

spin aka deploy --variable compression_level=3
Deploying updated version of app my-app in account your-account (version 1 → 2)
OK to continue? yes
Waiting for app to be ready... ready

App Routes:
- my-app: https://ec8a19d8-6d10-4056-bb69-cc864306b489.fwf.app (wildcard)
👍

spin aka deploy can point to a spin.toml file by using the --file option.

Application variables can also be used to configure secrets as they are encrypted by default on the Akamai Functions platform. Once deployed, application variables are encrypted at rest and in transit for the entirety of the lifetime of the application.

🚧

While application variables are encrypted, the underlying cryptographic implementations have not been assessed for PCI compliance.


Did this page help you?