@@ -144,9 +144,16 @@ test('use OpenID Connect principal from provider', () => {
144
144
expect ( stack . resolve ( principal . federated ) ) . toStrictEqual ( { Ref : 'MyProvider730BA1C8' } ) ;
145
145
} ) ;
146
146
147
- test ( 'SAML principal' , ( ) => {
147
+ test . each ( [
148
+ { name : 'SAML principal' , region : 'us-east-1' , expectedAud : 'https://signin.aws.amazon.com/saml' } ,
149
+ { name : 'SAML principal CN' , region : 'cn-northwest-1' , expectedAud : 'https://signin.amazonaws.cn/saml' } ,
150
+ { name : 'SAML principal UsGov' , region : 'us-gov-east-1' , expectedAud : 'https://signin.amazonaws-us-gov.com/saml' } ,
151
+ { name : 'SAML principal UsIso' , region : 'us-iso-east-1' , expectedAud : 'https://signin.c2shome.ic.gov/saml' } ,
152
+ { name : 'SAML principal UsIsoB' , region : 'us-isob-east-1' , expectedAud : 'https://signin.sc2shome.sgov.gov/saml' } ,
153
+ ] ) ( '$name' , ( { region, expectedAud } ) => {
148
154
// GIVEN
149
- const stack = new Stack ( ) ;
155
+ const app = new App ( ) ;
156
+ const stack = new Stack ( app , 'TestStack' , { env : { region } } ) ;
150
157
const provider = new iam . SamlProvider ( stack , 'MyProvider' , {
151
158
metadataDocument : iam . SamlMetadataDocument . fromXml ( 'document' ) ,
152
159
} ) ;
@@ -166,7 +173,7 @@ test('SAML principal', () => {
166
173
Action : 'sts:AssumeRoleWithSAML' ,
167
174
Condition : {
168
175
StringEquals : {
169
- 'SAML:aud' : 'https://signin.aws.amazon.com/saml' ,
176
+ 'SAML:aud' : expectedAud ,
170
177
} ,
171
178
} ,
172
179
Effect : 'Allow' ,
0 commit comments