@@ -170,7 +170,7 @@ Resources:
170
170
Name: !Sub ${CodeCommitRepository}-CDK
171
171
Description: "CDK project to deploy custom components for document understanding"
172
172
ServiceRole: !Sub ${CodeBuildRole.Arn}
173
- EncryptionKey: !Sub arn:aws :kms:${AWS::Region}:${AWS::AccountId}:alias/aws/s3
173
+ EncryptionKey: !Sub arn:${AWS::Partition} :kms:${AWS::Region}:${AWS::AccountId}:alias/aws/s3
174
174
Source:
175
175
Type: CODEPIPELINE
176
176
BuildSpec: |
@@ -362,10 +362,12 @@ Resources:
362
362
- !Join [
363
363
"",
364
364
[
365
- "arn:aws:logs:",
365
+ "arn:",
366
+ !Ref "AWS::Partition",
367
+ ":logs:",
366
368
Ref: "AWS::Region",
367
369
":",
368
- Ref: "AWS::AccountId",
370
+ ! Ref "AWS::AccountId",
369
371
":log-group:/aws/lambda/",
370
372
!Ref CICDHelper,
371
373
":*",
@@ -387,47 +389,47 @@ Resources:
387
389
Action:
388
390
- "apigateway:Delete*"
389
391
Resource:
390
- - !Sub "arn:aws :apigateway:${AWS::Region}::*"
392
+ - !Sub "arn:${AWS::Partition} :apigateway:${AWS::Region}::*"
391
393
- Effect: "Allow"
392
394
Action:
393
395
- "cloudformation:DeleteStack"
394
396
- "cloudformation:Describe*"
395
397
- "cloudformation:Delete*"
396
398
Resource:
397
- - !Sub "arn:aws :cloudformation:${AWS::Region}:${AWS::AccountId}:*"
399
+ - !Sub "arn:${AWS::Partition} :cloudformation:${AWS::Region}:${AWS::AccountId}:*"
398
400
- Effect: "Allow"
399
401
Action:
400
402
- "cognito-idp:AdminDeleteUser"
401
403
- "cognito-idp:DeleteUser"
402
404
- "cognito-idp:DeleteUserPool"
403
405
- "cognito-idp:DeleteUserPoolClient"
404
406
Resource:
405
- - !Sub "arn:aws :cognito-idp:${AWS::Region}:${AWS::AccountId}:*"
407
+ - !Sub "arn:${AWS::Partition} :cognito-idp:${AWS::Region}:${AWS::AccountId}:*"
406
408
- Effect: "Allow"
407
409
Action:
408
410
- "cognito-identity:DeleteIdentityPool"
409
411
- "cognito-identity:SetIdentityPoolRoles"
410
412
Resource:
411
- - !Sub "arn:aws :cognito-identity:${AWS::Region}:${AWS::AccountId}:*"
413
+ - !Sub "arn:${AWS::Partition} :cognito-identity:${AWS::Region}:${AWS::AccountId}:*"
412
414
- Effect: "Allow"
413
415
Action:
414
416
- "dynamodb:DeleteTable"
415
417
- "dynamodb:Describe*"
416
418
Resource:
417
- - !Sub "arn:aws :dynamodb:${AWS::Region}:${AWS::AccountId}:*"
419
+ - !Sub "arn:${AWS::Partition} :dynamodb:${AWS::Region}:${AWS::AccountId}:*"
418
420
- Effect: "Allow"
419
421
Action:
420
422
- "es:DeleteElasticsearchDomain"
421
423
- "es:DescribeElasticsearchDomain"
422
424
Resource:
423
- - !Sub "arn:aws :es:${AWS::Region}:${AWS::AccountId}:domain/*"
425
+ - !Sub "arn:${AWS::Partition} :es:${AWS::Region}:${AWS::AccountId}:domain/*"
424
426
- Effect: "Allow"
425
427
Action:
426
428
- "iam:Delete*"
427
429
- "iam:Describe*"
428
430
- "iam:DetachRolePolicy"
429
431
Resource:
430
- - !Sub "arn:aws :iam::${AWS::AccountId}:*"
432
+ - !Sub "arn:${AWS::Partition} :iam::${AWS::AccountId}:*"
431
433
- Effect: "Allow"
432
434
Action:
433
435
- "lambda:GetEventSourceMapping"
@@ -437,7 +439,7 @@ Resources:
437
439
- "lambda:DeleteLayerVersion"
438
440
- "lambda:DeleteEventSourceMapping"
439
441
Resource:
440
- - !Sub "arn:aws :lambda:${AWS::Region}:${AWS::AccountId}:*"
442
+ - !Sub "arn:${AWS::Partition} :lambda:${AWS::Region}:${AWS::AccountId}:*"
441
443
- Effect: "Allow"
442
444
Action:
443
445
- "lambda:GetEventSourceMapping"
@@ -449,19 +451,19 @@ Resources:
449
451
- "sns:GetTopicAttributes"
450
452
- "sns:Unsubscribe"
451
453
Resource:
452
- - !Sub "arn:aws :sns:${AWS::Region}:${AWS::AccountId}:*"
454
+ - !Sub "arn:${AWS::Partition} :sns:${AWS::Region}:${AWS::AccountId}:*"
453
455
- Effect: "Allow"
454
456
Action:
455
457
- "sqs:SetQueueAttributes"
456
458
- "sqs:DeleteQueue"
457
459
Resource:
458
- - !Sub "arn:aws :sqs:${AWS::Region}:${AWS::AccountId}:*"
460
+ - !Sub "arn:${AWS::Partition} :sqs:${AWS::Region}:${AWS::AccountId}:*"
459
461
- Effect: "Allow"
460
462
Action:
461
463
- "s3:DeleteBucketPolicy"
462
464
- "s3:DeleteBucket"
463
465
Resource:
464
- - !Sub "arn:aws :s3:::*"
466
+ - !Sub "arn:${AWS::Partition} :s3:::*"
465
467
- Effect: "Allow"
466
468
Action:
467
469
- "cloudfront:Get*"
@@ -477,7 +479,9 @@ Resources:
477
479
- !Join [
478
480
"",
479
481
[
480
- "arn:aws:s3:::",
482
+ "arn:",
483
+ !Ref "AWS::Partition",
484
+ ":s3:::",
481
485
!FindInMap ["SourceCode", "Source", "S3Bucket"],
482
486
"-",
483
487
!Ref "AWS::Region",
@@ -510,7 +514,7 @@ Resources:
510
514
"Statement": [
511
515
{
512
516
"Action": [ "s3:GetBucketVersioning" ],
513
- "Resource": [ "arn:aws :s3:::${ArtifactS3Bucket}" ],
517
+ "Resource": [ "arn:${AWS::Partition} :s3:::${ArtifactS3Bucket}" ],
514
518
"Effect": "Allow"
515
519
},
516
520
{
@@ -520,7 +524,7 @@ Resources:
520
524
"S3:GetObjectVersion"
521
525
],
522
526
"Resource": [
523
- "arn:aws :s3:::${ArtifactS3Bucket}/*"
527
+ "arn:${AWS::Partition} :s3:::${ArtifactS3Bucket}/*"
524
528
],
525
529
"Effect": "Allow"
526
530
},
@@ -532,7 +536,7 @@ Resources:
532
536
"codecommit:List*",
533
537
"codecommit:GitPull"
534
538
],
535
- "Resource": "arn:aws :codecommit:${AWS::Region}:${AWS::AccountId}:${CodeCommitRepository}",
539
+ "Resource": "arn:${AWS::Partition} :codecommit:${AWS::Region}:${AWS::AccountId}:${CodeCommitRepository}",
536
540
"Effect": "Allow"
537
541
},
538
542
{
@@ -541,7 +545,7 @@ Resources:
541
545
"codebuild:StartBuild"
542
546
],
543
547
"Resource": [
544
- "arn:aws :codebuild:${AWS::Region}:${AWS::AccountId}:project/${CodeBuildCDK}"
548
+ "arn:${AWS::Partition} :codebuild:${AWS::Region}:${AWS::AccountId}:project/${CodeBuildCDK}"
545
549
],
546
550
"Effect": "Allow"
547
551
}
@@ -571,7 +575,7 @@ Resources:
571
575
"Statement": [
572
576
{
573
577
"Effect": "Allow",
574
- "Resource": [ "arn:aws :logs:${AWS::Region}:${AWS::AccountId}:log-group:*" ],
578
+ "Resource": [ "arn:${AWS::Partition} :logs:${AWS::Region}:${AWS::AccountId}:log-group:*" ],
575
579
"Action": [
576
580
"logs:CreateLogGroup",
577
581
"logs:CreateLogStream",
@@ -585,7 +589,7 @@ Resources:
585
589
{
586
590
"Effect": "Allow",
587
591
"Resource": [
588
- "arn:aws :s3:::*"
592
+ "arn:${AWS::Partition} :s3:::*"
589
593
],
590
594
"Action": [
591
595
"s3:DeleteBucket",
@@ -623,7 +627,7 @@ Resources:
623
627
},
624
628
{
625
629
"Effect": "Allow",
626
- "Resource": "arn:aws :apigateway:${AWS::Region}::*",
630
+ "Resource": "arn:${AWS::Partition} :apigateway:${AWS::Region}::*",
627
631
"Action": [
628
632
"apigateway:Post",
629
633
"apigateway:Get*",
@@ -645,7 +649,7 @@ Resources:
645
649
},
646
650
{
647
651
"Effect": "Allow",
648
- "Resource": "arn:aws :cloudfront::${AWS::AccountId}:distribution/*",
652
+ "Resource": "arn:${AWS::Partition} :cloudfront::${AWS::AccountId}:distribution/*",
649
653
"Action": [
650
654
"cloudfront:CreateDistribution",
651
655
"cloudfront:DeleteDistribution",
@@ -656,7 +660,7 @@ Resources:
656
660
},
657
661
{
658
662
"Effect": "Allow",
659
- "Resource": "arn:aws :cloudformation:${AWS::Region}:${AWS::AccountId}:*",
663
+ "Resource": "arn:${AWS::Partition} :cloudformation:${AWS::Region}:${AWS::AccountId}:*",
660
664
"Action": [
661
665
"cloudformation:GetTemplate",
662
666
"cloudformation:DescribeStacks",
@@ -691,7 +695,7 @@ Resources:
691
695
},
692
696
{
693
697
"Effect": "Allow",
694
- "Resource": "arn:aws :dynamodb:${AWS::Region}:${AWS::AccountId}:*",
698
+ "Resource": "arn:${AWS::Partition} :dynamodb:${AWS::Region}:${AWS::AccountId}:*",
695
699
"Action": [
696
700
"dynamodb:CreateTable",
697
701
"dynamodb:DeleteTable",
@@ -741,7 +745,7 @@ Resources:
741
745
},
742
746
{
743
747
"Effect": "Allow",
744
- "Resource": "arn:aws :es:${AWS::Region}:${AWS::AccountId}:domain/*",
748
+ "Resource": "arn:${AWS::Partition} :es:${AWS::Region}:${AWS::AccountId}:domain/*",
745
749
"Action": [
746
750
"es:Describe*",
747
751
"es:CreateElasticsearchDomain",
@@ -754,7 +758,7 @@ Resources:
754
758
},
755
759
{
756
760
"Effect": "Allow",
757
- "Resource": "arn:aws :iam::${AWS::AccountId}:*",
761
+ "Resource": "arn:${AWS::Partition} :iam::${AWS::AccountId}:*",
758
762
"Action": [
759
763
"iam:PassRole",
760
764
"iam:CreateRole",
@@ -808,7 +812,7 @@ Resources:
808
812
},
809
813
{
810
814
"Effect": "Allow",
811
- "Resource": "arn:aws :sns:${AWS::Region}:${AWS::AccountId}:*",
815
+ "Resource": "arn:${AWS::Partition} :sns:${AWS::Region}:${AWS::AccountId}:*",
812
816
"Action": [
813
817
"sns:AddPermission",
814
818
"sns:CreateTopic",
@@ -834,7 +838,7 @@ Resources:
834
838
"sqs:ListQueues",
835
839
"sqs:SetQueueAttributes"
836
840
],
837
- "Resource": "arn:aws :sqs:${AWS::Region}:${AWS::AccountId}:*",
841
+ "Resource": "arn:${AWS::Partition} :sqs:${AWS::Region}:${AWS::AccountId}:*",
838
842
"Effect": "Allow"
839
843
},
840
844
{
@@ -847,7 +851,7 @@ Resources:
847
851
"states:TagResource",
848
852
"states:UntagResource"
849
853
],
850
- "Resource": "arn:aws :states:${AWS::Region}:${AWS::AccountId}:stateMachine:*",
854
+ "Resource": "arn:${AWS::Partition} :states:${AWS::Region}:${AWS::AccountId}:stateMachine:*",
851
855
"Effect": "Allow"
852
856
}
853
857
]
@@ -875,7 +879,9 @@ Resources:
875
879
!Join [
876
880
"",
877
881
[
878
- "arn:aws:codepipeline:",
882
+ "arn:",
883
+ !Ref "AWS::Partition",
884
+ ":codepipeline:",
879
885
!Ref "AWS::Region",
880
886
":",
881
887
!Ref "AWS::AccountId",
@@ -898,7 +904,9 @@ Resources:
898
904
- !Join [
899
905
"",
900
906
[
901
- "arn:aws:codecommit:",
907
+ "arn:",
908
+ !Ref "AWS::Partition",
909
+ ":codecommit:",
902
910
!Ref "AWS::Region",
903
911
":",
904
912
!Ref "AWS::AccountId",
@@ -919,7 +927,9 @@ Resources:
919
927
!Join [
920
928
"",
921
929
[
922
- "arn:aws:codepipeline:",
930
+ "arn:",
931
+ !Ref "AWS::Partition",
932
+ ":codepipeline:",
923
933
!Ref "AWS::Region",
924
934
":",
925
935
!Ref "AWS::AccountId",
0 commit comments