Creating a GCP Service Account
- Log into the GCP Compute Portal.
- Go to IAM & admin > Service accounts.
- Create a service account.
- Name the account, then click CREATE.
- From the Role dropdown list, select Viewer, then click CONTINUE.
- (Optional) Configure user access.
- Name the account, then click CREATE.
- Create the service account key. This example describes creating a private key in JSON format.
- Once created, the key automatically downloads to your PC. Click Done.
- Use a text editor to open the downloaded key. Find the line
“"private_key": "-----BEGIN PRIVATE KEY-----\n……”
This line contains line breaks with"\n"
. Therefore, copying and pasting the line into the FortiOS GUI will not work. - Remove
"\n"
using a tool or command of your choice. For example, the Linux command shown below removes"\n"
. In this example, output.json is the downloaded key file which includes line breaks:$cat <output.json> | sed -e s/'\\n'/"\n"/g
- Copy and paste the key content into the FortiOS GUI.