-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
rds: Failed to create a Database Instance with Kerberos authentication configured #28600
Comments
According to this We probably need to add Before we have a PR to improve that, you can work it around with escape hatches like const instance = new rds.DatabaseInstance(this, 'Database', {
engine: rds.DatabaseInstanceEngine.mysql({
version: rds.MysqlEngineVersion.VER_8_0_35,
}),
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.MEDIUM),
vpc,
domain: 'd-12345678',
});
const instanceRole = instance.node.tryFindChild('RDSDirectoryServiceRole') as iam.Role
(instanceRole.node.tryFindChild('Resource') as iam.CfnRole).addPropertyOverride('AssumeRolePolicyDocument.Statement.0.Principal.Service', [
'directoryservice.rds.amazonaws.com',
'rds.amazonaws.com',
]) And "DatabaseRDSDirectoryServiceRole55FFAFD0": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": [
"directoryservice.rds.amazonaws.com",
"rds.amazonaws.com"
]
}
}
],
"Version": "2012-10-17"
}, |
…cation configured (#28601) This PR resolves an issue where deploying an RDS instance configured with Kerberos authentication fails. When `domainRole` is undefined, CDK creates a default IAM role. However, this role lacks the necessary principals, leading to deployment failure. To resolve this, the necessary principals have been added to the role. ```diff - assumedBy: new iam.ServicePrincipal('rds.amazonaws.com'), + assumedBy: new iam.CompositePrincipal( + new iam.ServicePrincipal('rds.amazonaws.com'), + new iam.ServicePrincipal('directoryservice.rds.amazonaws.com'), + ), ``` Closes #28600. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
When setting up Kerberos authentication for an Instance, the arguments
domain
anddomainRole
can be provided. Here, ifdomainRole
is undefined, a default IAM role is created, but using that role results in the failure of the Instance creation.Expected Behavior
The instance is successfully deployed.
Current Behavior
The deployment of the Instance fails as follows.
Reproduction Steps
By deploying the following code, the error can be reproduced.
Possible Solution
Add
directoryservice.rds.amazonaws.com
as a principal in the assume role.Additional Information/Context
No response
CDK CLI Version
2.116.1
Framework Version
No response
Node.js Version
v20.10.0
OS
irreable
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: