amazon web services - WAFStaleDataException from Java SDK but the same token works with CLI -
my code first gets change token used
final awswafregional waf = awswafregionalclientbuilder.defaultclient(); final string changetoken = waf.getchangetoken(new getchangetokenrequest()).tostring();
it uses token update ipset
updateipsetrequest updateipsetrequest = new updateipsetrequest(); updateipsetrequest.setchangetoken(changetoken); waf.updateipset(updateipsetrequest);
the problem is, when run function returns
com.amazonaws.services.waf.model.wafstaledataexception: input token no longer current. (service: awswafregional; status code: 400; error code: wafstaledataexception;
after when use same token aws cli works code unable use threw wafstaledataexception. resolution this?
the problem in statement
final string changetoken = waf.getchangetoken(new getchangetokenrequest()).tostring();
use of tostring() results changetoken of form {changetoken: "xxxxxx"} "xxxxxx" required change token, should have used
final string changetoken = waf.getchangetoken(new getchangetokenrequest()).getchangetoken();
Comments
Post a Comment