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

RDS: aws_db_instance not assigning custom parameter_group_name #31719

Closed
hitesh-dev19 opened this issue Jun 1, 2023 · 16 comments · Fixed by #36080
Closed

RDS: aws_db_instance not assigning custom parameter_group_name #31719

hitesh-dev19 opened this issue Jun 1, 2023 · 16 comments · Fixed by #36080
Labels
bug Addresses a defect in current functionality. service/rds Issues and PRs that pertain to the rds service.
Milestone

Comments

@hitesh-dev19
Copy link

hitesh-dev19 commented Jun 1, 2023

Terraform Core Version

Terraform v1.4.0 on darwin_arm64

AWS Provider Version

4.67.0

Affected Resource(s)

aws_db_instance

Expected Behavior

Trying to create Cross Region Replica for Oracle RDS Instance

Actual Behavior

I am trying to create the cross region replica for Oracle RDS Instance providing custom parameter_group_name, but still it is getting assigned to default parameter group, eventually it is failing with the error , Error: waiting for RDS DB Instance (******) create: unexpected state 'incompatible-parameters', wanted target 'available, storage-optimization'. , and when I try to reapply terraform changes, it is showing that the changes for parameter group with the custom one, then it is deleting that instance and creating new instance again with the same default parameter group.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_db_instance" "test-replica" {
   identifier             = "mytestinstance"
   replicate_source_db    = "arn:aws:rds:us-east-1:****"
   instance_class         = "db.m5.xlarge"
   apply_immediately      = true
   publicly_accessible    = false
   skip_final_snapshot    = true
   vpc_security_group_ids = [data.aws_security_group.static.id]
   parameter_group_name   = "custom-parameter-group"
   storage_encrypted = true
   iam_database_authentication_enabled = true
   iops = 1000
   tags = {
    Application = "test -replica"
   }
}

Steps to Reproduce

terraform plan

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@hitesh-dev19 hitesh-dev19 added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Jun 1, 2023
@github-actions
Copy link

github-actions bot commented Jun 1, 2023

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/rds Issues and PRs that pertain to the rds service. label Jun 1, 2023
@justinretzolk
Copy link
Member

Hey @hitesh-dev19 👋 Thank you for taking the time to raise this! I did a bit of looking around, and I believe this may be a configuration issue rather than a bug within the provider. I'll link the most relevant documents that I found below.

@justinretzolk justinretzolk added waiting-response Maintainers are waiting on response from community or contributor. and removed bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Jun 2, 2023
@hitesh-dev19
Copy link
Author

Hi justinretzolk,
Thanks for the reply, my point is though I am giving the custom parameter group the new replica is still getting attached to default parameter group.

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Jun 2, 2023
@justinretzolk
Copy link
Member

Hey @hitesh-dev19 -- I see where you're coming from now. So that we have the relevant information in order to be able to look into this, can you supply debug logs (redacted as needed) as well?

@justinretzolk justinretzolk added the waiting-response Maintainers are waiting on response from community or contributor. label Jun 2, 2023
@hitesh-dev19
Copy link
Author

hitesh-dev19 commented Jun 2, 2023

Hey @justinretzolk , I can refer my issue, which is very similar to #218 but there a subsequent terraform apply changes parameter_group_name to the correct value and do an RDS reboot to get their changes.
But for me subsequent terraform plan this diff is evident with the correct parameter group, but when I apply it, it is destroying the replica which was created before and recreating new one with the same default parameter group and not applying custom parameter group.

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Jun 2, 2023
@hitesh-dev19
Copy link
Author

Hey @justinretzolk ,
I have noticed one more thing that the resource is getting tainted that is the reason it is getting destroyed and recreate all the time with the same default parameter group.
So I have untainted the resource and reapply the same so then the parameter_group_name got updated but it required manual reboot to get that applied.

So now its happening in the same way like #218 , but that issue has been resolved in the past but that doesn't look that way.

Can you please confirm this. thanks.

@hitesh-dev19
Copy link
Author

hitesh-dev19 commented Jun 9, 2023

Hello @justinretzolk ,

I have noticed that with the latest terraform aws provider version update v5.0.0, the oracle replica resource is still failing with the same error Error: waiting for RDS DB Instance (******) create: unexpected state 'incompatible-parameters', wanted target 'available, storage-optimization'. But with this latest update the created resource is not there in the terraform state .
In earlier versions the resource is in taint state at-least which helped to create resource by rebooting manually . This time it is not the case. I need to import the resource again to match the state.
Could you please help me with my case or let me know If I am missing anything.
Thanks.

@hitesh-dev19
Copy link
Author

Any help appreciated !

@skeesara02
Copy link

skeesara02 commented Oct 13, 2023

We are also having the same issue with RDS oracle, unable to pass custom parameter group, though we are passing, its taking default parameter group and then the status is going to **incompatible-parameters** as we have updated a parameter in custom parameter group - max_string_size from STANDARD to EXTENDED. But this feature is working from from AWS CLI

@koolbaar
Copy link

koolbaar commented Nov 16, 2023

Is there any update on this bug. This still seems to be happening. Creating a cross region read replica for RDS-Oracle does not respect the Custom parameter group that we pass. If we try to modify the read replica, to fix the same, it tries to delete and re-create. In-region Read-Replica does not have any issues.

@kutttinoti
Copy link

Facing same problem. Curious to know if this is even acknowledged as a bug from hashicorp.

Interestingly, while the tfl state shows as tainted and we can see that it is associating the default parameter group in AWS console, Tfl state output shows the custom parameter group name. So, custom parameter group is not completely ignored.

Also, aws cli command create-db-instance-read-replica succeeds with exact same parameter group. Hoping to get a resolution sooner on this.

@hitesh-dev19
Copy link
Author

@justinretzolk can you please look at this bug, its still unresolved.

@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Dec 11, 2023
@gdavison
Copy link
Contributor

Hi @hitesh-dev19, can you please share more of your Terraform configuration? Specifically, where you create the parameter group. It would also be helpful to see the configuration that creates the source database and its parameter group.

@gdavison gdavison added the waiting-response Maintainers are waiting on response from community or contributor. label Dec 15, 2023
@rampalanofficial
Copy link

Hi @gdavison

Attaching two tar files that can be used for reproducing this problem, where parameter group that is passed to aws_db_instance is not used when creating the readreplica instance, especially when extended parameters are used (eg: max_string_size)

hashi-module-rds-oracle.tar.gz => This will create rds-oracle terraform module that can be used to create a RDS Oracle db instance with parameter/option groups.
call_rds_oracle.tar.gz => This will use rds-oracle terraform module twice, one for creating the primary instance and another for creating read replica instance.

hashi-module-rds-oracle.tar.gz

call_rds_oracle.tar.gz

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Feb 20, 2024
@github-actions github-actions bot added this to the v5.40.0 milestone Mar 5, 2024
Copy link

github-actions bot commented Mar 7, 2024

This functionality has been released in v5.40.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

github-actions bot commented Apr 7, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/rds Issues and PRs that pertain to the rds service.
Projects
None yet
8 participants