I am trying to draw some diagrams mimicking examples at awslabs/aws-icons-for-plantuml . There are two issues I am facing (please excuse the loose terminologies):
How to add objects on top of another object/entity?
How to add objects/entities between entities in place of notes or comments?
In the diagram below,
a) I would like to add Role1
on top of vpc or ec2 instance or any boundary to highlight that only r1 can access this resource.
b) I would like to add Role2
entity between EC2 and Queue Service. This is to highlight that r2 has access to SNS message between (not shown).
Code:
@startuml VPC
!define AWSPuml https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/v13.1/dist
!include AWSPuml/AWSCommon.puml
!include AWSPuml/AWSSimplified.puml
!include AWSPuml/Compute/EC2.puml
!include AWSPuml/Compute/EC2Instance.puml
!include AWSPuml/Groups/AWSCloud.puml
!include AWSPuml/Groups/VPC.puml
!include AWSPuml/Groups/AvailabilityZone.puml
!include AWSPuml/Groups/PublicSubnet.puml
!include AWSPuml/Groups/PrivateSubnet.puml
!include AWSPuml/NetworkingContentDelivery/VPCNATGateway.puml
!include AWSPuml/SecurityIdentityCompliance/IdentityAccessManagementRole.puml
!include AWSPuml/ApplicationIntegration/SimpleQueueService.puml
hide stereotype
skinparam linetype ortho
AWSCloudGroup(cloud) {
VPCGroup(vpc) {
AvailabilityZoneGroup(az_1, "\tAvailability Zone 1\t") {
PublicSubnetGroup(az_1_public, "Public subnet") {
VPCNATGateway(az_1_nat_gateway, "NAT gateway", "") #Transparent
}
PrivateSubnetGroup(az_1_private, "Private subnet") {
EC2Instance(az_1_ec2_1, "Instance", "") #Transparent
}
IdentityAccessManagementRole("r1", "Role1", " ")
IdentityAccessManagementRole("r2", "Role2", " ")
SimpleQueueService("sqs", "Queue Service", " ")
az_1_ec2_1 .u.> az_1_nat_gateway
az_1_ec2_1 --> sqs:[$r1]
}
}
}
@enduml
Corresponding diagram:
I would like the roles to be placed at positions shown by arrowhead: