-
Notifications
You must be signed in to change notification settings - Fork 676
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
EN template update bug fix, support spf and dkim verification method for custom email destination #5945
Conversation
…rfor event-notifications resources
…for custom email destination
"verification_type": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Description: "Verification Method spf/dkim.", |
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.
Can we add validation on supported methods
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.
Added validator for the same in latest commit
verifyCustomEmailDestinationConfiguration.SetID(parts[1]) | ||
hasChangeverification := false | ||
|
||
verifyCustomEmailDestinationConfiguration.SetType(d.Get("verification_type").(string)) | ||
|
||
if ok := d.HasChanges("name", "description", "collect_failed_events", "config"); ok { |
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.
only when we have some changes on these fields we use verification_type
?
During create we don't need this property
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.
Yes, it is only a update parameter, it's not needed at the time of creation
@@ -17,6 +17,7 @@ resource "ibm_en_destination_custom_email" "custom_domain_en_destination" { | |||
instance_guid = ibm_resource_instance.en_terraform_test_resource.guid | |||
name = "Custom Email EN Destination" | |||
type = "smtp_custom" | |||
verification_type = "" |
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.
why we want to empty verification_type?
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 will correct documentation, it's optional parameter.
@@ -231,6 +302,12 @@ func resourceIBMEnCustomEmailDestinationUpdate(context context.Context, d *schem | |||
|
|||
options.SetInstanceID(parts[0]) | |||
options.SetID(parts[1]) | |||
verifyCustomEmailDestinationConfiguration.SetType(d.Get("verification_type").(string)) |
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.
why we need to add this here if you are adding as part of if d.HasChange("verification_type")
Tests Conducted:
Custom email destination creation:
Custom email destination Update for Verification Method:
Template update: