https://github.com/cloudacademy/gcp-vcf-env
VS Code environment for working with GCP VCFs
https://github.com/cloudacademy/gcp-vcf-env
gcp vscode
Last synced: about 1 year ago
JSON representation
VS Code environment for working with GCP VCFs
- Host: GitHub
- URL: https://github.com/cloudacademy/gcp-vcf-env
- Owner: cloudacademy
- Created: 2019-06-21T17:51:46.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-28T06:53:41.000Z (over 2 years ago)
- Last Synced: 2025-04-09T12:11:40.015Z (about 1 year ago)
- Topics: gcp, vscode
- Language: Python
- Size: 14.6 KB
- Stars: 3
- Watchers: 10
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gcp-vcf-env
Envrionment for working with GCP VCFs
## Getting started
1. Ensure Python 3.6+ is installed on your system
1. Create a GCP project
1. Create a service account for running the VCFs
1. Create a JSON key for the service account
1. Add the service account to the project _Owner_ or _Viewer_ role
1. In `.vscode/launch.json` fill in the `CREDENTIAL_KEY`, `CREDENTIAL_ID` and `PROJECT_ID` for the service account. Be sure to escape the JSON. Avoid using online tools to do this due to the sensitive nature of what you are escaping. The resulting `env` map will resemble:
```json
{
"CREDENTIAL_ID" : "your-service-account@your-project.iam.gserviceaccount.com",
"CREDENTIAL_KEY": "{\"type\":\"service_account\",\"project_id\":\"your-project\",\"private_key_id\":\"...}",
"PROJECT_ID" : "your-project"
}
```
1. In `init.sh` (Mac/Linux)/`init.ps1` (Windows) replace YOUR_BITBUCKET_USER with the name of your Cloud Academy BitBucket user
1. Run `init.sh` (Mac/Linux)/`init.ps1` (Windows) to set up the environment
- Enter your Cloud Academy BitBucket password/[app password](https://confluence.atlassian.com/bitbucket/app-passwords-828781300.html) when prompted.
1. Add the following line to `.gitignore` to avoid committing any sensitive information:
```
.vscode/
```
1. Develop and debug functions using the `Current File (Integrated Terminal)` configuration (press F5 with the file open)
If you see any errors with importing modules, ensure VS Code is configured to use the venv Python by checking the lower-left status bar in VS Code:

## Update Dependencies
1. Run `init.sh` (Mac/Linux)/`init.ps1` (Windows) to set up the virtual environment again. (only the `venv/` directory is impacted by this operation)
## References
- [Google APIs Explorer](https://developers.google.com/apis-explorer)
- [OAuth2 Scopes for Google](https://developers.google.com/identity/protocols/googlescopes)
- [GCP Python Docs Samples](https://github.com/GoogleCloudPlatform/python-docs-samples)