Stacks have a concept of physical and logical resource id's. logical resource id's are unique only within the stack, whereas physical resource id's are unique across the whole cloud.