Skip to content

Commit c7d98c3

Browse files
committed
feat(proxy): region discovery + per-project residency enforcement (#1114)
Synced from sferarc/pgbeam@18d777f
1 parent 34056bf commit c7d98c3

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export type {
88
CustomDomain as CustomDomainData,
99
Database as DatabaseData,
1010
DatabaseRoleKey as DatabaseRole,
11+
DataResidencyKey as DataResidency,
1112
DnsInstructions,
1213
MaskingRule,
1314
OrganizationPlan,

src/project.gen.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ export interface ProjectArgs {
4949
allowedCidrs?: pulumi.Input<pulumi.Input<CidrEntryArgs>[]>;
5050
/** When set, passthrough/human connections are enforced against this policy profile. */
5151
defaultPolicyProfileId?: pulumi.Input<string>;
52+
/** Data-residency requirement for the project. "any" (default) lets queries be served from the nearest data-plane metro. "us" or "eu" require the serving metro to be in that jurisdiction; the proxy fails a connection closed when it is served from a metro outside the required jurisdiction, so regulated workloads never process outside their permitted region.
53+
*/
54+
residency?: pulumi.Input<string>;
5255
/** Project-level kill-switch. When true, ALL agent-credential connections to this project are blocked at the proxy and live agent sessions are dropped within seconds. Passthrough/human connections are unaffected.
5356
*/
5457
agentsDisabled?: pulumi.Input<boolean>;
@@ -137,6 +140,7 @@ function projectToState(r: ProjectData) {
137140
maxConnections: r.max_connections ?? null,
138141
allowedCidrs: r.allowed_cidrs ?? undefined,
139142
defaultPolicyProfileId: r.default_policy_profile_id ?? undefined,
143+
residency: r.residency ?? undefined,
140144
agentsDisabled: r.agents_disabled ?? undefined,
141145
databaseCount: r.database_count ?? null,
142146
activeConnections: r.active_connections ?? null,
@@ -282,6 +286,7 @@ const projectProvider: pulumi.dynamic.ResourceProvider = {
282286
);
283287
if (news.defaultPolicyProfileId !== olds.defaultPolicyProfileId)
284288
body.default_policy_profile_id = news.defaultPolicyProfileId;
289+
if (news.residency !== olds.residency) body.residency = news.residency;
285290
if (news.agentsDisabled !== olds.agentsDisabled) body.agents_disabled = news.agentsDisabled;
286291
if (news.status !== olds.status) body.status = news.status;
287292

@@ -338,6 +343,7 @@ const projectProvider: pulumi.dynamic.ResourceProvider = {
338343
JSON.stringify(news.tags) !== JSON.stringify(olds.tags) ||
339344
JSON.stringify(news.allowedCidrs) !== JSON.stringify(olds.allowedCidrs) ||
340345
news.defaultPolicyProfileId !== olds.defaultPolicyProfileId ||
346+
news.residency !== olds.residency ||
341347
news.agentsDisabled !== olds.agentsDisabled ||
342348
news.status !== olds.status ||
343349
news.orgId !== olds.orgId ||
@@ -374,6 +380,9 @@ export class Project extends pulumi.dynamic.Resource {
374380
public readonly allowedCidrs!: pulumi.Output<CidrEntry[] | undefined>;
375381
/** When set, passthrough/human connections are enforced against this policy profile. */
376382
public readonly defaultPolicyProfileId!: pulumi.Output<string | undefined>;
383+
/** Data-residency requirement for the project. "any" (default) lets queries be served from the nearest data-plane metro. "us" or "eu" require the serving metro to be in that jurisdiction; the proxy fails a connection closed when it is served from a metro outside the required jurisdiction, so regulated workloads never process outside their permitted region.
384+
*/
385+
public readonly residency!: pulumi.Output<string | undefined>;
377386
/** Project-level kill-switch. When true, ALL agent-credential connections to this project are blocked at the proxy and live agent sessions are dropped within seconds. Passthrough/human connections are unaffected.
378387
*/
379388
public readonly agentsDisabled!: pulumi.Output<boolean | undefined>;

0 commit comments

Comments
 (0)