Skip to content

Commit d453eed

Browse files
committed
chore(servicecatalog): reference interfaces
Reference interfaces for L2s, like #35271. "chore" because I plan to make a lot of these PRs and they're not adding value to the changelog. (Generated with AI)
1 parent 8e9f730 commit d453eed

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

packages/aws-cdk-lib/aws-servicecatalog/lib/portfolio.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { ValidationError } from '../../core';
1818
import { addConstructMetadata } from '../../core/lib/metadata-resource';
1919
import { mutatingAspectPrio32333 } from '../../core/lib/private/aspect-prio';
2020
import { propertyInjectable } from '../../core/lib/prop-injectable';
21+
import { IPortfolioRef } from '../../interfaces/generated/aws-servicecatalog-interfaces.generated';
2122

2223
/**
2324
* Options for portfolio share.
@@ -42,7 +43,7 @@ export interface PortfolioShareOptions {
4243
/**
4344
* A Service Catalog portfolio.
4445
*/
45-
export interface IPortfolio extends cdk.IResource {
46+
export interface IPortfolio extends cdk.IResource, IPortfolioRef {
4647
/**
4748
* The ARN of the portfolio.
4849
* @attribute
@@ -163,6 +164,12 @@ abstract class PortfolioBase extends cdk.Resource implements IPortfolio {
163164
private readonly assetBuckets: Set<IBucket> = new Set<IBucket>();
164165
private readonly sharedAccounts: string[] = [];
165166

167+
public get portfolioRef() {
168+
return {
169+
portfolioId: this.portfolioId,
170+
};
171+
}
172+
166173
public giveAccessToRole(role: iam.IRole): void {
167174
this.associatePrincipal(role.roleArn, role.node.addr);
168175
}

packages/aws-cdk-lib/aws-servicecatalog/lib/product.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ import { IBucket } from '../../aws-s3';
99
import { ArnFormat, IResource, Resource, Stack, ValidationError } from '../../core';
1010
import { addConstructMetadata } from '../../core/lib/metadata-resource';
1111
import { propertyInjectable } from '../../core/lib/prop-injectable';
12+
import { ICloudFormationProductRef } from '../../interfaces/generated/aws-servicecatalog-interfaces.generated';
1213

1314
/**
1415
* A Service Catalog product, currently only supports type CloudFormationProduct
1516
*/
16-
export interface IProduct extends IResource {
17+
export interface IProduct extends IResource, ICloudFormationProductRef {
1718
/**
1819
* The ARN of the product.
1920
* @attribute
@@ -45,6 +46,12 @@ abstract class ProductBase extends Resource implements IProduct {
4546
public abstract readonly productId: string;
4647
public abstract readonly assetBuckets: IBucket[];
4748

49+
public get cloudFormationProductRef() {
50+
return {
51+
cloudFormationProductId: this.productId,
52+
};
53+
}
54+
4855
public associateTagOptions(tagOptions: TagOptions) {
4956
AssociationManager.associateTagOptions(this, this.productId, tagOptions);
5057
}

0 commit comments

Comments
 (0)