Skip to content

cloudacademy/gcp-vcf-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcp-vcf-env

Envrionment for working with GCP VCFs

Getting started

  1. Ensure Python 3.6+ is installed on your system

  2. Create a GCP project

  3. Create a service account for running the VCFs

  4. Create a JSON key for the service account

  5. Add the service account to the project Owner or Viewer role

  6. 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:

    {
        "CREDENTIAL_ID"  : "[email protected]",
        "CREDENTIAL_KEY": "{\"type\":\"service_account\",\"project_id\":\"your-project\",\"private_key_id\":\"...}",
        "PROJECT_ID"     : "your-project"
    }
  7. In init.sh (Mac/Linux)/init.ps1 (Windows) replace YOUR_BITBUCKET_USER with the name of your Cloud Academy BitBucket user

  8. Run init.sh (Mac/Linux)/init.ps1 (Windows) to set up the environment

    • Enter your Cloud Academy BitBucket password/app password when prompted.
  9. Add the following line to .gitignore to avoid committing any sensitive information:

    .vscode/
    
  10. 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:

    venv Python in VS Code status bar

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

About

VS Code environment for working with GCP VCFs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages