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

azurerm_dns_cname_record - split create and update function to fix lifecycle - ignore #26610

Merged
merged 3 commits into from
Jul 22, 2024

Conversation

mbfrahry
Copy link
Member

No description provided.

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mbfrahry. Overall looks fine, but I think changing the schema from ConflictsWith to ExactlyOneOf could be breaking change?

ConflictsWith: []string{"target_resource_id"},
Type: pluginsdk.TypeString,
Optional: true,
ExactlyOneOf: []string{"record", "target_resource_id"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be a breaking change?

Comment on lines 242 to 249
payload.Properties.CNAMERecord.Cname = utils.String(record)
}
}

if d.HasChange("target_resource_id") {
payload.Properties.TargetResource = &recordsets.SubResource{}
if targetId := d.Get("target_resource_id").(string); targetId != "" {
payload.Properties.TargetResource.Id = utils.String(targetId)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
payload.Properties.CNAMERecord.Cname = utils.String(record)
}
}
if d.HasChange("target_resource_id") {
payload.Properties.TargetResource = &recordsets.SubResource{}
if targetId := d.Get("target_resource_id").(string); targetId != "" {
payload.Properties.TargetResource.Id = utils.String(targetId)
payload.Properties.CNAMERecord.Cname = pointer.To(record)
}
}
if d.HasChange("target_resource_id") {
payload.Properties.TargetResource = &recordsets.SubResource{}
if targetId := d.Get("target_resource_id").(string); targetId != "" {
payload.Properties.TargetResource.Id = pointer.To(targetId)

@mbfrahry
Copy link
Member Author

Hey @stephybun, it shouldn't be a breaking change because we currently error out if at least one of them isn't specified. I removed that code and added ExactlyOneOf because it's the same thing but better

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, thanks @mbfrahry LGTM 👍

@mbfrahry mbfrahry merged commit 311644a into main Jul 22, 2024
31 checks passed
@mbfrahry mbfrahry deleted the s-dns-cname-cu branch July 22, 2024 19:42
@mbfrahry mbfrahry added this to the v3.114.0 milestone Jul 22, 2024
mbfrahry added a commit that referenced this pull request Jul 22, 2024
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants