By default Pulumi auto-names cloud resources by taking the logical name from the program and appending a random suffix, producing something like my-bucket-a1b2c3d. This is deliberate: it lets the same program be deployed to many stacks without name collisions and, more importantly, it makes replacements possible, because a replacement creates the new object before deleting the old one and two objects cannot share a name.
Setting an explicit physical name, for example bucket: "my-bucket", removes the suffix and also removes that safety. Any change forcing a replacement then fails, because the create step collides with the still-existing old resource. The workaround is deleteBeforeReplace: true in resource options, which accepts a window of downtime in exchange.
Auto-naming means the physical name is an Output, not a constant, so anything referencing it externally must read it from a stack output rather than hardcoding it. To rename a logical resource without replacing the physical one, use the aliases resource option listing the old URN; without it, renaming in code destroys and recreates.