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

EN template update bug fix, support spf and dkim verification method for custom email destination #5945

Merged
merged 7 commits into from
Jan 28, 2025

Conversation

Divya-Singh1693
Copy link
Contributor

Tests Conducted:

Custom email destination creation:

Screenshot 2025-01-27 at 8 48 44 PM

Custom email destination Update for Verification Method:

Screenshot 2025-01-27 at 8 48 55 PM

Template update:

Screenshot 2025-01-27 at 8 49 04 PM

"verification_type": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "Verification Method spf/dkim.",
Copy link
Collaborator

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

Copy link
Contributor Author

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 {
Copy link
Collaborator

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

Copy link
Contributor Author

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 = ""
Copy link
Collaborator

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?

Copy link
Contributor Author

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))
Copy link
Collaborator

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")

@hkantare hkantare merged commit 8c11394 into IBM-Cloud:master Jan 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants