-
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
resource/rds_cluster_instance: Support availability_zone #2812
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @atsushi-ishibashi
Do you mind adding an acceptance test which involves availability_zone
set to non-empty value? e.g. first AZ from the AZ data source?
If I use
|
@atsushi-ishibashi Thanks for the update. I understand it's difficult to reference the resource attribute, but the problem is that this test is now pinned to How do you feel about using the AZ data source? e.g. data "aws_availability_zones" "available" {}
resource "aws_rds_cluster" "default" {
...
availability_zones = ["${data.aws_availability_zones.available.names}"]
...
}
resource "aws_rds_cluster_instance" "cluster_instances" {
...
availability_zone = "${data.aws_availability_zones.available.names[0]}"
... |
Sure👍 The main purpose of this test is to confirm whether the specified az is set as availability_zone. |
Check: resource.ComposeTestCheckFunc( | ||
testAccCheckAWSClusterInstanceExists("aws_rds_cluster_instance.cluster_instances", &v), | ||
testAccCheckAWSDBClusterInstanceAttributes(&v), | ||
resource.TestCheckResourceAttr("aws_rds_cluster_instance.cluster_instances", "availability_zone", "us-west-2a"), | ||
//resource.TestCheckResourceAttr("aws_rds_cluster_instance.cluster_instances", "availability_zone", "us-west-2a"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok to check this more loosely, e.g.
resource.TestMatchResourceAttr("aws_rds_cluster_instance.cluster_instances", "availability_zone", regexp.MustCompile("^us-west-2[a-z]{1}$")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got it👍
@radeksimko Updated👍
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
This has been released in version 1.10.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
Closes #2642