Skip to content

OneMount/slack-find-gcp-ip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Find IP tool

Install & Using

Install app on slack

Add application to slack channel

Go to channel -> Details -> More -> Add apps -> Search {app_name} -> Add to channel

Using

  1. Mention event
  • @{app_name} {ip}: Reply your message, everyone in the channel can view this message
  1. Slashs commands
  • /{command} {ip}: Reply your message, only visible to you

Deploy

Set secret manager:

Get value from your slack app: link
Secret name: SLACK_FIND_IP_SIGN_SECRET
Secret name: SLACK_FIND_IP_TOKEN

$ export project_id="{example-project}"
$ export SLACK_FIND_IP_SIGN_SECRET="{slack_sign_secret}"
$ export SLACK_FIND_IP_TOKEN="{slack_oauth_token}"
$ export SLACK_FIND_IP_MEMBER_ID="{slack_authen_member}"
$ export SLACK_FIND_IP_GCS_BUCKET="{slack_bucket}"
$ for secret in SLACK_FIND_IP_SIGN_SECRET SLACK_FIND_IP_TOKEN SLACK_FIND_IP_MEMBER_ID SLACK_FIND_IP_GCS_BUCKET; do
$   echo -n ${!secret} | gcloud secrets create ${secret} --project=${project_id} --replication-policy="automatic" --data-file=-
$ done

deploy on cloud function:

$ export project_id="{example-project}"
$ export function_name="{function_name}"
$ export region="{region}"
$ export service_account="{service_account}"
$ gcloud functions deploy ${function_name} --runtime python37 --trigger-http --region ${region} --env-vars-file=./env.yaml --service-account=${service_account} --project ${project_id}
  • permission:
    cloud function service account need permission roles/storage.objectViewer on the bucket which store data and roles/secretmanager.secretAccessor on project level

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages