0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【AWS】CDKでエラー「The parameter contains formatting that is not valid. field: IP_ADDRESS...」が出た場合

Posted at

概要

cdk deployを実行したら以下のエラーになりました。

❌ SampleStack failed: _ToolkitError: The stack named SampleStack failed to deploy: UPDATE_ROLLBACK_COMPLETE: Resource handler returned message: "Error reason: The parameter contains formatting that is not valid., field: IP_ADDRESS, parameter: 111.222.333.444 (Service: Wafv2, Status Code: 400, Request ID:xxxxxxx) (SDK Attempt Count: 1)" (RequestToken: xxxxxxx, HandlerErrorCode: InvalidRequest)

原因と解決方法

上記のエラーの原因は、WAFのIPセットにCIDR表記でないIPアドレスが含まれていたため、でした。
具体的には、111.222.333.444のようなIPアドレスです。

WAFv2のIPセット(wafv2.CfnIPSet)のaddressesパラメータには、必ずCIDR表記で指定する必要があります。

つまり、上記の例で言えば
111.222.333.444/32
という形でサブネットマスクをつけてあげればOKです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?