diff --git a/tools/@aws-cdk/spec2cdk/lib/cdk/resource-decider.ts b/tools/@aws-cdk/spec2cdk/lib/cdk/resource-decider.ts index b4548d732902b..913f8459856b0 100644 --- a/tools/@aws-cdk/spec2cdk/lib/cdk/resource-decider.ts +++ b/tools/@aws-cdk/spec2cdk/lib/cdk/resource-decider.ts @@ -77,6 +77,7 @@ export class ResourceDecider { remarks: (propSpec.docs?.remarks ?? '').concat('@cloudformationAttribute Ref'), }, immutable: true, + optional: false, }; } diff --git a/tools/@aws-cdk/spec2cdk/test/__snapshots__/resources.test.ts.snap b/tools/@aws-cdk/spec2cdk/test/__snapshots__/resources.test.ts.snap index 2129619e82fd9..656dc73d1e741 100644 --- a/tools/@aws-cdk/spec2cdk/test/__snapshots__/resources.test.ts.snap +++ b/tools/@aws-cdk/spec2cdk/test/__snapshots__/resources.test.ts.snap @@ -18,7 +18,7 @@ export interface ICfnResource extends constructs.IConstruct { * * @cloudformationAttribute Ref */ - readonly attrId?: string; + readonly attrId: string; } /** @@ -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. @@ -1107,14 +1107,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; /** * Another identifier of the resource. @@ -1122,7 +1122,7 @@ export interface ICfnResource { * * @cloudformationAttribute Ref */ - readonly attrAnotherId?: string; + readonly attrAnotherId: string; } /** @@ -1166,7 +1166,7 @@ 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. @@ -1174,7 +1174,7 @@ export class CfnResource extends cdk.CfnResource implements cdk.IInspectable, IC * * @cloudformationAttribute Ref */ - public readonly attrId?: string; + public readonly attrId: string; /** * Another identifier of the resource. @@ -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; } /** @@ -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.