Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

Commit c3aa599

Browse files
committed
Cluster: service inherit provider settings
1 parent 8de9fe6 commit c3aa599

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

platform/src/components/aws/cluster.ts

+16-10
Original file line numberDiff line numberDiff line change
@@ -1131,14 +1131,15 @@ export interface ClusterServiceArgs {
11311131
* ```
11321132
*/
11331133
export class Cluster extends Component {
1134-
private args: ClusterArgs;
1134+
private constructorArgs: ClusterArgs;
1135+
private constructorOpts: ComponentResourceOptions;
11351136
private cluster: ecs.Cluster;
11361137
public static v1 = ClusterV1;
11371138

11381139
constructor(
11391140
name: string,
11401141
args: ClusterArgs,
1141-
opts?: ComponentResourceOptions,
1142+
opts: ComponentResourceOptions = {},
11421143
) {
11431144
const _version = 2;
11441145
super(__pulumiType, name, args, opts, {
@@ -1163,7 +1164,8 @@ export class Cluster extends Component {
11631164

11641165
const cluster = createCluster();
11651166

1166-
this.args = args;
1167+
this.constructorArgs = args;
1168+
this.constructorOpts = opts;
11671169
this.cluster = cluster;
11681170

11691171
function createCluster() {
@@ -1243,14 +1245,18 @@ export class Cluster extends Component {
12431245
*/
12441246
public addService(name: string, args?: ClusterServiceArgs) {
12451247
// Do not prefix the service to allow `Resource.MyService` to work.
1246-
return new Service(name, {
1247-
cluster: {
1248-
name: this.cluster.name,
1249-
arn: this.cluster.arn,
1248+
return new Service(
1249+
name,
1250+
{
1251+
cluster: {
1252+
name: this.cluster.name,
1253+
arn: this.cluster.arn,
1254+
},
1255+
vpc: this.constructorArgs.vpc,
1256+
...args,
12501257
},
1251-
vpc: this.args.vpc,
1252-
...args,
1253-
});
1258+
{ provider: this.constructorOpts.provider },
1259+
);
12541260
}
12551261
}
12561262

0 commit comments

Comments
 (0)