Naming, replicas, and component instances

Each platform component resolves names the same way:

1
names ?? [namePrefix-1, namePrefix-2, ... namePrefix-replicas]
  • Set names for stable explicit publisher names.
  • Otherwise set namePrefix and replicas.
  • replicas defaults to one publisher.
  • namePrefix defaults to npa-publisher.

The resolved list is exposed as the publisherNames output.

Explicit names

1
2
3
4
5
6
7
new AwsPublisher("publisher", {
names: ["pub-eu-1", "pub-eu-2"],
tenantUrl,
apiToken,
subnetId,
securityGroupIds: [securityGroupId],
});

Explicit names are safest for production because removing one name does
not force unrelated publishers to be renamed.

Derived names

1
2
3
4
5
6
7
8
new AwsPublisher("publisher", {
namePrefix: "pub-eu",
replicas: 2,
tenantUrl,
apiToken,
subnetId,
securityGroupIds: [securityGroupId],
});

This creates pub-eu-1 and pub-eu-2.

Multi-AZ and multi-region naming

Use one component instance per placement boundary when networking differs
by zone, region, or provider:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
new AwsPublisher("publisher-eu-a", {
namePrefix: "pub-eu-a",
replicas: 1,
tenantUrl,
apiToken,
subnetId: euSubnetA,
securityGroupIds: [euSecurityGroup],
});

new AwsPublisher("publisher-eu-b", {
namePrefix: "pub-eu-b",
replicas: 1,
tenantUrl,
apiToken,
subnetId: euSubnetB,
securityGroupIds: [euSecurityGroup],
});