beats icon indicating copy to clipboard operation
beats copied to clipboard

FunctionBeat config from S3 or ASM

Open thoward-godaddy opened this issue 3 years ago • 8 comments
trafficstars

What does this PR do?

Allows setting FB_* lambda environment variables to source FunctionBeat configuration from S3 or ASM.

Why is it important?

This avoids hard coding of configuration and simplifies distribution of config updates by changing contents of file stored in S3 or ASM.

Checklist

  • [ ] My code follows the style guidelines of this project
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [x] A configuration for FunctionBeat can be successfully resolved from S3 or ASM given sufficient Lmabda IAM permissions.

How to test this PR locally

Set AWS_* credential environment variables and relevant S3/ASM FB_* environment variables before executing functionbeat-aws.

Use cases

Handle configuration of FunctionBeat Lambda's without re-deployment.

thoward-godaddy avatar Aug 30 '22 19:08 thoward-godaddy

💚 CLA has been signed

This pull request does not have a backport label. If this is a bug or security fix, could you label this PR @thoward-godaddy? 🙏. For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

mergify[bot] avatar Aug 30 '22 19:08 mergify[bot]

:grey_exclamation: Build Aborted

The PR is not allowed to run in the CI yet

the below badges are clickable and redirect to their specific view in the CI or DOCS Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Start Time: 2022-08-31T00:08:08.133+0000

  • Duration: 5 min 33 sec

Steps errors 2

Expand to view the steps failures

Load a resource file from a library
  • Took 0 min 0 sec . View more details here
  • Description: approval-list/elastic/beats.yml
Error signal
  • Took 0 min 0 sec . View more details here
  • Description: githubApiCall: The REST API call https://api.github.com/orgs/elastic/members/thoward-godaddy return the message : java.lang.Exception: httpRequest: Failure connecting to the service https://api.github.com/orgs/elastic/members/thoward-godaddy : httpRequest: Failure connecting to the service https://api.github.com/orgs/elastic/members/thoward-godaddy : Code: 404Error: {"message":"User does not exist or is not a member of the organization","documentation_url":"https://docs.github.com/rest/reference/orgs#check-organization-membership-for-a-user"}

:robot: GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

elasticmachine avatar Aug 30 '22 19:08 elasticmachine

Running make update results in:

Generating NOTICE
go mod tidy
go: finding module for package github.com/elastic/beats/v7/libbeat/logp
github.com/elastic/beats/v7/x-pack/filebeat/build/package/module/cisco/ios tested by
        github.com/elastic/beats/v7/x-pack/filebeat/build/package/module/cisco/ios.test imports
        github.com/elastic/beats/v7/libbeat/logp: module github.com/elastic/beats@latest found (v7.6.2+incompatible), but does not contain package github.com/elastic/beats/v7/libbeat/logp
make: *** [Makefile:173: notice] Error 1

This appears to be unrelated to my PR. How should I proceed?

thoward-godaddy avatar Aug 30 '22 23:08 thoward-godaddy

Appears fmt.Print is not allowed. I did try using logp initially; appears to require a KONAMI code to log to stdout. Would appreciate any guidance on getting logp working in lieu of fmt.

Example: logp.L().Info("Hello World") does not produce any output to stdout.

thoward-godaddy avatar Aug 31 '22 00:08 thoward-godaddy

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

elasticmachine avatar Sep 05 '22 09:09 elasticmachine

This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b aws-config-main upstream/aws-config-main
git merge upstream/main
git push upstream aws-config-main

mergify[bot] avatar Sep 15 '22 11:09 mergify[bot]

This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b aws-config-main upstream/aws-config-main
git merge upstream/main
git push upstream aws-config-main

mergify[bot] avatar Sep 26 '22 06:09 mergify[bot]

This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b aws-config-main upstream/aws-config-main
git merge upstream/main
git push upstream aws-config-main

mergify[bot] avatar Mar 27 '23 11:03 mergify[bot]

Closing this, please reopen if you want to continue development.

Also note that Functionbeat will reach End of Support on October 18, 2023, and is being replaced by the Elastic Serverless Forwarder.

cmacknz avatar Apr 20 '23 19:04 cmacknz