{"record":{"id":"d24c54df237fad1c","repo":"anomalyco/sst","slug":"resource-is-deprecated-use-sst-linkable-instead","errorCode":null,"errorMessage":"Resource is deprecated. Use sst.Linkable instead.","messagePattern":"Resource is deprecated\\. Use sst\\.Linkable instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"platform/src/components/linkable.ts","lineNumber":334,"sourceCode":"\n/**\n * @deprecated\n * Use sst.Linkable instead.\n */\nexport class Resource extends Component implements Link.Linkable {\n  private _properties: any;\n  private _name: string;\n\n  constructor(name: string, properties: any) {\n    super(\n      \"sst:sst:Resource\",\n      name,\n      {\n        properties,\n      },\n      {},\n    );\n    console.warn(\"Resource is deprecated. Use sst.Linkable instead.\");\n    this._properties = properties;\n    this._name = name;\n  }\n\n  public get name() {\n    return output(this._name);\n  }\n\n  public get properties() {\n    return this._properties;\n  }\n\n  /** @internal */\n  public getSSTLink() {\n    return {\n      properties: this._properties,\n    };\n  }","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/linkable.ts#L316-L352","documentation":"`sst.Resource` is the deprecated predecessor of `sst.Linkable`. Its constructor prints \"Resource is deprecated. Use sst.Linkable instead.\" to warn you that custom resources being linked into functions should now be created with `sst.Linkable`, which additionally supports `include` for permissions/bindings. The warning is non-fatal; the component still works.","triggerScenarios":"Instantiating the deprecated class in sst.config.ts: `new sst.Resource(\"MyResource\", { ...properties })` (constructor at platform/src/components/linkable.ts:334 emits console.warn on every construction). Any copied example code or old app config predating the Linkable rename triggers it.","commonSituations":"Upgrading an SST app from an older version where Resource was the way to link arbitrary values; following outdated tutorials/docs or Stack Overflow answers that predate sst.Linkable; linking constants or outputs of non-SST Pulumi resources to functions.","solutions":["Replace `new sst.Resource(name, props)` with `new sst.Linkable(name, { properties: props })`","If the old Resource wrapped a real AWS resource and you need IAM permissions, use `sst.Linkable.wrap(resource, (r) => ({ properties: {...} , include: [sst.aws.permission({...})] }))` from platform/src/components/aws/linkable.ts","Keep the Resource usage if you must stay on legacy code — the warning is harmless — but plan migration before removal in a future major release"],"exampleFix":"// before\nconst myData = new sst.Resource(\"MyData\", {\n  table: myTable.name,\n});\n\n// after\nconst myData = new sst.Linkable(\"MyData\", {\n  properties: {\n    table: myTable.name,\n  },\n});","handlingStrategy":"validation","validationCode":"// Detect deprecated Resource usage in your config before deploy\nif (\"Resource\" in sst && sst.Resource) {\n  console.warn(\"sst.Resource is deprecated; use sst.Linkable instead\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Search sst.config.ts for `new sst.Resource` during dependency upgrades and migrate to sst.Linkable","Use sst.Linkable.wrap when linking existing Pulumi/AWS resources so permissions can be included","Treat deprecation warnings in deploy output as action items, not noise"],"tags":["deprecation","sst","linkable","infrastructure-as-code"],"backgroundTag":"deprecated-api-usage","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}