-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(ec2): BastionHostLinux should use AmazonSSMManagedInstanceCore policy #30834
Comments
Hi, can you elaborate on the missing permissions? I explicitly did not use it because of the broad permissions regarding parameter store etc. But we can change that if it is deemed safe. |
@hoegertn The execution history shows |
Makes sense to me. Feel free to submit a PR for that if you like. Before that, I am afraid we'll need to manually attach that managed policy to the instance role like const bast = new ec2.BastionHostLinux(this, 'Bast', {
vpc,
});
bast.role.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonSSMManagedInstanceCore')); |
Please consider adding the missing statements instead of adding the ManagedPolicy. The ManagedPolicy might be a breaking change for users as some companies do not allow the use of managed policies as they ofter are to wide. |
Good point. Since we can work around by adding policies like @pahud shows, it is safe to keep the current state. Closing this issue. |
|
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Describe the feature
BastionHostLinux
currently has the following instance role.aws-cdk/packages/aws-cdk-lib/aws-ec2/lib/bastion-host.ts
Lines 192 to 199 in 5ef3be5
This has insufficient permissions to be managed by SSM. AmazonSSMManagedInstanceCore should be used instead. (Especially
ssm
permissions)Use Case
Manage instance by SSM.
Proposed Solution
Use AmazonSSMManagedInstanceCore policy instead of inline policy.
Other Information
According to my research, The code above first appeared in #3697
It seems like the instance role was not discussed then.
Acknowledgements
CDK version used
2.144.0
Environment details (OS name and version, etc.)
macOS
The text was updated successfully, but these errors were encountered: