-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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_db_cluster_snapshot: Provider produced inconsistent result after apply #15096
Comments
Hi @vinced86 👋 Thank you for reporting this issue and sorry that you ran into trouble here. We have seen problems with RDS in the past where the API may allow uppercase during creation without returning an error, but it is changed into lowercase behind the scenes, which generates this type of error in the Terraform AWS Provider resource. Looking at the RDS API Reference, it in fact does indicate this might be a problem and I was able to reproduce this by adjusting the Does it work if you specify the resource "aws_db_cluster_snapshot" "test" {
db_cluster_identifier = "<arn of ressource>"
db_cluster_snapshot_identifier = "test"
} To prevent this problem in the resource going forward and return an error during "db_cluster_snapshot_identifier": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.All(
validation.StringLenBetween(1, 63),
validation.StringMatch(regexp.MustCompile(`^[0-9a-z-]+$`), "must contain only lowercase alphanumeric characters and hyphens"),
validation.StringMatch(regexp.MustCompile(`^[a-z]`), "must begin with a lowercase letter"),
validation.StringDoesNotMatch(regexp.MustCompile(`--`), "cannot contain two consecutive hyphens"),
validation.StringDoesNotMatch(regexp.MustCompile(`-$`), "cannot end with a hyphen"),
),
}, If you or anyone is interested in adding this, the source code is in the |
Thank you @bflad for the opportunity to learn |
Additional validation for the |
Thanks a lot for your helps! |
This has been released in version 3.7.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 for triage. Thanks! |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform AWS Provider Version
2.67 and 3.x
Affected Resource(s)
aws_db_cluster_snapshot
Terraform Configuration Files
Debug Output
Expected Behavior
Snapshot created without error messages like this:
Error: Provider produced inconsistent result after apply
When applying changes to aws_db_cluster_snapshot.externalbankuser_snapshot,
provider "registry.terraform.io/-/aws" produced an unexpected new value for
was present, but now absent.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
Actual Behavior
I have this error message when i want to create aws_db_cluster_snapshot:
Error: Provider produced inconsistent result after apply
When applying changes to aws_db_cluster_snapshot.externalbankuser_snapshot,
provider "registry.terraform.io/-/aws" produced an unexpected new value for
was present, but now absent.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
Steps to Reproduce
terraform apply
The text was updated successfully, but these errors were encountered: