#✅ - Accidentally deleted cdk IAM roles. Any way to recreate it? All GEN2 deployments are failing.

3 messages · Page 1 of 1 (latest)

void trench
#

I accidently deleted aws cdk generated roles because of which deployments are failing. Any cdk command to recreate the missing roles for it to work properly?
i did cdk bootstrap but no luck. I still have the artifacts/cdk.out, any chance to restore from it?

[19:35:18] Call failed: createChangeSet({"StackName":"CdkLatestStack","ChangeSetName":"cdk-deploy-change-set","ChangeSetType":"UPDATE","Description":"CDK Changeset for execution 0b899349-b1af-49aa-83d3-f4e233b791c5","ClientToken":"create0b899349-xxxx-49aa-83d3-xxxxxxxxxxxx","Capabilities":["CAPABILITY_IAM","CAPABILITY_NAMED_IAM","CAPABILITY_AUTO_EXPAND"],"Parameters":[{"ParameterKey":"BootstrapVersion","UsePreviousValue":true}],"RoleARN":"arn:aws:iam::xxxxxxxxx:role/cdk-hnb659fds-cfn-exec-role-xxxxxxxxx-us-east-1","TemplateURL":"https://s3.us-east-1.amazonaws.com/cdk-hnb659fds-assets-xxxxxxxxxx-us-east-1/cc99121a795d44e96a59da4f654asf65a4sdf6b4838850237ea1567ef3e21e8.json","Tags":[]}) => Role arn:aws:iam::xxxxxxx:role/cdk-hnb659fds-cfn-exec-role-xxxxxxxxxx-us-east-1 is invalid or cannot be assumed (code=ValidationError)

:x:  CdkLatestStack failed: Error [ValidationError]: Role arn:aws:iam::xxxxxxxx:role/cdk-hnb659fds-cfn-exec-role-xxxxxxxxx-us-east-1 is invalid or cannot be assumed
   at Request.extractError (/home/xxxxxxxx/.nvm/versions/node/v22.2.0/lib/node_modules/aws-cdk/lib/index.js:390:46692) ```
void trench
#

FIX: I deleted the bootstrap stack and recreated it. it created all the missing roles. Usually, bootstrap stack is CDKToolkit. You can go to cloudformation, search for it and delete the stack. cdk bootstrap to recreate it. It'll generate the required roles or any resources needed for cdk to work properly.

gloomy ivyBOT
#

✅ - Accidentally deleted cdk IAM roles. Any way to recreate it? All GEN2 deployments are failing.