@@ -432,7 +432,12 @@ functions:
432
432
"iam_auth_assume_role_name" : "${iam_auth_assume_role_name}",
433
433
"iam_auth_ec2_instance_account" : "${iam_auth_ec2_instance_account}",
434
434
"iam_auth_ec2_instance_secret_access_key" : "${iam_auth_ec2_instance_secret_access_key}",
435
- "iam_auth_ec2_instance_profile" : "${iam_auth_ec2_instance_profile}"
435
+ "iam_auth_ec2_instance_profile" : "${iam_auth_ec2_instance_profile}",
436
+ "iam_auth_assume_web_role_name": "${iam_auth_assume_web_role_name}",
437
+ "iam_web_identity_issuer": "${iam_web_identity_issuer}",
438
+ "iam_web_identity_rsa_key": "${iam_web_identity_rsa_key}",
439
+ "iam_web_identity_jwks_uri": "${iam_web_identity_jwks_uri}",
440
+ "iam_web_identity_token_file": "${iam_web_identity_token_file}"
436
441
}
437
442
EOF
438
443
@@ -551,6 +556,76 @@ functions:
551
556
mongo --nodb setup.js aws_e2e_ecs.js
552
557
cd -
553
558
559
+ run-aws-auth-test-with-aws-web-identity-credentials :
560
+ - command : shell.exec
561
+ type : test
562
+ params :
563
+ working_dir : mongo-csharp-driver
564
+ script : |
565
+ ${PREPARE_SHELL}
566
+ if [ "${skip_web_identity_auth_test}" = "true" ]; then
567
+ echo "This platform does not support the web identity auth test, skipping..."
568
+ exit 0
569
+ fi
570
+ cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
571
+ . ./activate_venv.sh
572
+ mongo aws_e2e_web_identity.js
573
+ - command : shell.exec
574
+ type : test
575
+ params :
576
+ working_dir : mongo-csharp-driver
577
+ silent : true
578
+ script : |
579
+ if [ "${skip_web_identity_auth_test}" = "true" ]; then
580
+ echo "This platform does not support the web identity auth test, skipping..."
581
+ exit 0
582
+ fi
583
+ # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
584
+ cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
585
+ export AWS_ROLE_ARN="${iam_auth_assume_web_role_name}"
586
+ export AWS_WEB_IDENTITY_TOKEN_FILE="${iam_web_identity_token_file}"
587
+ export MONGODB_URI="mongodb://localhost"
588
+ EOF
589
+ - command : shell.exec
590
+ type : test
591
+ params :
592
+ working_dir : mongo-csharp-driver
593
+ script : |
594
+ ${PREPARE_SHELL}
595
+ if [ "${skip_web_identity_auth_test}" = "true" ]; then
596
+ echo "This platform does not support the web identity auth test, skipping..."
597
+ exit 0
598
+ fi
599
+ PROJECT_DIRECTORY=${PROJECT_DIRECTORY} OS=$OS ASSERT_NO_URI_CREDS=true evergreen/run-mongodb-aws-test.sh
600
+ - command : shell.exec
601
+ type : test
602
+ params :
603
+ working_dir : mongo-csharp-driver
604
+ silent : true
605
+ script : |
606
+ if [ "${skip_EC2_auth_test}" = "true" ]; then
607
+ echo "This platform does not support the web identity auth test, skipping..."
608
+ exit 0
609
+ fi
610
+ # DO NOT ECHO WITH XTRACE (which PREPARE_SHELL does)
611
+ cat <<'EOF' > "${PROJECT_DIRECTORY}/prepare_mongodb_aws.sh"
612
+ export AWS_ROLE_ARN="${iam_auth_assume_web_role_name}"
613
+ export AWS_WEB_IDENTITY_TOKEN_FILE="${iam_web_identity_token_file}"
614
+ export AWS_ROLE_SESSION_NAME="test"
615
+ export MONGODB_URI="mongodb://localhost"
616
+ EOF
617
+ - command : shell.exec
618
+ type : test
619
+ params :
620
+ working_dir : mongo-csharp-driver
621
+ script : |
622
+ ${PREPARE_SHELL}
623
+ if [ "${skip_web_identity_auth_test}" = "true" ]; then
624
+ echo "This platform does not support the web identity auth test, skipping..."
625
+ exit 0
626
+ fi
627
+ PROJECT_DIRECTORY=${PROJECT_DIRECTORY} OS=$OS ASSERT_NO_URI_CREDS=true evergreen/run-mongodb-aws-test.sh
628
+
554
629
run-aws-auth-test-with-aws-credentials-as-environment-variables :
555
630
- command : shell.exec
556
631
type : test
@@ -1067,6 +1142,7 @@ tasks:
1067
1142
- func : run-aws-auth-test-with-aws-credentials-and-session-token-as-environment-variables
1068
1143
- func : run-aws-auth-test-with-aws-EC2-credentials
1069
1144
- func : run-aws-auth-test-with-aws-ECS-credentials
1145
+ - func : run-aws-auth-test-with-aws-web-identity-credentials
1070
1146
1071
1147
- name : stable-api-tests-net472
1072
1148
commands :
@@ -1599,6 +1675,7 @@ axes:
1599
1675
variables :
1600
1676
OS : " windows-64"
1601
1677
skip_ECS_auth_test : true
1678
+ skip_web_identity_auth_test : true
1602
1679
run_on : windows-64-vs2017-test
1603
1680
- id : " ubuntu-1804"
1604
1681
display_name : " Ubuntu 18.04"
@@ -1611,13 +1688,15 @@ axes:
1611
1688
OS : " macos-1100"
1612
1689
skip_EC2_auth_test : true
1613
1690
skip_ECS_auth_test : true
1691
+ skip_web_identity_auth_test : true
1614
1692
run_on : macos-1100
1615
1693
- id : " macos-1100-arm64"
1616
1694
display_name : " macOS 11.00 M1"
1617
1695
variables :
1618
1696
OS : " macos-1100-arm64"
1619
1697
skip_EC2_auth_test : true
1620
1698
skip_ECS_auth_test : true
1699
+ skip_web_identity_auth_test : true
1621
1700
run_on : macos-1100-arm64
1622
1701
1623
1702
- id : topology
0 commit comments