I think the reason this isn't working is because you can't reuse the same component multiple times (because it's a definition, like a class).
The best UML-like way to do this is based on this answer: https://softwareengineering.stackexchange.com/a/365901/51948
That is, each of your "instances" of C
are going to implement the same interface C
. I don't think it makes sense in a component diagram to reuse the same definition of a component as sub-components.
So, here's what it would look like in a deployment diagram:
@startuml
interface C #orange
cloud CMS #green {
component NMProxy #lightgreen
}
node GW1 #brown {
component C1
}
node GW2 #brown {
component C2
}
node GW3 #brown {
component C3
}
C1 -d-( C
C2 -d-( C
C3 -d-( C
GW1 -u-> NMProxy
GW2 -u-> NMProxy
GW3 -u-> NMProxy
@enduml
![Deployment diagram](https://cdn.statically.io/img/i.sstatic.net/ru81u.png)
I realize this is not so nice to look at, but it describes more precisely using UML.
If you don't care about ambiguity, here's a solution that hides the fact that there are three separate components with the same name/color. Unfortunately, I don't think it's possible to define that in one place and re-use it.
@startuml
cloud CMS #green {
component NMProxy #lightgreen
}
node GW1 #brown {
component "C" as C1 #orange
}
node GW2 #brown {
component "C" as C2 #orange
}
node GW3 #brown {
component "C" as C3 #orange
}
GW1 -u-> NMProxy
GW2 -d-> NMProxy
GW3 -d-> NMProxy
@enduml
![Component diagram reusing same component (more or less)](https://cdn.statically.io/img/i.sstatic.net/4Z8QL.png)