Skip to content

Commit

Permalink
fix(region-info): IAM service principal for China regions (#3491)
Browse files Browse the repository at this point in the history
* fix IAM service principal for China regions

* fix integration testings for correct China region service principals

* fix IAM service principal for China regions

* fix integration testings for correct China region service principals

* fix IAM principal for China region - ( aws-s3-deployment / aws-eks )

* remove two regions where we don't have the CDK Metadata resource

* remove two regions where we don't have the CDK Metadata resource

* remove two regions where we don't have the CDK Metadata resource

* fix additional Principal values for China region

* fix(region-info): merge changes from v1.4.0
  • Loading branch information
bnusunny authored and mergify[bot] committed Aug 14, 2019
1 parent 175471f commit 013c181
Show file tree
Hide file tree
Showing 109 changed files with 357 additions and 2,425 deletions.
24 changes: 2 additions & 22 deletions packages/@aws-cdk/app-delivery/test/integ.cicd.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"codepipeline.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "codepipeline.amazonaws.com"
}
}
],
Expand Down Expand Up @@ -426,17 +416,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"cloudformation.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "cloudformation.amazonaws.com"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"lambda.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "lambda.amazonaws.com"
}
}
],
Expand Down Expand Up @@ -225,17 +215,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"lambda.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "lambda.amazonaws.com"
}
}
],
Expand Down Expand Up @@ -441,17 +421,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"lambda.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "lambda.amazonaws.com"
}
}
],
Expand Down Expand Up @@ -615,17 +585,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"apigateway.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "apigateway.amazonaws.com"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"apigateway.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "apigateway.amazonaws.com"
}
}
],
Expand Down
24 changes: 2 additions & 22 deletions packages/@aws-cdk/aws-apigateway/test/integ.restapi.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"apigateway.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "apigateway.amazonaws.com"
}
}
],
Expand Down Expand Up @@ -399,17 +389,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"lambda.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "lambda.amazonaws.com"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"lambda.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "lambda.amazonaws.com"
}
}
],
Expand Down Expand Up @@ -256,17 +246,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"apigateway.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "apigateway.amazonaws.com"
}
}
],
Expand Down Expand Up @@ -397,17 +377,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"apigateway.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "apigateway.amazonaws.com"
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/test/test.restapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export = {
{
Action: "sts:AssumeRole",
Effect: "Allow",
Principal: { Service: { "Fn::Join": ["", ["apigateway.", { Ref: "AWS::URLSuffix" }]] } }
Principal: { Service: "apigateway.amazonaws.com" }
}
],
Version: "2012-10-17"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export = {
{
Action: "sts:AssumeRole",
Effect: "Allow",
Principal: { Service: { "Fn::Join": ["", ["autoscaling.", { Ref: "AWS::URLSuffix" }]] } }
Principal: {
Service: "autoscaling.amazonaws.com"
}
}
],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"lambda.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "lambda.amazonaws.com"
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudformation/test/test.resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export = testCase({
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": { "Fn::Join": ["", ["lambda.", { Ref: "AWS::URLSuffix" }]] }
"Service": "lambda.amazonaws.com"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"lambda.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "lambda.amazonaws.com"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"Resources": {
"Bucket83908E77": {
"Type": "AWS::S3::Bucket",
"DeletionPolicy": "Delete",
"UpdateReplacePolicy": "Delete"
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"TrailS30071F172": {
"Type": "AWS::S3::Bucket",
"DeletionPolicy": "Retain",
"UpdateReplacePolicy": "Retain"
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"TrailS3PolicyE42170FE": {
"Type": "AWS::S3::BucketPolicy",
Expand All @@ -22,17 +22,7 @@
"Action": "s3:GetBucketAcl",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"cloudtrail.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "cloudtrail.amazonaws.com"
},
"Resource": {
"Fn::GetAtt": [
Expand All @@ -50,17 +40,7 @@
},
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"cloudtrail.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "cloudtrail.amazonaws.com"
},
"Resource": {
"Fn::Join": [
Expand Down Expand Up @@ -127,4 +107,4 @@
]
}
}
}
}
8 changes: 2 additions & 6 deletions packages/@aws-cdk/aws-cloudtrail/test/test.cloudtrail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const ExpectedBucketPolicyProperties = {
Action: "s3:GetBucketAcl",
Effect: "Allow",
Principal: {
Service: {
"Fn::Join": ["", ["cloudtrail.", { Ref: "AWS::URLSuffix" }]]
}
Service: "cloudtrail.amazonaws.com"
},
Resource: {
"Fn::GetAtt": [
Expand All @@ -31,9 +29,7 @@ const ExpectedBucketPolicyProperties = {
},
Effect: "Allow",
Principal: {
Service: {
"Fn::Join": ["", ["cloudtrail.", { Ref: "AWS::URLSuffix" }]]
}
Service: "cloudtrail.amazonaws.com"
},
Resource: {
"Fn::Join": [
Expand Down
12 changes: 1 addition & 11 deletions packages/@aws-cdk/aws-codebuild/test/integ.caching.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,7 @@
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": {
"Fn::Join": [
"",
[
"codebuild.",
{
"Ref": "AWS::URLSuffix"
}
]
]
}
"Service": "codebuild.amazonaws.com"
}
}
],
Expand Down

0 comments on commit 013c181

Please sign in to comment.