diff --git a/platform/src/components/aws/cluster.ts b/platform/src/components/aws/cluster.ts index 6953e10e5..be2baaf25 100644 --- a/platform/src/components/aws/cluster.ts +++ b/platform/src/components/aws/cluster.ts @@ -856,7 +856,11 @@ export class Cluster extends Component { opts?: ComponentResourceOptions, ) { const _version = 2; - super(__pulumiType, name, args, opts, _version); + const _breakingChange = [ + `The new version of "sst.aws.Cluster" deploys services in the public subnets by default, and does not require VPC to have NAT gateways.`, + `Where previously in "sst.aws.Cluster.v1" it would deploy the services in the private subnets.`, + ].join(" "); + super(__pulumiType, name, args, opts, { _version, _breakingChange }); const parent = this; diff --git a/platform/src/components/aws/vpc.ts b/platform/src/components/aws/vpc.ts index b21c17cf3..71a58483b 100644 --- a/platform/src/components/aws/vpc.ts +++ b/platform/src/components/aws/vpc.ts @@ -175,7 +175,7 @@ export class Vpc extends Component implements Link.Linkable { constructor(name: string, args?: VpcArgs, opts?: ComponentResourceOptions) { const _version = 2; - super(__pulumiType, name, args, opts, _version); + super(__pulumiType, name, args, opts, { _version }); if (args && "ref" in args) { const ref = args as VpcRef; diff --git a/platform/src/components/component.ts b/platform/src/components/component.ts index c4430770a..19ffdfa56 100644 --- a/platform/src/components/component.ts +++ b/platform/src/components/component.ts @@ -46,7 +46,10 @@ export class Component extends ComponentResource { name: string, args?: Inputs, opts?: ComponentResourceOptions, - _version: number = 1, + _versionInfo: { + _version: number; + _breakingChange?: string; + } = { _version: 1 }, ) { const transforms = ComponentTransforms.get(type) ?? []; for (const transform of transforms) { @@ -331,13 +334,16 @@ export class Component extends ComponentResource { // Check component version const oldVersion = $cli.state.version[name]; - const newVersion = _version; + const newVersion = _versionInfo._version; if (oldVersion) { const className = type.replaceAll(":", "."); if (oldVersion < newVersion) { throw new VisibleError( [ `There is a new version of "${className}" that has breaking changes.`, + ...(_versionInfo._breakingChange + ? [_versionInfo._breakingChange] + : []), `To continue using the previous version, rename "${className}" to "${className}.v${oldVersion}".`, `Or recreate this component to update - https://ion.sst.dev/docs/components/#versioning`, ].join(" "),