A Terraform provider for managing LINE LIFF (LINE Front-end Framework) applications.
LIFF is a platform provided by LINE for developing web apps that run within the LINE app. This provider allows you to manage LIFF apps as infrastructure-as-code using LIFF Server API.
terraform {
required_providers {
liff = {
source = "sugarshin/liff"
version = "~> 0.0"
}
}
}The provider supports two authentication methods. All credentials can be configured via the provider block or environment variables.
The provider automatically issues a Stateless Channel Access Token (valid for 15 minutes, no issuance limit). This is the recommended approach for CI/CD pipelines.
provider "liff" {
channel_id = var.line_channel_id
channel_secret = var.line_channel_secret
}Or via environment variables:
export LIFF_CHANNEL_ID="your-channel-id"
export LIFF_CHANNEL_SECRET="your-channel-secret"If you already have a Channel Access Token, you can specify it directly. This takes precedence over Option 1.
provider "liff" {
channel_access_token = var.line_channel_access_token
}Or via environment variable:
export LIFF_CHANNEL_ACCESS_TOKEN="your-access-token"channel_access_token(direct specification)channel_id+channel_secret(Stateless Token auto-issuance)- Environment variable fallback for each attribute
| Variable | Description |
|---|---|
LIFF_CHANNEL_ACCESS_TOKEN |
Channel Access Token (direct) |
LIFF_CHANNEL_ID |
LINE Login Channel ID |
LIFF_CHANNEL_SECRET |
LINE Login Channel Secret |
resource "liff_app" "my_app" {
description = "My LIFF App"
permanent_link_pattern = "concat"
bot_prompt = "normal"
scope = ["openid", "profile"]
view {
type = "full"
url = "https://example.com"
module_mode = false
}
features {
qr_code = true
}
}terraform import liff_app.my_app "1234567890-AbCdEfGh"data "liff_apps" "all" {}
output "app_ids" {
value = data.liff_apps.all.apps[*].liff_id
}data "liff_app" "existing" {
liff_id = "1234567890-AbCdEfGh"
}
output "app_url" {
value = data.liff_app.existing.view.url
}Manages the full lifecycle (create, read, update, delete, import) of a LIFF application.
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
description |
String | Optional | - | Name of the LIFF app. Cannot include "LINE" or similar strings. |
permanent_link_pattern |
String | Optional | - | How additional information in LIFF URLs is handled. Only "concat" is supported. |
bot_prompt |
String | Optional | "none" |
Bot link feature setting. One of "normal", "aggressive", "none". |
scope |
List(String) | Optional | - | Array of scopes: "openid", "email", "profile", "chat_message.write". |
view |
Block | Required | - | LIFF app view settings. See view. |
features |
Block | Optional | - | LIFF app feature settings. See features. |
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
type |
String | Required | - | Size of the LIFF app view. One of "compact", "tall", "full". |
url |
String | Required | - | Endpoint URL. Must be HTTPS. |
module_mode |
Bool | Optional | false |
Whether to use the LIFF app in modular mode. |
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
ble |
Bool | Computed | - | Whether the LIFF app supports BLE (read-only). |
qr_code |
Bool | Optional | false |
Whether to use the 2D code reader. |
| Attribute | Description |
|---|---|
liff_id |
The LIFF app ID (e.g., 1234567890-AbCdEfGh). |
Fetches all LIFF apps in the channel.
| Attribute | Description |
|---|---|
apps |
List of LIFF apps. Each element has the same attributes as the liff_app resource. |
Fetches a specific LIFF app by its ID.
| Attribute | Type | Required | Description |
|---|---|---|---|
liff_id |
String | Required | The LIFF app ID to look up. |
All attributes from the liff_app resource are available as computed attributes.
- No individual GET API: The LIFF Server API only provides a "list all" endpoint. The provider fetches all apps and filters by
liff_id. With a maximum of 30 LIFF apps per channel, this has negligible performance impact. features.bleis read-only: BLE (Bluetooth Low Energy) support cannot be set via the API. Thebleattribute is computed only.- Maximum 30 LIFF apps per channel: This is a LINE platform limitation.
go installUnit tests:
make testAcceptance tests (creates real resources):
export LIFF_CHANNEL_ID="your-channel-id"
export LIFF_CHANNEL_SECRET="your-channel-secret"
make testaccmake generate