-
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
r/aws_dax_cluster: Support encryption at rest #5508
Conversation
iam_role_arn = "${aws_iam_role.test.arn}" | ||
node_type = "dax.r3.large" | ||
node_type = "dax.t2.small" |
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.
Node type changed as encryption at rest is not supported for dax.r3.* node types:
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.
👍
@@ -158,34 +158,3 @@ func resourceAwsDaxParameterGroupDelete(d *schema.ResourceData, meta interface{} | |||
|
|||
return nil | |||
} | |||
|
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.
Moved these 2 functions to structure.go
.
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.
Nice work, @ewbankkit! 🚀 I made some nitpicky cleanup in a commit after yours (we generally recommend against using CustomizeDiff
unless really necessary).
--- PASS: TestAccAWSDAXCluster_encryption_disabled (597.08s)
--- PASS: TestAccAWSDAXCluster_importBasic (605.43s)
--- PASS: TestAccAWSDAXCluster_encryption_enabled (679.29s)
--- PASS: TestAccAWSDAXCluster_basic (736.60s)
--- PASS: TestAccAWSDAXCluster_resize (1289.44s)
@@ -137,6 +151,28 @@ func TestAccAWSDAXCluster_resize(t *testing.T) { | |||
testAccCheckAWSDAXClusterExists("aws_dax_cluster.test", &dc), | |||
resource.TestCheckResourceAttr( | |||
"aws_dax_cluster.test", "replication_factor", "1"), | |||
resource.TestCheckResourceAttr( | |||
"aws_dax_cluster.test", "server_side_encryption.0.enabled", "true"), |
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 looks like this check was extraneously added 😉
--- FAIL: TestAccAWSDAXCluster_resize (1252.75s)
testing.go:527: Step 2 error: Check failed: Check 3/3 error: aws_dax_cluster.test: Attribute 'server_side_encryption.0.enabled' expected "true", got "false"
iam_role_arn = "${aws_iam_role.test.arn}" | ||
node_type = "dax.r3.large" | ||
node_type = "dax.t2.small" |
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.
👍
"server_side_encryption": { | ||
Type: schema.TypeList, | ||
Optional: true, | ||
Computed: true, |
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 was able to remove the following by changing the schema definition:
Computed: true
CustomizeDiff
isDaxClusterOptionDisabled
Check this out:
"server_side_encryption": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
if old == "1" && new == "0" {
return true
}
return false
},
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"enabled": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
},
},
},
At some point I need to make that DiffSuppressFunc
into its own function 😅 , its basically just there to ignore the container attribute being unset in the Terraform configuration (all child attribute differences still apply).
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 reused the logic from aws_dynamodb_table
so we may want to refactor there also.
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.
Especially as it looks like with AWS SDK v1.15.16 aws_dynamodb_table
SSE can be updated without recreating the table.
This has been released in version 1.33.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! |
Fixes #5500.
Acceptance tests: