Configuration

Enabling Funk will incur fees based on the number of requests made. Refer to the Pricing & Fee Schedule for more information.

Soracom Funk settings are found in Soracom Air or Soracom Inventory group settings.

Funk settings are shared among all device types within the same group. This means that you can configure Funk for one device type (cellular, Sigfox, LoRaWAN, or Inventory), and all other device types within that group will also use the same Funk settings.

If you want to use different Funk settings for different device types, simply create multiple groups each with different Funk settings, and assign your devices accordingly.

To configure Funk, open the settings page of the group that you want to configure.

Underneath the Basic Settings tab, click the SORACOM Funk panel to expand its settings.

Funk configuration

Enable Funk by switching the option to ON.

You can then select the Service where you would like Funk to send data, and provide configuration parameters for the service.


Parameters

When selecting the AWS Lambda service, you can also append :{VERSION} to the end of the resourceUrl to specify which version of your function should be called.

When selecting the Google Cloud Functions service, the Credentials setting is not required. Refer to Google Cloud Functions documentation for different techniques to authenticate requests.

Multiple Credentials

When selecting the AWS Lambda or Azure Functions service, you must select an X.509 certificate in the Credentials parameter that Funk will use for authenticating the connection to your cloud function service. By default, selecting a single Credentials will tell Funk to use the same X.509 certificate credentials no matter which device is connecting to the Funk entry point.

You can alternatively use a #{imsi} or #{imei} placeholder variable in the Credentials parameter. When a device connects to the Funk entry point, Funk will subtitute the placeholder variable with the subscriber IMSI or device IMEI, and then use the credential set that matches the resulting ID.

For example, by registering the following X.509 certificates:

Then when the Credentials parameter is set to device-#{imsi}, Funk will dynamically select the correct credential set when either device connects to the Funk entry point.

Default Credentials

In some situations, Funk will not be able to find matching Credentials. This may occur because you are using a new SIM or device, and have not yet registered a new set of X.509 certificates that will be used for that subscriber IMSI or device IMEI.

If Funk cannot find Credentials that match the ID, it will then replace the #{imsi} or #{imei} placeholder variable with the string default and attempt to find a credential set that matches the resulting ID. In the example above, if a device using a SIM with IMSI 295050012345680 connects to the Funk entry point, Funk will not be able to find any credential sets that match the device-295050012345680 ID, and will instead look for a credential set that matches the device-default ID.

By registering a Default Credential, you can ensure that devices are still able to securely connect to your cloud function service. Depending on your cloud function, you may choose to enforce specific security policies associated with this default credential.

When using the #{imsi} placeholder, Funk will always be able to infer the subscriber IMSI. The default string is used only when a credential set that matches the ID is not found.

On the other hand, when using the #{imei} placeholder, the default string will be used in both of the following situations:

  • The device IMEI is reported from the network, but a matching credential set is not found.
  • The device IMEI is not reported from the network.

Advanced Configuration

Funk can also be configured through the Soracom API or CLI by using the SoracomFunk namespace.

Configuration Structure

"SoracomFunk": {
  "enabled": true|false,
  "destination": {
    "provider": "aws"|"azure"|"google",
    "service": "lambda"|"function-app"|"cloud-functions",
    "resourceUrl": "https://example.com/path/to/resource"
  },
  "credentialsId": {
    "$credentialsId": "my-credentials",
  },
  "contentType": "unspecified"|"application/json"|"text"|"binary"
}

Parameters

Enable or disable Funk:

Modify the Funk destination:

Modify credentials to use for authentication (this parameter has no effect when using Google Cloud Functions):

Modify data processing behavior:

Sample configurations

For AWS Lambda:

[
  {
    "key": "enabled",
    "value": true
  },
  {
    "key": "destination",
    "value": {
      "provider": "aws",
      "service": "lambda",
      "resourceUrl": "arn:aws:lambda:us-east-1:900012345678:function:my-lambda-function"
    }
  },
  {
    "key": "$credentialsId",
    "value": {
      "my-aws-credentials"
    }
  },
  {
    "key": "contentType",
    "value": "application/json"
  }
]