Skip to main content
Connect your services to external cloud resources like AWS IAM roles, Google Cloud SQL instances, and persistent disks.

Connection Types

TypeDescriptionCloud Provider
awsRoleAttach an IAM role for AWS API accessAWS
cloudSqlConnect to Google Cloud SQL instancesGCP
diskAttach persistent storageAll

AWS Role Connection

Attach an IAM role to your service for secure AWS API access without managing credentials.

Field Reference

FieldTypeRequiredDescription
typestringYesMust be awsRole
rolestringYesIAM role name

Example

services:
  - name: api
    # ...
    connections:
      - type: awsRole
        role: my-app-s3-access

Cloud SQL Connection (GCP)

Connect to Google Cloud SQL instances using the Cloud SQL Auth Proxy for secure database access.
Your GCP Service account must be configured in the Connections tab of your cluster settings before it can be used in porter.yaml.

Field Reference

FieldTypeRequiredDescription
typestringYesMust be cloudSql
config.cloudSqlConnectionNamestringYesCloud SQL instance connection name
config.cloudSqlDatabasePortintegerYesDatabase port (e.g., 5432 for PostgreSQL)
config.cloudSqlServiceAccountstringYesGCP service account name

Example

services:
  - name: api
    # ...
    connections:
      - type: cloudSql
        config:
          cloudSqlConnectionName: my-project-123456:us-east1:my-instance
          cloudSqlDatabasePort: 5432
          cloudSqlServiceAccount: my-service-account
The connection name follows the format project-id:region:instance-name. You can find this in the Google Cloud Console under your Cloud SQL instance details.

Persistent Disk Connection

Attach persistent storage to your service for data that needs to survive pod restarts.
Your persistent disk must be created in the Add-Ons tab of Porter before it can be used in porter.yaml.

Field Reference

FieldTypeRequiredDescription
typestringYesMust be disk
config.diskNamestringYesName of the persistent disk

Example

services:
  - name: api
    # ...
    connections:
      - type: disk
        config:
          diskName: my-persistent-data
Persistent disks are tied to specific availability zones. Services using persistent disks cannot be scheduled across multiple zones.

Multiple Connections

You can attach multiple connections to a single service (but only one of each type of connection):
services:
  - name: api
    # ...
    connections:
      - type: awsRole
        role: api-s3-access
      - type: disk
        config:
          diskName: cache-storage