Deploy Functionbeat to your cloud provider

edit

Deploy Functionbeat to your cloud provider

edit

After configuring Functionbeat and defining cloud functions for the services you want to monitor, deploy the functions to your cloud provider. To do this, you can use the Functionbeat manager (good for getting started), or use your own deployment infrastructure.

Use the Functionbeat manager

edit

Use the built-in manager to deploy, update, or delete Functionbeat functions when you don’t have your own deployment infrastructure or process in place.

During deployment, the Functionbeat manager:

  • Exports a function template to use for deployment. For AWS, it exports an AWS CloudFormation template. To inspect the template, run the export command.
  • Creates a zip package that includes the function code and functionbeat.yml config file.
  • Uploads the package to the specified cloud provider.

See Step 5: Deploy Functionbeat in the getting started to learn how to deploy functions by using the Functionbeat manager.

Use your own deployment infrastructure

edit

If you don’t want to use the Functionbeat manager, use your own deployment infrastructure. To do this, create a package, then deploy it to your cloud provider:

  1. Set the following environment variables:

    BEAT_STRICT_PERMS=false
    This setting makes the function skip the ownership check on the configuration file.
    ENABLED_FUNCTIONS=function-name-1,function-name-2

    Specifies a comma-separated list of functions that are enabled in the configuration file. For example, to package functions called my-kinesis and my-cloudwatch-logs, run:

    linux and mac:

    export BEAT_STRICT_PERMS=false
    export ENABLED_FUNCTIONS=my-kinesis,my-cloudwatch-logs

    win:

    set BEAT_STRICT_PERMS=false
    set ENABLED_FUNCTIONS=my-kinesis,my-cloudwatch-logs

    For easier management, we recommend having one Lambda per function.

  2. Run the package command to package the functions and dependencies into an archive. For example:

    linux and mac:

    ./functionbeat -v -e -d "*" package --output /path/to/folder/package-{{.Provider}}.zip

    win:

    .\functionbeat.exe -v -e -d "*" package --output /path/to/folder/package-{{.Provider}}.zip

    For --output specify a full path pattern.

    The package command generates deployment packages for each provider specified in the configuration. Each package contains:

    • a binary with the function code
    • the functionbeat.yml config file
  3. If certificates are required, add the cert files to the zip package under the same path as the configured functionbeat.yml file.
  4. Export a function template to use for deployment:

    linux and mac:

    ./functionbeat export function FUNCTION_NAME

    win:

    .\functionbeat.exe export function FUNCTION_NAME

    Functionbeat writes the template to stdout. For AWS functions, it writes an AWS CloudFormation template.

  5. Modify the template to work with your infrastructure.
  6. Deploy the package, using the infrastructure and automation supported by your cloud provider, for example, AWS CloudFormation.

    For more information about deployment, see your cloud provider’s documentation.