{"record":{"id":"0d99419c9783db44","repo":"anomalyco/sst","slug":"do-not-set-both-public-and-publicip-for-the","errorCode":null,"errorMessage":"Do not set both \"public\" and \"publicIp\" for the \"${name}\" Task. \"publicIp\" has been deprecated, use \"public\" instead.","messagePattern":"Do not set both \"public\" and \"publicIp\" for the \"(.+?)\" Task\\. \"publicIp\" has been deprecated, use \"public\" instead\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/task.ts","lineNumber":310,"sourceCode":"  private readonly containerNames: Output<Output<string>[]>;\n  private readonly dev: boolean;\n\n  constructor(\n    name: string,\n    args: TaskArgs,\n    opts: ComponentResourceOptions = {},\n  ) {\n    super(__pulumiType, name, args, opts);\n\n    const self = this;\n    const dev = normalizeDev();\n    const architecture = normalizeArchitecture(args);\n    const cpu = normalizeCpu(args);\n    const memory = normalizeMemory(cpu, args);\n    const storage = normalizeStorage(args);\n    const containers = normalizeContainers(\"task\", args, name, architecture);\n    if (args.public !== undefined && args.publicIp !== undefined)\n      throw new VisibleError(\n        `Do not set both \"public\" and \"publicIp\" for the \"${name}\" Task. \"publicIp\" has been deprecated, use \"public\" instead.`,\n      );\n    const isPublic = args.public ?? false;\n    const vpc = normalizeVpc();\n    const hasPublicIp = isPublic || (args.publicIp ?? vpc.isSstVpc);\n    const publicSecurityGroup = createPublicSecurityGroup();\n\n    const taskRole = createTaskRole(\n      name,\n      args,\n      opts,\n      self,\n      dev,\n      dev\n        ? [\n            {\n              actions: [\"appsync:*\"],\n              resources: [\"*\"],","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/task.ts#L292-L328","documentation":"SST's Task component (ECS) renamed the `publicIp` argument to `public`. Because the two overlap in meaning, the constructor in platform/src/components/aws/task.ts:310 refuses to proceed when both are supplied, since it cannot tell which intent is authoritative. `publicIp` is deprecated and kept only for backwards compatibility.","triggerScenarios":"Constructing a new Task (or sst.aws.Task) with both `public` and `publicIp` defined in the args object, e.g. `new sst.aws.Task(\"MyTask\", { public: true, publicIp: true, ... })`.","commonSituations":"Migrating an old sst.config.ts written against a previous SST version where `publicIp` was the valid flag, then adding the new `public` field without removing `publicIp`; or copy-pasting config from docs of mixed versions; or an AI/codemod adding `public` on top of existing `publicIp`.","solutions":["Remove the deprecated `publicIp` property from the Task args and keep only `public`.","If you intentionally relied on `publicIp: false` while defaulting `public` elsewhere, set `public` explicitly to the desired value instead.","Run `sst upgrade` and check the Task docs to confirm all other renamed args were migrated too."],"exampleFix":"// before\nnew sst.aws.Task(\"Api\", {\n  public: true,\n  publicIp: true,\n  // ...\n});\n// after\nnew sst.aws.Task(\"Api\", {\n  public: true,\n  // ...\n});","handlingStrategy":"validation","validationCode":"const taskArgs = { name: \"Api\", public: true, publicIp: true };\nif (taskArgs.public !== undefined && taskArgs.publicIp !== undefined) {\n  throw new Error(\"Task defines both 'public' and deprecated 'publicIp'; remove 'publicIp'.\");\n}\nnew sst.aws.Task(\"Api\", taskArgs);","typeGuard":"function usesDeprecatedPublicIp(args: sst.aws.TaskArgs): boolean {\n  return (args as { publicIp?: boolean }).publicIp !== undefined;\n}","tryCatchPattern":null,"preventionTips":["After an SST upgrade, grep sst.config.ts for `publicIp` and migrate to `public`.","Keep only one of `public`/`publicIp` in Task args anywhere in the config.","Type your task args with the current SST TaskArgs type so deprecated fields surface in editor warnings."],"tags":["config","ecs","deprecated-argument","s"],"backgroundTag":"conflicting-component-arguments","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}