From cf0947d893f1ac7b312a4fecde43555d579ccf19 Mon Sep 17 00:00:00 2001 From: Walery Strauch Date: Wed, 3 Feb 2021 13:57:09 +0100 Subject: [PATCH] Add Sub function example to Pseudo Parameters doc. This is documentation of change added in serverless/serverless#8279 --- docs/providers/aws/guide/variables.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/providers/aws/guide/variables.md b/docs/providers/aws/guide/variables.md index 2377eae6896..0f1eca64a9a 100644 --- a/docs/providers/aws/guide/variables.md +++ b/docs/providers/aws/guide/variables.md @@ -675,6 +675,15 @@ Resources: - 'log-group:/aws/lambda/*:*:*' ``` +You can also directly use the [Sub] function: + +```yml +Resources: + - !Sub arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/*:*:*' +``` + +[sub]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html + ## Read String Variable Values as Boolean Values In some cases, a parameter expect a `true` or `false` boolean value. If you are using a variable to define the value, it may return as a string (e.g. when using SSM variables) and thus return a `"true"` or `"false"` string value.