Commit 4821d4e
authored
feat(cli): add sts:TagSession permission to trusted accounts on bootstrap (#762)
## Description
Accounts bootstrapped with `--trust` or `--trust-for-lookup` need
`sts:TagSession` permissions in AssumeRolePolicy.
I got errors during `cdk deploy` run in CD pipelines executed on EKS
cluster on the trusted account.
Error message:
Could not assume role in target account using current credentials (which
are for account `<TRUSTED_ACCOUT>`) User:
`arn:aws:sts::<TRUSTED_ACCOUT>:assumed-role/<eks-pod-role>` is not
authorized to perform: `sts:TagSession` on resource:
`arn:aws:iam::<TARGET_ACCOUNT>:role/cdk-hnb659fds-lookup-role-<TARGET_ACCOUNT>-us-east-1`
Troubleshooting revealed that DeploymentActionRole, FilePublishingRole,
ImagePublishingRole, LookupRole don't have `sts:TagSession`. After
updating AssumeRolePolicy `cdk deploy` worked normally.
Fixes aws/aws-cdk#31557
---
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license1 parent e042c55 commit 4821d4e
File tree
2 files changed
+106
-5
lines changed- packages
- @aws-cdk/toolkit-lib/test/api/bootstrap
- aws-cdk/lib/api/bootstrap
2 files changed
+106
-5
lines changedLines changed: 91 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
642 | 644 | | |
643 | 645 | | |
644 | 646 | | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
645 | 736 | | |
Lines changed: 15 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
314 | 316 | | |
315 | 317 | | |
316 | 318 | | |
| |||
340 | 342 | | |
341 | 343 | | |
342 | 344 | | |
343 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
344 | 348 | | |
345 | 349 | | |
346 | 350 | | |
| |||
370 | 374 | | |
371 | 375 | | |
372 | 376 | | |
373 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
374 | 380 | | |
375 | 381 | | |
376 | 382 | | |
377 | 383 | | |
378 | 384 | | |
379 | 385 | | |
380 | 386 | | |
381 | | - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
382 | 390 | | |
383 | 391 | | |
384 | 392 | | |
| |||
485 | 493 | | |
486 | 494 | | |
487 | 495 | | |
488 | | - | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
489 | 499 | | |
490 | 500 | | |
491 | 501 | | |
| |||
0 commit comments