Step 4: Deploy Functionbeat

To deploy Functionbeat functions to your cloud provider, either use the Functionbeat manager, as described here, or use your own deployment infrastructure.

If you change the configuration after deploying the function, use the update command to update your deployment.

Deploy to AWS

  1. Make sure you have the credentials required to authenticate with AWS. You can set environment variables that contain your credentials:

    linux and mac:

    export AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOPUSER
    export AWS_SECRET_ACCESS_KEY=EXAMPLE567890devgHIJKMLOPNQRSTUVZ1234KEY
    export AWS_DEFAULT_REGION=us-east-1

    win:

    set AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOPUSER
    set AWS_SECRET_ACCESS_KEY=EXAMPLE567890devgHIJKMLOPNQRSTUVZ1234KEY
    set AWS_DEFAULT_REGION=us-east-1

    Set AWS_DEFAULT_REGION to the region where your services are running.

  2. Make sure the user has the permissions required to deploy and run the function. For more information, see IAM permissions required for deployment.
  3. Deploy the cloud functions.

    For example, the following command deploys a function called cloudwatch:

    linux and mac:

    ./functionbeat -v -e -d "*" deploy cloudwatch

    win:

    .\functionbeat.exe -v -e -d "*" deploy cloudwatch

    The function is deployed to AWS and ready to send log events to the configured output.

    If deployment fails, see Common problems for help troubleshooting.

Deploy to Google Cloud Platform

This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.

  1. In Google Cloud, create a service account that has these required roles:

    • Cloud Functions Developer
    • Cloud Functions Service Agent
    • Service Account User
    • Storage Admin
    • Storage Object Admin

    See the Google Cloud documentation for more information about creating a service account.

  2. Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to the JSON file that contains your service account key. For example:

    linux and mac:

    export GOOGLE_APPLICATION_CREDENTIALS="/path/to/myproject-5a90ee91d102.json"

    win:

    set GOOGLE_APPLICATION_CREDENTIALS="C:\path\to\myproject-5a90ee91d102.json"
  3. Deploy the cloud functions.

    For example, the following command deploys a function called storage:

    linux and mac:

    ./functionbeat -v -e -d "*" deploy storage

    win:

    .\functionbeat.exe -v -e -d "*" deploy storage

    The function is deployed to Google Cloud Platform and ready to send events to the configured output.

    If deployment fails, see Common problems for help troubleshooting.