You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cognito-identitypool-alpha): validation error if provided id is a token (#30882)
### Issue # (if applicable)
Closes#29780.
Closes#28184.
### Description of changes
Skips validations if provided id is an unresolved token.
### Description of how you validated changes
Added unit tests not to throw errors even if the resolved value is incorrect.
### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
expect(()=>IdentityPool.fromIdentityPoolId(stack,'idPoolIdError','idPool')).toThrowError('Invalid Identity Pool Id: Identity Pool Ids must follow the format <region>:<id>');
207
-
expect(()=>IdentityPool.fromIdentityPoolArn(stack,'idPoolArnError','arn:aws:cognito-identity:my-region:1234567891011:identitypool\/your-region:idPool/')).toThrowError('Invalid Identity Pool Id: Region in Identity Pool Id must match stack region');
207
+
expect(()=>IdentityPool.fromIdentityPoolId(stack,'idPoolIdError','idPool')).toThrow('Invalid Identity Pool Id: Identity Pool Ids must follow the format <region>:<id>');
208
+
expect(()=>IdentityPool.fromIdentityPoolId(stack,'idPoolIdRegionError','your-region:idPool')).toThrow('Invalid Identity Pool Id: Region in Identity Pool Id must match stack region');
209
+
expect(()=>IdentityPool.fromIdentityPoolArn(stack,'idPoolArnError','arn:aws:cognito-identity:my-region:1234567891011:identitypool\/your-region:idPool/')).toThrow('Invalid Identity Pool Id: Region in Identity Pool Id must match stack region');
0 commit comments