Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(spec2cdk): attributes in ICfnResource should not be optional #28179

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tools/@aws-cdk/spec2cdk/lib/cdk/resource-decider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export class ResourceDecider {
remarks: (propSpec.docs?.remarks ?? '').concat('@cloudformationAttribute Ref'),
},
immutable: true,
optional: false,
};
}

Expand Down
20 changes: 10 additions & 10 deletions tools/@aws-cdk/spec2cdk/test/__snapshots__/resources.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface ICfnResource extends constructs.IConstruct {
*
* @cloudformationAttribute Ref
*/
readonly attrId?: string;
readonly attrId: string;
}

/**
Expand Down Expand Up @@ -62,7 +62,7 @@ export class CfnResource extends cdk.CfnResource implements cdk.IInspectable, IC
*
* @cloudformationAttribute Ref
*/
public readonly attrId?: string;
public readonly attrId: string;

/**
* The identifier of the resource.
Expand Down Expand Up @@ -1107,22 +1107,22 @@ import * as cfn_parse from "aws-cdk-lib/core/lib/helpers-internal";
*
* @stability external
*/
export interface ICfnResource {
export interface ICfnResource extends constructs.IConstruct {
/**
* The identifier of the resource.
* This property gets determined after the resource is created.
*
* @cloudformationAttribute Ref
*/
readonly attrId?: string;
readonly attrId: string;

/**
* Another identifier of the resource.
* This property gets determined after the resource is created.
*
* @cloudformationAttribute Ref
*/
readonly attrAnotherId?: string;
readonly attrAnotherId: string;
}

/**
Expand Down Expand Up @@ -1166,15 +1166,15 @@ export class CfnResource extends cdk.CfnResource implements cdk.IInspectable, IC
*
* @cloudformationAttribute Ref
*/
public readonly attrAnotherId?: string;
public readonly attrAnotherId: string;

/**
* The identifier of the resource.
* This property gets determined after the resource is created.
*
* @cloudformationAttribute Ref
*/
public readonly attrId?: string;
public readonly attrId: string;

/**
* Another identifier of the resource.
Expand Down Expand Up @@ -1305,14 +1305,14 @@ import * as cfn_parse from "aws-cdk-lib/core/lib/helpers-internal";
*
* @stability external
*/
export interface ICfnResource {
export interface ICfnResource extends constructs.IConstruct {
/**
* The identifier of the resource.
* This property gets determined after the resource is created.
*
* @cloudformationAttribute Ref
*/
readonly attrId?: string;
readonly attrId: string;
}

/**
Expand Down Expand Up @@ -1356,7 +1356,7 @@ export class CfnResource extends cdk.CfnResource implements cdk.IInspectable, IC
*
* @cloudformationAttribute Ref
*/
public readonly attrId?: string;
public readonly attrId: string;

/**
* The identifier of the resource.
Expand Down
Loading