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

Add support for UPSERT type of actions #44

Open
luk4s opened this issue Dec 16, 2019 · 1 comment
Open

Add support for UPSERT type of actions #44

luk4s opened this issue Dec 16, 2019 · 1 comment

Comments

@luk4s
Copy link

luk4s commented Dec 16, 2019

Current implementation of update method is DELETE and CREATE (

def update(name,type,ttl,values,comment=nil, zone_apex = nil)
prev = self.clone
@name = name unless name.nil?
@type = type unless type.nil?
@ttl = ttl unless ttl.nil?
@values = values unless values.nil?
@zone_apex = zone_apex unless zone_apex.nil?
@zone.perform_actions([
{:action => "DELETE", :record => prev},
{:action => "CREATE", :record => self},
],comment)
end
).

I suggest to change it to action UPSERT, which AWS describe as update of record set (see https://docs.aws.amazon.com/Route53/latest/APIReference/API_ChangeResourceRecordSets.html)

This change optimize our workflow with DNS record sets.

Make this feature sense for you ? Do you prefer implement new method upsert instead of change current update ?

Thx

@pcorliss
Copy link
Owner

Hi @luk4s,

I think an UPSERT would work just fine in place of the DELETE and CREATE. At the time this was written UPSERT hadn't yet been added to the spec.

A word of caution however. This project still works however it is not actively maintained. As you can see the last commit was 2017, and the first commit was 9 years ago. While I'm happy to review your changes, run the test suite, and publish a new release you should exercise some caution when using the gem.

Phil C

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

No branches or pull requests

2 participants