Creating a GCP service account
- Log into the GCP Compute Portal.
- Go to IAM & admin > Service accounts.
- Create a service account. If you enabled metadata IAM access in Configuring GCP SDN Connector using service account, you do not need to 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 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.