From 4f0c9d6f508708f5ae6c178bed8cf2944caa64ee Mon Sep 17 00:00:00 2001 From: tmorin Date: Thu, 6 Feb 2020 11:44:59 +0100 Subject: [PATCH] feat(aws-v2): add Relationship --- aws-v2/example-git_to_s3_webhooks.puml | 14 +++++++------- aws-v2/functions.puml | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/aws-v2/example-git_to_s3_webhooks.puml b/aws-v2/example-git_to_s3_webhooks.puml index a8fc4e3ad42..b4939365110 100644 --- a/aws-v2/example-git_to_s3_webhooks.puml +++ b/aws-v2/example-git_to_s3_webhooks.puml @@ -1,10 +1,10 @@ @startuml -'!global $INCLUSION_MODE="local" -'!include library.puml +!global $INCLUSION_MODE="local" +!include library.puml -!global $AWS_LIB_BRANCH="master" -!global $AWS_LIB_BASE_URL="https://raw.githubusercontent.com/tmorin/plantuml-libs/" + $AWS_LIB_BRANCH + "/aws-v2" -!includeurl $AWS_LIB_BASE_URL/library.puml +'!global $AWS_LIB_BRANCH="master" +'!global $AWS_LIB_BASE_URL="https://raw.githubusercontent.com/tmorin/plantuml-libs/" + $AWS_LIB_BRANCH + "/aws-v2" +'!includeurl $AWS_LIB_BASE_URL/library.puml includeSubLibrary("groups") includeSubLibrary("elements/Compute") @@ -24,8 +24,8 @@ GroupAwsCloud('aws') { AmazonSimpleStorageServiceS3BucketWithObjects("bucket_output", "Amazon S3 output bucket") } -git_users -down-> git_server : git push -git_server -down-> lambda0 : git webhook +git_users -down-> git_server : Relationship("git push", "ssh") +git_server -down-> lambda0 : Relationship("git webhook", "https") lambda0 -down-> lambda1 lambda1 -down-> bucket_ssh lambda1 -down-> kms diff --git a/aws-v2/functions.puml b/aws-v2/functions.puml index 5fa4ab3c27b..f42fe310a19 100644 --- a/aws-v2/functions.puml +++ b/aws-v2/functions.puml @@ -1,7 +1,13 @@ @startuml + +' Icons + !function getIconPath($size, $name) return $IMAGE_BASE_PATH + "icons-" + $size + "x" + $size + "/" + $name + ".png" !function get50Path($name) return getIconPath("50", $name) !function getIcon($name) return get50Path($name) + +' Inclusion + !function includeSubLibrary($name) !if (%get_variable_value("$INCLUSION_MODE") == "remote") !includeurl $AWS_LIB_BASE_URL/$name.puml @@ -9,4 +15,17 @@ !include $name.puml !endif !endfunction + +' Relationship + +!function Relationship($desc="", $tech="") + !if ($desc) && ($tech) + $desc\n[$tech] + !elseif ($desc) + $desc + !else + [$tech] + !endif +!endfunction + @enduml \ No newline at end of file