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

Creating or upserting a record with route53 sdk fails #924

Closed
schell opened this issue Oct 21, 2023 · 2 comments
Closed

Creating or upserting a record with route53 sdk fails #924

schell opened this issue Oct 21, 2023 · 2 comments
Labels
bug This issue is a bug.

Comments

@schell
Copy link

schell commented Oct 21, 2023

Describe the bug

When using aws_sdk_route53 to create a CNAME record for certificate domain validation I get an error back from AWS:

0: InvalidInput: Invalid request: Expected exactly one of [AliasTarget, all of [TTL, and ResourceRecords], or TrafficPolicyInstanceId], but found none in Change with [Action=CREATE, Name=_06a2ec5151158a9b7b35847a898501a4.*redacted*.com., Type=CNAME, SetIdentifier=null]

The code I'm using to make the creation request is this:

       let client = aws_sdk_route53::Client::new(cfg);
       let out = client
           .change_resource_record_sets()
           .hosted_zone_id(record.hosted_zone_id.as_str())
           .change_batch(
               ChangeBatch::builder()
                   .changes(
                       Change::builder()
                           .action(ChangeAction::Create)
                           .resource_record_set(
                               ResourceRecordSet::builder()
                                   .name(record.record_name.as_str())
                                   .r#type(record.type_is.as_str().into())
                                   .set_ttl(record.ttl.as_ref().clone()) // value is "Some(60)"
                                   .build(),
                           )
                           .build(),
                   )
                   .build(),
           )
           .send()
           .await?;

After a little digging it seems this can happen if the generated json has a ttl name or value of something like Ttl instead of TTL, which is why I'm making this ticket. I can't seem to find where the serialization happens, and don't seem to get anything useful from tracing (that I can pick out of the noise). It may be I'm not making the right request, or it may be that whatever JSON this request turns into is incorrect.

Expected Behavior

I expected the call to succeed :)

Current Behavior

The request is erring.

Reproduction Steps

Given above.

Possible Solution

Check the request serialization?

Additional Information/Context

No response

Version

0.33.1

Environment details (OS name and version, etc.)

macos

Logs

No response

@schell schell added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 21, 2023
@schell
Copy link
Author

schell commented Oct 22, 2023

Silly me, I wasn't setting the value of the resource record with .resource_record_set(...). 🤦

@schell schell closed this as completed Oct 22, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@Velfi Velfi removed the needs-triage This issue or PR still needs to be triaged. label Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants