Skip to content

GCP.DeveloperConnect reference

Source: src/GCP/DeveloperConnect/AccountConnector.ts

A Developer Connect account connector — the OAuth configuration that lets users connect their SCM accounts (GitHub, GitLab, Google, …) to Google Cloud.

Changing accountConnectorId, location, systemProviderId, or immutable custom-OAuth host fields (hostUri, tokenUri, authUri, scmProvider) replaces the connector. Labels, annotations, scopes, and proxyConfig update in place.

AccountConnector: Creating an Account Connector

Section titled “AccountConnector: Creating an Account Connector”

GitHub system provider

const github = yield* GCP.DeveloperConnect.AccountConnector("Github", {
providerOauthConfig: {
systemProviderId: "GITHUB",
scopes: ["repo"],
},
});

Explicit id, labels, and proxy

const github = yield* GCP.DeveloperConnect.AccountConnector("Github", {
accountConnectorId: "app-github",
location: "us-central1",
providerOauthConfig: {
systemProviderId: "GITHUB",
scopes: ["repo", "read:user"],
},
proxyConfig: { enabled: true },
labels: { env: "prod" },
});

AccountConnector: Updating an Account Connector

Section titled “AccountConnector: Updating an Account Connector”
// Same logical id as before; only the changed props differ.
const github = yield* GCP.DeveloperConnect.AccountConnector("Github", {
accountConnectorId: "app-github",
providerOauthConfig: {
systemProviderId: "GITHUB",
scopes: ["repo"],
},
labels: { env: "prod", team: "platform" },
proxyConfig: { enabled: true },
});

Source: src/GCP/DeveloperConnect/Connection.ts

A Developer Connect connection to a source-control host (GitHub, GitHub Enterprise, GitLab, Bitbucket, or Secure Source Manager).

Changing connectionId, location, SCM kind, githubApp, or immutable host fields (hostUri, workspace, webhookSecretSecretVersion, SSM instance) replaces the connection. disabled, labels, annotations, credentials, and gitProxyConfig update in place.

Generated GitHub connection

const github = yield* GCP.DeveloperConnect.Connection("Github", {
githubConfig: { githubApp: "DEVELOPER_CONNECT" },
});

Named GitHub connection with labels

const github = yield* GCP.DeveloperConnect.Connection("Github", {
connectionId: "app-github",
location: "us-central1",
labels: { env: "prod" },
githubConfig: { githubApp: "DEVELOPER_CONNECT" },
});
const github = yield* GCP.DeveloperConnect.Connection("Github", {
connectionId: "app-github",
githubConfig: { githubApp: "DEVELOPER_CONNECT" },
disabled: true,
});

Source: src/GCP/DeveloperConnect/ConnectionsGitRepositoryLink.ts

A Developer Connect git repository link — associates a remote Git repository with a Connection so webhooks and clone tokens can be issued.

Changing gitRepositoryLinkId, connection, location, cloneUri, labels, or annotations replaces the link. There is no update API; every user-facing field is immutable.

Section titled “ConnectionsGitRepositoryLink: Creating a Git Repository Link”

Generated name

const github = yield* GCP.DeveloperConnect.Connection("Github", {
githubConfig: { githubApp: "DEVELOPER_CONNECT" },
});
const source = yield* GCP.DeveloperConnect.ConnectionsGitRepositoryLink(
"Source",
{
connection: github.name,
cloneUri: "https://github.com/{owner}/{repo}.git",
},
);

Named link with labels

const source = yield* GCP.DeveloperConnect.ConnectionsGitRepositoryLink(
"Source",
{
connection: github.name,
gitRepositoryLinkId: "app-source",
cloneUri: "https://github.com/{owner}/{repo}.git",
labels: { env: "prod" },
},
);
Section titled “ConnectionsGitRepositoryLink: Fetching Git Refs”
const fetchGitRefs = yield* GCP.DeveloperConnect.FetchGitRefs(source);
const { refNames } = yield* fetchGitRefs({ refType: "BRANCH" });
Section titled “ConnectionsGitRepositoryLink: Cloning with a Token”
const fetchReadToken = yield* GCP.DeveloperConnect.FetchReadToken(source);
const { token } = yield* fetchReadToken();

Source: src/GCP/DeveloperConnect/FetchGitRefs.ts

Runtime binding for Developer Connect gitRepositoryLinks.fetchGitRefs.

Bind this operation to a ConnectionsGitRepositoryLink in a Function/Action init phase. Provide FetchGitRefsHttp.

Fetch branch names

const fetchGitRefs = yield* GCP.DeveloperConnect.FetchGitRefs(source);
const { refNames } = yield* fetchGitRefs({ refType: "BRANCH" });

Fetch tags

const { refNames } = yield* fetchGitRefs({ refType: "TAG", pageSize: 50 });

Source: src/GCP/DeveloperConnect/FetchGitRefsHttp.ts Kind: Layer · Provides: GCP.DeveloperConnect.FetchGitRefs

HTTP implementation of FetchGitRefs.

Source: src/GCP/DeveloperConnect/FetchReadToken.ts

Runtime binding for Developer Connect gitRepositoryLinks.fetchReadToken.

Bind this operation to a ConnectionsGitRepositoryLink in a Function/Action init phase. Provide FetchReadTokenHttp. Returns a short-lived token that can clone the remote Git repository.

const fetchReadToken = yield* GCP.DeveloperConnect.FetchReadToken(source);
const { token, expirationTime } = yield* fetchReadToken();

Source: src/GCP/DeveloperConnect/FetchReadTokenHttp.ts Kind: Layer · Provides: GCP.DeveloperConnect.FetchReadToken

HTTP implementation of FetchReadToken.

Source: src/GCP/DeveloperConnect/FetchReadWriteToken.ts

Runtime binding for Developer Connect gitRepositoryLinks.fetchReadWriteToken.

Bind this operation to a ConnectionsGitRepositoryLink in a Function/Action init phase. Provide FetchReadWriteTokenHttp. Returns a short-lived token that can clone and push to the remote Git repository.

FetchReadWriteToken: Fetching a Read/Write Token

Section titled “FetchReadWriteToken: Fetching a Read/Write Token”
const fetchReadWriteToken = yield* GCP.DeveloperConnect.FetchReadWriteToken(
source,
);
const { token, expirationTime } = yield* fetchReadWriteToken();

Source: src/GCP/DeveloperConnect/FetchReadWriteTokenHttp.ts Kind: Layer · Provides: GCP.DeveloperConnect.FetchReadWriteToken

HTTP implementation of FetchReadWriteToken.

Source: src/GCP/DeveloperConnect/InsightsConfig.ts

A Developer Connect InsightsConfig — the SDLC event hub that ties an App Hub application, runtime environments, and deployed artifacts together.

Changing insightsConfigId, location, appHubApplication, or projects replaces the config. Labels, annotations, and artifact configs update in place.

InsightsConfig: Creating an Insights Config

Section titled “InsightsConfig: Creating an Insights Config”

Generated name

const insights = yield* GCP.DeveloperConnect.InsightsConfig("Sdlc", {
projects: { projectIds: ["{project}"] },
labels: { env: "prod" },
});

App Hub application and artifacts

const insights = yield* GCP.DeveloperConnect.InsightsConfig("Sdlc", {
insightsConfigId: "app-sdlc",
appHubApplication: application.name,
artifactConfigs: [
{
uri: "us-docker.pkg.dev/{project}/{repo}/image",
googleArtifactRegistry: {
projectId: "{project}",
artifactRegistryPackage: "image",
},
},
],
labels: { env: "prod" },
});

InsightsConfig: Updating an Insights Config

Section titled “InsightsConfig: Updating an Insights Config”
// Same logical id as before; only the changed props differ.
const insights = yield* GCP.DeveloperConnect.InsightsConfig("Sdlc", {
insightsConfigId: "app-sdlc",
projects: { projectIds: ["{project}"] },
labels: { env: "prod", team: "platform" },
});