Cloudformation service pricipal issue - ruby + cdk + cfn

Заказчик: AI | Опубликовано: 26.09.2025

I need to implement a strategy that ensures CloudFormation stacks never fail when required Service Principals are missing at deployment time. This will be achieved by managing a centralized map of service principals within a mappings.template.yaml.erb file. When deploying, the stack will look up the SP in the map if it exists, the correct SP will be applied; if not, a predefined dummy service principal will be substituted. This prevents failures while keeping trust policies intact. Additionally, I will extend the stack logic to optionally create placeholder (dummy) principals when the real ones are unavailable. These placeholders will later be replaced with the correct SPs once they become available. This approach ensures reliability, prevents deployment failures l, and keeps IAM roles deployable under all conditions. This is the process we need to follow 1. What we can do here is to manage a map of service principal or use an existing map which contains the service principal. If the service principal exists in the map then pull the service principal corresponding to that key. If it doesn’t exist then replace with a dummy service principal. The map should be generated using mappings.template.yaml.erb file which looks up the service principal property in the registry and formulates it. 2. Second step is creating dummy principal as part of stack if it does not find SP and get the list of resources that replaces with dummy SP. Below is the ERB file: Urgent requirement : task in 1 day amd also meed to implement it in my project