How to left align when the AWS lib is also used?

0 votes
asked Jul 18 in Question / help by sashee (200 points)

I want use the AWS lib but also have some components left-aligned.

When I have this:

@startuml
!include <awslib/AWSCommon>
!include <awslib/General/User>

User(user, "Trusted user", "")

file policy <<policy>> [
{
\t"Action": [
\t\t"sts:AssumeRole"
\t],
\t"Effect": "Allow",
\t"Resource": <b>"arn:aws:iam::1:role/role"</b>
}
]

user -- policy
@enduml

Then everything is center-aligned:

PlantUML diagram

This is because the AWS lib has this skinparam:

skinparam defaultTextAlignment center

If I reset that back to left:

@startuml
!include <awslib/AWSCommon>
!include <awslib/General/User>

skinparam defaultTextAlignment left

User(user, "Trusted user", "")

file policy <<policy>> [
{
\t"Action": [
\t\t"sts:AssumeRole"
\t],
\t"Effect": "Allow",
\t"Resource": <b>"arn:aws:iam::1:role/role"</b>
}
]

user -- policy
@enduml

Then the icon is also left-aligned:

PlantUML diagram

I tried to use HorizontalAlignment, but it seems like it's not working:

@startuml
!include <awslib/AWSCommon>
!include <awslib/General/User>

<style>

file {
   HorizontalAlignment left
   FontColor blue
}
</style>

User(user, "Trusted user", "")

file policy <<policy>> [
{
\t"Action": [
\t\t"sts:AssumeRole"
\t],
\t"Effect": "Allow",
\t"Resource": <b>"arn:aws:iam::1:role/role"</b>
}
]

user -- policy
@enduml

PlantUML diagram

What is the proper way to keep the center alignment for the AWS icons but have left-aligned for other ones?

1 Answer

0 votes
answered Jul 21 by plantuml (278,240 points)
selected Jul 30 by sashee
 
Best answer

Sorry about that!

Your last example is the right solution. It's not working because of an issue that has just been fixed in last snapshot

Tell us if it's not working for you

...