{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "S3BucketAccess",
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:PutObject",
        "s3:DeleteObject",
        "s3:ListBucket",
        "s3:GetBucketLocation"
      ],
      "Resource": [
        "arn:aws:s3:::${INPUT_BUCKET}",
        "arn:aws:s3:::${INPUT_BUCKET}/*",
        "arn:aws:s3:::${OUTPUT_BUCKET}",
        "arn:aws:s3:::${OUTPUT_BUCKET}/*"
      ]
    },
    {
      "Sid": "TextractAccess",
      "Effect": "Allow",
      "Action": [
        "textract:AnalyzeDocument",
        "textract:DetectDocumentText",
        "textract:AnalyzeExpense",
        "textract:StartDocumentAnalysis",
        "textract:StartDocumentTextDetection",
        "textract:GetDocumentAnalysis",
        "textract:GetDocumentTextDetection"
      ],
      "Resource": "*"
    },
    {
      "Sid": "TranscribeAccess",
      "Effect": "Allow",
      "Action": [
        "transcribe:StartTranscriptionJob",
        "transcribe:StartMedicalTranscriptionJob",
        "transcribe:GetTranscriptionJob",
        "transcribe:GetMedicalTranscriptionJob",
        "transcribe:DeleteTranscriptionJob",
        "transcribe:DeleteMedicalTranscriptionJob",
        "transcribe:ListTranscriptionJobs",
        "transcribe:ListMedicalTranscriptionJobs"
      ],
      "Resource": "*"
    },
    {
      "Sid": "TranslateAccess",
      "Effect": "Allow",
      "Action": [
        "translate:TranslateText",
        "translate:TranslateDocument",
        "translate:ListLanguages"
      ],
      "Resource": "*"
    },
    {
      "Sid": "PollyAccess",
      "Effect": "Allow",
      "Action": [
        "polly:SynthesizeSpeech",
        "polly:DescribeVoices",
        "polly:GetLexicon",
        "polly:ListLexicons"
      ],
      "Resource": "*"
    },
    {
      "Sid": "ComprehendAccess",
      "Effect": "Allow",
      "Action": [
        "comprehend:DetectDominantLanguage",
        "comprehend:DetectEntities",
        "comprehend:DetectKeyPhrases",
        "comprehend:DetectSentiment",
        "comprehend:DetectSyntax"
      ],
      "Resource": "*"
    },
    {
      "Sid": "ComprehendMedicalAccess",
      "Effect": "Allow",
      "Action": [
        "comprehendmedical:DetectEntitiesV2",
        "comprehendmedical:DetectPHI",
        "comprehendmedical:InferICD10CM",
        "comprehendmedical:InferRxNorm"
      ],
      "Resource": "*"
    },
    {
      "Sid": "STSAccess",
      "Effect": "Allow",
      "Action": [
        "sts:GetCallerIdentity"
      ],
      "Resource": "*"
    },
    {
      "Sid": "SecretsManagerAccess",
      "Effect": "Allow",
      "Action": [
        "secretsmanager:GetSecretValue"
      ],
      "Resource": "arn:aws:secretsmanager:${AWS_REGION}:${AWS_ACCOUNT_ID}:secret:${SECRET_NAME}*"
    }
  ]
}
