Skip to content

Route53 plugin broken when used with AWS Tools for PowerShell version 5 #627

@adamf83

Description

@adamf83

I am attempting to debug an issue when it comes to requesting certificates using the Route53 plugin. When running:

Publish-Challenge "*.domain.net" -Account $acct -Token faketoken -Plugin Route53 -PluginArgs $cArgs -Verbose -DnsAlias "_acme-challenge.domain.net"

I am getting the following exception thrown:

You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\Posh-ACME\4.29.0\Plugins\Route53.ps1:51 char:13
+             $rrSet.ResourceRecords.Add(@{Value="`"$TxtValue`""})
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

This then goes on to throw the following exception, presumably because $TxtValue is null:

Edit-R53ResourceRecordSet : Invalid request: Expected exactly one of [AliasTarget, all of [TTL, and ResourceRecords], or TrafficPolicyInstanceId], but found none in Change with [Action=UPSERT,
Name=_acme-challenge.CEX1.cexlabs.net, Type=TXT, SetIdentifier=null]
At C:\Program Files\WindowsPowerShell\Modules\Posh-ACME\4.29.0\Plugins\Route53.ps1:59 char:17
+ ...     $null = Edit-R53ResourceRecordSet -HostedZoneId $zoneID -ChangeBa ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Amazon.PowerShe...RecordSetCmdlet:EditR53ResourceRecordSetCmdlet) [Edit-R53ResourceRecordSet], InvalidOperationException
    + FullyQualifiedErrorId : Amazon.Route53.Model.InvalidInputException,Amazon.PowerShell.Cmdlets.R53.EditR53ResourceRecordSetCmdlet

I've noticed that if I create an existing record with the name _acme-challenge.domain.net and add a arbitrary value, the value of the variable $TXTValue is appended to that record and the challenge then succeeds.

The PluginArgs variable in my case ($cArgs) is credentials set by running the Set-AWSCredential cmdlet because I am assuming a role.

Any help or advice anyone can offer would be great.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions