aws-cdk
aws-cdk copied to clipboard
aws_ec2.Instance: Generates dependency on role even after removal
Describe the bug
I'm trying to prevent the Instance class from generating a new role because the environment I'm deploying to prevents me from creating the cloudformation service-role which can create IAM roles/instance profiles. I'm able to remove the instance profile and role ( which is very hacky, and honestly I'm not sure why it is generated by default, and why there is no way to just say don't remove it ), but even after doing so, the instance class still generates the dependency, This causes a dependency error when the changeset is deployed.
Expected Behavior
I expect there to be no dependency generated when I remove the instance profile and role. And I know I can sort of prevent this behavior with customize_roles, but that still demands a role.
Current Behavior
Generates a "depends-on" entry in the instance resource in the cloudformation template.
Reproduction Steps
My code for testing this is here: rke2-testing
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.147.0 (build 3338fc0)
Framework Version
No response
Node.js Version
v20.10.0
OS
Fedora 30
Language
Python
Language Version
3.12.3
Other information
No response