Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { IAM, Fn } from "cloudform";
export const UnauthenticatedUserRole = new IAM.Role({
RoleName: "passninja-unauthenticated-user-role",
AssumeRolePolicyDocument: {
Version: "2012-10-17",
Statement: [
{
Effect: "Allow",
Principal: {
Federated: "cognito-identity.amazonaws.com"
},
Action: "sts:AssumeRoleWithWebIdentity",
Condition: {
StringEquals: {
"cognito-identity.amazonaws.com:aud": Fn.ImportValue("IdentityPoolId")
},
"ForAnyValue:StringLike": {
"cognito-identity.amazonaws.com:amr": "unauthenticated"
import { IAM, Fn } from "cloudform";
export const CustomerRole = new IAM.Role({
RoleName: "passninja-customer-role",
AssumeRolePolicyDocument: {
Version: "2012-10-17",
Statement: [
{
Effect: "Allow",
Principal: {
Federated: "cognito-identity.amazonaws.com"
},
Action: "sts:AssumeRoleWithWebIdentity",
Condition: {
StringEquals: {
"cognito-identity.amazonaws.com:aud": Fn.ImportValue("IdentityPoolId")
},
"ForAnyValue:StringLike": {
"cognito-identity.amazonaws.com:amr": "authenticated"
import { IAM } from "cloudform";
export const ApiGatewayRole = new IAM.Role({
RoleName: `ApiGatewayRole`,
AssumeRolePolicyDocument: {
Version: "2012-10-17",
Statement: [
{
Effect: "Allow",
Action: "sts:AssumeRole",
Principal: {
Service: "apigateway.amazonaws.com"
}
}
]
}
});