File tree 3 files changed +30
-1
lines changed
3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 3.7.0 - 2025-03-18
4
+ - Add support for ` ec2.assume_role ` to the list of ` AvailableCommands ` .
5
+
3
6
## 3.6.0 - 2024-11-18
4
7
- Address Python 3.12+ compatibility issues.
5
8
- Address pydantic v2 compatibility issues.
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " shrub.py"
3
- version = " 3.6 .0"
3
+ version = " 3.7 .0"
4
4
description = " Library for creating evergreen configurations"
5
5
authors = [
" DevProd Services & Integrations Team <[email protected] >" ]
6
6
license = " Apache-2.0"
Original file line number Diff line number Diff line change 14
14
"attach.results" ,
15
15
"attach.xunit_results" ,
16
16
"downstream_expansions.set" ,
17
+ "ec2.assume_role" ,
17
18
"expansions.update" ,
18
19
"expansions.write" ,
19
20
"generate.tasks" ,
@@ -350,6 +351,31 @@ def downstream_expansions_set(
350
351
)
351
352
352
353
354
+ def ec2_assume_role (
355
+ role_arn : str ,
356
+ policy : Optional [str ] = None ,
357
+ duration_seconds : Optional [int ] = None ,
358
+ command_type : Optional [EvgCommandType ] = None ,
359
+ ) -> BuiltInCommand :
360
+ """
361
+ Command to call the aws assumeRole API and returns credentials as expansions.
362
+
363
+ :param role_arn: string ARN of the role you want to assume.
364
+ :param policy: string in JSON format that you want to use as an inline session policy.
365
+ :param duration_seconds: Int in seconds of how long the returned credentials will be valid.
366
+ :return: ec2.assume_role command.
367
+ """
368
+ return BuiltInCommand (
369
+ command = "ec2.assume_role" ,
370
+ params = {
371
+ "role_arn" : role_arn ,
372
+ "policy" : policy ,
373
+ "duration_seconds" : duration_seconds ,
374
+ },
375
+ type = command_type ,
376
+ )
377
+
378
+
353
379
def expansions_update (
354
380
updates : Optional [List [KeyValueParam ]] = None ,
355
381
file : Optional [str ] = None ,
You can’t perform that action at this time.
0 commit comments