Reputation: 61
I have a stack A that contains VPC. By duplicating code to the stack B I tried to import CDK import B . In the dialogue I put all needed ID of resources, at the end I got the error As part of the import operation, you cannot modify or add [RoleArn]
My goal is moving some resource between stacks because I'm reaching the limit of 500 resources per stack.
Update: I use cdk import
subcommand in the terminal
cdk import [STACK]
Import existing resource(s) into the given STACK
Upvotes: 0
Views: 3008
Reputation: 327
This is because the CloudFormation stack needs to be created first, before you can import into it.
Under the hood, CDK is trying to use CreateChangeSet:IMPORT, but there is no stack yet to change, which is where you get this odd attribute RoleArn
from, it's not part of the resources you could coalesce.
To fix, before importing, comment out all resources (ie constructs in CDK) in your stack. Then run cdk deploy
to create the initial empty stack that you can import into then.
Upvotes: 2