[{"data":1,"prerenderedAt":72},["ShallowReactive",2],{"/2025/11/19-aws-cloudformation-starting-ec2-instance-requires-ec2-runinstances-permission":3},{"id":4,"title":5,"body":6,"date":63,"description":60,"extension":64,"meta":65,"navigation":66,"path":67,"robots":68,"seo":69,"stem":70,"__hash__":71},"posts/2025/11/19 AWS-CloudFormation-starting-EC2-Instance-requires-ec2-RunInstances-permission.md","19 AWS CloudFormation Starting EC2 Instance Requires Ec2 RunInstances Permission",{"type":7,"value":8,"toc":59},"minimark",[9,18,25,28,45,47],[10,11,13],"post-title",{":date":12},"date",[14,15,17],"h1",{"id":16},"aws-cloudformation-starting-ec2-instance-requires-ec2runinstances-permission","AWS CloudFormation Starting EC2 Instance Requires ec2:RunInstances Permission",[19,20,21],"notes",{},[22,23,24],"p",{},"This is a repost from my old blog. First posted in 1/20/2020.",[26,27],"br",{},[22,29,30,31,39,40,44],{},"Another weird case with AWS CloudFormation. I attempted to start an EC2 instance and for somewhat reason it failed and said it doesn't have ",[32,33,38],"code",{"className":34},[35,36,37],"bg-gray-200","p-2","rounded","ec2:RunInstances"," permission, but it does. After few checks, I found out that the cause is the ",[32,41,43],{"className":42},[35,36,37],"IamInstanceProfile",". If it is set, the error happens.",[26,46],{},[22,48,49,50,54,55,58],{},"With clue from some online forum, I tried adding ",[32,51,53],{"className":52},[35,36,37],"iam:PassRole"," permission for CloudFormation instead of the required ",[32,56,38],{"className":57},[35,36,37]," and it works!",{"title":60,"searchDepth":61,"depth":61,"links":62},"",2,[],"2025-11-19T00:00:00.000Z","md",{},true,"/2025/11/19-aws-cloudformation-starting-ec2-instance-requires-ec2-runinstances-permission",null,{"title":5,"description":60},"2025/11/19 AWS-CloudFormation-starting-EC2-Instance-requires-ec2-RunInstances-permission","NdcOmUr3k0YAjWjc_yTH8e_efr2ZCdPh05aSIOsLcB0",1785167452475]