Skip to content
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

(aws_rds): DatabaseCluster s3ExportBuckets fails with Aurora MySQL 3 #19735

Closed
vkemthur-luna opened this issue Apr 2, 2022 · 4 comments · Fixed by #19775
Closed

(aws_rds): DatabaseCluster s3ExportBuckets fails with Aurora MySQL 3 #19735

vkemthur-luna opened this issue Apr 2, 2022 · 4 comments · Fixed by #19775
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database bug This issue is a bug. effort/small Small work item – less than a day of effort in-progress This issue is being actively worked on. p1

Comments

@vkemthur-luna
Copy link

vkemthur-luna commented Apr 2, 2022

Describe the bug

Trying to Setup MySQL8 Aurora via CDK

this.importBucket = new s3.Bucket(this, this.stackConfig.PaymentsS3ImportBucket);
this.exportBucket = new s3.Bucket(this, this.stackConfig.PaymentsS3ExportBucket);

const paymentsAuroraCluster = new rds.DatabaseCluster(this, this.stackConfig.PaymentsDatabaseId, {
    engine: rds.DatabaseClusterEngine.auroraMysql({version: rds.AuroraMysqlEngineVersion.VER_3_01_0}),
    credentials: rds.Credentials.fromGeneratedSecret('someadmin'),
    iamAuthentication: true,
    instanceProps: {
        instanceType: ec2.InstanceType.of(ec2.InstanceClass.R5, ec2.InstanceSize.LARGE),
        vpcSubnets: {
            subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
        },
        vpc: somevpc
    },
    defaultDatabaseName: this.stackConfig.DefaultDatabase,
    s3ImportBuckets: [this.importBucket],
    s3ExportBuckets: [this.exportBucket]
});

CDK synth template has this

"Type": "AWS::RDS::DBClusterParameterGroup",
      "Properties": {
        "Description": "Cluster parameter group for aurora-mysql8.0",
        "Family": "aurora-mysql8.0",
        "Parameters": {
   "aws_default_s3_role": {
     "Fn::GetAtt": [
       "foomysql8S3ImportRoleA2225BF9",
       "Arn"
     ]
   },
   "aurora_select_into_s3_role": {
     "Fn::GetAtt": [
       "foomysql8S3ExportRoleE8D8EE1E",
       "Arn"
     ]
   }
 }

aurora_select_into_s3_role is not a valid parameter for MySQL8 and deploy fails

10:44:22 AM | UPDATE_FAILED        | AWS::RDS::DBClusterParameterGroup           | fooauroramysq...meterGroup73951D0D
Invalid / Unsupported DB Parameter: aurora_select_into_s3_role

See a similar issue reported here #19126, but probably this only resolved import and needs a similar fix for export

Or is there a workaround?

Expected Behavior

aws_default_s3_role for MySQL8 supports export as well and should be the parameter when s3BucketExport is requested.

Current Behavior

10:44:22 AM | UPDATE_FAILED        | AWS::RDS::DBClusterParameterGroup           | fooauroramysq...meterGroup73951D0D
Invalid / Unsupported DB Parameter: aurora_select_into_s3_role

Reproduction Steps

Included in description

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.19.0 (build e0d3e62)

Framework Version

No response

Node.js Version

v17.7.2

OS

Mac

Language

Typescript

Language Version

4.6.2

Other information

No response

@vkemthur-luna vkemthur-luna added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 2, 2022
@github-actions github-actions bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Apr 2, 2022
@skinny85
Copy link
Contributor

skinny85 commented Apr 4, 2022

Hey @vkemthur-luna,

thanks for opening the issue. I have one follow-up question though.

Right now, for versions of MySQL below 8.0, the parameter names for import/export are different (aurora_load_from_s3_role and aurora_select_into_s3_role, respectively).

However, it seems like you're implying that, for MySQL 8.0, the parameter needs to be the same for both import and export (aws_default_s3_role). Because a given Parameter Group can only have a single value for a given Parameter, it seems to me like the import and export Roles have to be identical for MySQL 8.0.

Can you confirm that is the case? Because right now, for all Clusters, the Roles we generate for import and export are different (code here, you can see the combineRoles parameter is passed as false).

Thanks,
Adam

@skinny85 skinny85 added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Apr 4, 2022
@vkemthur-luna
Copy link
Author

vkemthur-luna commented Apr 5, 2022

https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Reference.html#AuroraMySQL.Reference.Parameters.Cluster

image

Only aws_default_s3_role (Cluster parameter) is available for MySQL 8

Used when invoking the **LOAD DATA FROM S3, LOAD XML FROM S3,** or **SELECT INTO OUTFILE S3** statement from your DB cluster

So probably need to combine role for engine 8.0 and need to set parameter once

As of now this path is adding a parameter not supported on 8.0

As a workaround, looks like I can create a custom role with s3 read/write policy and then set this in s3ImportRole prop.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Apr 5, 2022
skinny85 added a commit to skinny85/aws-cdk that referenced this issue Apr 6, 2022
In the newest version of the MySQL 8.0 Aurora engine,
the S3 import and export Roles need to be combined,
which is the first time this is needed for a Cluster
(previously, only Instances combined those two Roles).
Introduce this concept as a first-class property of Cluster engine,
`false` by default, and make it `true` in MySQL version 8.0.

Fixes aws#19735
@skinny85 skinny85 added p1 effort/small Small work item – less than a day of effort in-progress This issue is being actively worked on. and removed needs-triage This issue or PR still needs to be triaged. labels Apr 6, 2022
@skinny85 skinny85 removed their assignment Apr 6, 2022
@skinny85
Copy link
Contributor

skinny85 commented Apr 6, 2022

Thanks for the explanation @vkemthur-luna! Prepared a fix here: #19775.

@mergify mergify bot closed this as completed in #19775 Apr 8, 2022
mergify bot pushed a commit that referenced this issue Apr 8, 2022
In the newest version of the MySQL 8.0 Aurora engine,
the S3 import and export Roles need to be combined,
which is the first time this is needed for a Cluster
(previously, only Instances combined these two Roles).
Introduce this concept as a first-class property of a Cluster Engine,
making it `false` by default, and make it `true` in MySQL version 8.0.

Fixes #19735

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
	* [x] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

github-actions bot commented Apr 8, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

otaviomacedo pushed a commit that referenced this issue Apr 11, 2022
In the newest version of the MySQL 8.0 Aurora engine,
the S3 import and export Roles need to be combined,
which is the first time this is needed for a Cluster
(previously, only Instances combined these two Roles).
Introduce this concept as a first-class property of a Cluster Engine,
making it `false` by default, and make it `true` in MySQL version 8.0.

Fixes #19735

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
	* [x] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
StevePotter pushed a commit to StevePotter/aws-cdk that referenced this issue Apr 27, 2022
In the newest version of the MySQL 8.0 Aurora engine,
the S3 import and export Roles need to be combined,
which is the first time this is needed for a Cluster
(previously, only Instances combined these two Roles).
Introduce this concept as a first-class property of a Cluster Engine,
making it `false` by default, and make it `true` in MySQL version 8.0.

Fixes aws#19735

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)?
	* [x] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database bug This issue is a bug. effort/small Small work item – less than a day of effort in-progress This issue is being actively worked on. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants