Socket
Book a DemoInstallSign in
Socket

github.com/atb-as/cleos/functions/upload-gcs-object-sftp

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/atb-as/cleos/functions/upload-gcs-object-sftp

v0.0.0-20211007053039-830b72333d31
Source
Go
Version published
Created
Source

Cloud function for uploading a GCS Object to SFTP

This directory contains a Go package suitable for deployment to Google Cloud Functions

UploadGCSObjectToSFTP

UploadGCSObjectToSFTP is designed to be triggered by Cloud Storage events of type google.storage.objects.finalize

It retrieves the contents of the GCS Object and tries to store it on a remote SFTP endpoint.

Retries should be enabled when deploying to work around transient failures.

Configuration

Environment

UploadGCSObjectToSFTP expects to find these environment variables:

  • SECRET_NAME: The full path to the Cloud Secret that holds the SSH private key to use when authenticating with the remote SFTP endpoint.

    Example value: projects/my-project/secrets/my-secret/versions/latest

    Creating a secret:

    $ gcloud secrets create $SECRET_NAME --data-file=id_rsa
    
  • SSH_USERNAME: The username of the SSH user to authenticate as.

  • SSH_HOST: The address of the SFTP endpoint. Example value: 2.tcp.ngrok.io:18745

  • SFTP_DIR: Absolute path to the directory on the remote SFTP endpoint to put the GCS Object in.

Deployment

gcloud functions deploy $FUNCTION_NAME --region=europe-west1 --runtime=go113 ---trigger-resource $TRIGGER_BUCKET --trigger-event google.storage.object.finalize

Manual invocations

$ gsutil cp somefile.txt gs://configured_bucket

FAQs

Package last updated on 07 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.