Skip to content

Commit 93a16b3

Browse files
committed
update readme for caller_identity
1 parent 61a4522 commit 93a16b3

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ When "Tags" key exists in function.json, lambroll set / remove tags to the lambd
420420
When "Tags" key does not exist, lambroll doesn't manage tags.
421421
If you hope to remove all tags, set `"Tags": {}` expressly.
422422

423-
### Jsonnet support for function configuration
423+
#### Jsonnet support for function configuration
424424

425425
lambroll also can read function.jsonnet as [Jsonnet](https://jsonnet.org/) format instead of plain JSON.
426426

@@ -517,6 +517,25 @@ local must_env = std.native('must_env');
517517
}
518518
```
519519

520+
#### Resolve AWS caller identity
521+
522+
Note: This function is available only in Jsonnet.
523+
524+
The `caller_identity` native function resolves the AWS caller identity.
525+
526+
```jsonnet
527+
local caller = std.native('caller_identity')();
528+
{
529+
Account: caller.Account,
530+
Arn: caller.Arn,
531+
UserId: caller.UserId,
532+
}
533+
```
534+
535+
The `caller_identity` function returns an object containing the following fields: `Account`, `Arn`, and `UserId`.
536+
537+
This object is the same as the result of [GetCallerIdentity](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html) API.
538+
520539
#### Environment variables from envfile
521540

522541
`lambroll --envfile .env1 .env2` reads files named .env1 and .env2 as environment files and export variables in these files.

0 commit comments

Comments
 (0)