| API ECS service → ECR repositoriesonly when computeEnabled = true | ECS pulls the api image when a task starts | - iam api execution role: AmazonECSTaskExecutionRolePolicy (ECR pull, CloudWatch Logs write)
createIamRoles - route public route table: 0.0.0.0/0 → minitickets-dev-igw. The task has a public IP; there is no NAT gateway and no VPC endpoint.
createNetwork - sg-rule api-sg outbound rule minitickets-dev-api-out-all: all traffic to 0.0.0.0/0
createSecurityGroups
|
| Web ECS service → ECR repositoriesonly when entryEnabled = true | ECS pulls the web image when a task starts | - iam web execution role: AmazonECSTaskExecutionRolePolicy (ECR pull, CloudWatch Logs write)
createWebIamRole - route public route table: 0.0.0.0/0 → minitickets-dev-igw. The task has a public IP; there is no NAT gateway and no VPC endpoint.
createNetwork - sg-rule web-sg outbound rule minitickets-dev-web-out-all: all traffic to 0.0.0.0/0
createSecurityGroups
|
| Worker Lambda → ECR repositoriesonly when computeEnabled = true | the Lambda service pulls the worker image when the function is created or updated | - resource-policy repository policy LambdaPullWorkerImage on minitickets-dev-worker: lambda.amazonaws.com may ecr:BatchGetImage and ecr:GetDownloadUrlForLayer when aws:SourceArn is function:minitickets-dev-*
allowLambdaPull
|
| Tickets Lambda → ECR repositoriesonly when computeEnabled = true | the Lambda service pulls the same worker image for the tickets function | - resource-policy the same repository policy: function:minitickets-dev-* matches minitickets-dev-tickets
allowLambdaPull
|
| API task definition → API task execution roleonly when computeEnabled = true | ECS assumes the execution role to start each api task | - iam trust policy: ecs-tasks.amazonaws.com may sts:AssumeRole, only when aws:SourceAccount is our account
createIamRoles
|
| API task definition → API task roleonly when computeEnabled = true | the running api code gets this role's credentials | - iam trust policy: ecs-tasks.amazonaws.com may sts:AssumeRole, only when aws:SourceAccount is our account
createIamRoles
|
| Web task definition → Web task execution roleonly when entryEnabled = true | ECS assumes it to start each web task (web has no task role) | - iam trust policy: ecs-tasks.amazonaws.com may sts:AssumeRole, only when aws:SourceAccount is our account
createWebIamRole
|
| Migration task definition → API task execution roleonly when computeEnabled = true | the migration borrows the api execution role (no task role) | - iam trust policy: ecs-tasks.amazonaws.com may sts:AssumeRole, only when aws:SourceAccount is our account
createIamRoles
|
| Worker Lambda → Worker Lambda execution roleonly when computeEnabled = true | the worker function runs with this role | |
| Tickets Lambda → Tickets Lambda execution roleonly when computeEnabled = true | the tickets function runs with this role | |
| API ECS service → CloudWatch log groupsonly when computeEnabled = true | the awslogs driver sends every api line to /minitickets/dev/api | - iam api execution role managed policy: logs:CreateLogStream, logs:PutLogEvents
createIamRoles - route public route table: 0.0.0.0/0 → minitickets-dev-igw. The task has a public IP; there is no NAT gateway and no VPC endpoint.
createNetwork
|
| Web ECS service → CloudWatch log groupsonly when entryEnabled = true | the awslogs driver sends every web line to /minitickets/dev/web | - iam web execution role managed policy: logs:CreateLogStream, logs:PutLogEvents
createWebIamRole - route public route table: 0.0.0.0/0 → minitickets-dev-igw. The task has a public IP; there is no NAT gateway and no VPC endpoint.
createNetwork
|
| Worker Lambda → CloudWatch log groupsonly when computeEnabled = true | worker lines go to /minitickets/dev/worker | - iam worker role WriteWorkerLogs: logs:CreateLogStream, logs:PutLogEvents on /minitickets/dev/worker:*
createWorkerRole - config loggingConfig logGroup /minitickets/dev/worker (not the default /aws/lambda/…)
createWorkerLambda
|
| Tickets Lambda → CloudWatch log groupsonly when computeEnabled = true | tickets lines go to /minitickets/dev/tickets | - iam tickets role: logs:CreateLogStream, logs:PutLogEvents on /minitickets/dev/tickets:*
createTicketRole
|
| API ECS service → Booking-events SNS topiconly when computeEnabled = true | the outbox relay publishes each booking-confirmed event | - iam api task role, policy send-jobs: sns:Publish on minitickets-dev-booking-events only
createIamRoles - route public route table: 0.0.0.0/0 → minitickets-dev-igw. The task has a public IP; there is no NAT gateway and no VPC endpoint.
createNetwork
|
| Booking-events SNS topic → Jobs SQS queue | SNS delivers a copy to the email queue | - resource-policy queue policy: sns.amazonaws.com may sqs:SendMessage on this queue, only when aws:SourceArn is the topic and aws:SourceAccount is ours
createBookingEvents - trigger SNS subscription protocol sqs, rawMessageDelivery true
createBookingEvents
|
| Booking-events SNS topic → Tickets SQS queue | SNS delivers a copy to the tickets queue | - resource-policy queue policy: sns.amazonaws.com may sqs:SendMessage on this queue, only when aws:SourceArn is the topic and aws:SourceAccount is ours
createBookingEvents - trigger SNS subscription protocol sqs, rawMessageDelivery true
createBookingEvents
|
| Jobs SQS queue → Worker Lambdaonly when computeEnabled = true | the event source mapping polls the queue and calls the worker with batches | - trigger event source mapping: batchSize 10, functionResponseTypes ReportBatchItemFailures, maximumConcurrency 5
createQueueTrigger - iam worker role ReadJobsQueue: sqs:ReceiveMessage, sqs:DeleteMessage, sqs:ChangeMessageVisibility, sqs:GetQueueAttributes on minitickets-dev-jobs
createWorkerRole
|
| Tickets SQS queue → Tickets Lambdaonly when computeEnabled = true | the event source mapping calls the tickets function with one message at a time | - trigger event source mapping: batchSize 1, ReportBatchItemFailures, maximumConcurrency 2
createTicketLambda - iam tickets role: sqs:ReceiveMessage, sqs:DeleteMessage, sqs:GetQueueAttributes on minitickets-dev-tickets
createTicketRole
|
| Worker Lambda → Processed-jobs tableonly when computeEnabled = true | GetItem before sending; a conditional PutItem after sending | - iam worker role ProcessedJobsTable: dynamodb:GetItem, dynamodb:PutItem on minitickets-dev-processed-jobs
createWorkerRole
|
| Worker Lambda → SES email identitiesonly when computeEnabled = true | SendEmail from no-reply@minitickets.theversehub.in | - iam worker role SendBookingEmails: ses:SendEmail on our identity ARNs, condition ses:FromAddress = no-reply@minitickets.theversehub.in
createWorkerRole - config env MAILER ses and MAIL_FROM no-reply@minitickets.theversehub.in
createWorkerLambda
|
| Tickets Lambda → Tickets tableonly when computeEnabled = true | reserves and completes the ticket items | - iam tickets role: dynamodb:GetItem, dynamodb:PutItem, dynamodb:UpdateItem on minitickets-dev-tickets
createTicketRole
|
| Tickets Lambda → Ticket assets bucketonly when computeEnabled = true | writes the QR PNGs under tickets/ | |
| API ECS service → Tickets tableonly when computeEnabled = true | reads one user's tickets for My tickets | - iam api task role ReadTickets: dynamodb:Query on minitickets-dev-tickets (no Scan, no writes)
createIamRoles - route public route table: 0.0.0.0/0 → minitickets-dev-igw. The task has a public IP; there is no NAT gateway and no VPC endpoint.
createNetwork
|
| API ECS service → Ticket assets bucketonly when computeEnabled = true | signs GET and PUT URLs, and copies a checked upload to posters/ | - iam api task role: s3:GetObject on tickets/*, posters/*, poster-uploads/*; s3:PutObject on posters/* and poster-uploads/* only with x-amz-server-side-encryption AES256
createIamRoles - resource-policy bucket policy: Deny every s3:* request when aws:SecureTransport is false
createTicketStorage
|
| CloudWatch alarms → Alerts SNS topic | each alarm publishes on ALARM and on OK | - resource-policy topic policy OurCloudWatchAlarmsMayPublish: cloudwatch.amazonaws.com may sns:Publish, only for aws:SourceArn alarm:minitickets-dev-* in our account
createAlertTopic - config alarmActions and okActions = [alert topic ARN]
createAlarms
|
| CD publish job → GitHub publish role | swaps its GitHub OIDC token for 1-hour AWS credentials | - iam trust policy: Federated = the GitHub OIDC provider, sts:AssumeRoleWithWebIdentity, aud = sts.amazonaws.com, sub = <subject prefix>:ref:refs/heads/main
createCicd
|
| CD deploy job → GitHub deploy role | swaps its GitHub OIDC token for 2-hour AWS credentials | - iam deploy role trust: sts:AssumeRoleWithWebIdentity; Federated = the GitHub OIDC provider, aud = sts.amazonaws.com, sub = <subject prefix>:environment:dev
createCicd
|
| GitHub publish role → GitHub OIDC identity provider | the role trusts tokens from this provider only | - config Principal Federated = the OIDC provider ARN; clientIdLists [sts.amazonaws.com]
createCicd
|
| GitHub deploy role → GitHub OIDC identity provider | the role trusts tokens from this provider only | - config Principal Federated = the OIDC provider ARN
createCicd
|
| CD publish job → ECR repositories | docker push api, web and worker :<git sha> | - iam publish role push-images: ecr:GetAuthorizationToken (*), and push/pull actions on the 3 repositories only
publishPolicyDocument
|
| CD deploy job → ECR repositories | checks the tag exists and adds the tag deployed-<sha> | - iam deploy role OurEcrRepos: ecr:* on the 3 repository ARNs
createCicd
|
| CD deploy job → Release parameters | reads deployed-commit for the guard; normally writes image-tag in phase B (phase A if no current image); records deployed-commit at the end if an infrastructure apply ran, including failure or cancellation | - iam deploy role OurReleaseParameters grants ssm:GetParameter and ssm:PutParameter on the two parameter ARNs; ReadOurParameterPath grants ssm:GetParametersByPath under /minitickets/dev
createCicd
|
| CD deploy job → Migration task definitiononly when computeEnabled = true | runs the migration task (scripts/run-migrations.sh) with launch type FARGATE | - iam deploy role StackServices ecs:* and PassOurRolesToEcsTasksAndLambda: iam:PassRole on minitickets-dev-* to ecs-tasks.amazonaws.com
createCicd
|
| CD deploy job → API ECS serviceonly when computeEnabled = true | phase B pulumi up rolls the services; aws ecs wait services-stable | - iam deploy role StackServices grants ecs:* on Resource *; PassOurRolesToEcsTasksAndLambda grants iam:PassRole on minitickets-dev-* to ECS tasks; DenyOtherRegions blocks calls outside us-east-1
createCicd
|