Thanks. Turns out it was pretty obvious in hindsight. What I didn't realise was that it had to be exactly the same to be imported. I was thinking that it could handle minor differences provided they didn't cause the resource to need replacing. The difference here is that pulumi was automatically adding a comment
"Managed by pulumi"
so I had to explicitly set the comment to
""
.