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

Support for using have_record_set for a cname record that point to multiple weighted targets #521

Open
danielgpm opened this issue Jul 27, 2020 · 1 comment

Comments

@danielgpm
Copy link

Hi,
I have a cname type R53 domain that is pointing to different target domain weighted values (see structure below)
How do I test this using the have_record_set function?
I'm trying the following:

describe route53_hosted_zone('my_aws_public_zone.'),  do
  it { should exist }
  its(:resource_record_set_count) { should > 2 }
  it { should have_record_set('myapp-domain.com.').type('cname')}
  it { should have_record_set('myapp-domain.com.').cname('myapp-r53-east.com').ttl(300)}
end

but receiving an error:

`block (2 levels) in <top (required)>'

I'm guessing it is because the have_record_set with cname is returning more than 1 target. When I have only 1 target for that cname the above code works.

P.S:
Current R53 structure:

myapp-domain.com
 +-- weighted-target-app-east (weight:50)
 |   +-- myapp-r53-east.com
 |       +-- Simple (evaluate_health: True) 
 |           +-- myapp-east.elb.amazonaws.com
 |               +-- IPs
 +-- weighted-target-app-west (weight:50)
 |   +-- myapp-r53-west.com
 |       +-- Simple (evaluate_health: True) 
 |           +-- myapp-west.elb.amazonaws.com
 |               +-- IPs
@glasswalk3r
Copy link
Contributor

@danielgpm , can you please provide the (JSON or even using the SDK client with pry) response for such request based on this resource of yours?

The current available stub (lib/awspec/stub/route53_hosted_zone.rb) includes only this CNAME:

        {
          name: '\052.example.com.',
          type: 'CNAME',
          ttl: 3600,
          resource_records: [
            {
              value: 'example.com'
            }
          ]
        },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants