DEV Community

Discussion on: Update an AWS CloudFront custom SSL/TLS certificate using AWS CLI

Collapse
 
felipelalli profile image
Felipe Mica • Edited

Hi! I am getting this error:

"The If-Match version is missing or not valid for the resource"

EDIT: I found out!

It is missing these steps:

CERT_ETAG=$(aws cloudfront get-distribution-config --id $MY_CLOUDFRONT_ID --query ETag)
# remove quotes:
CERT_ETAG="${CERT_ETAG%\"}"
CERT_ETAG="${CERT_ETAG#\"}"
aws cloudfront update-distribution --if-match $CERT_ETAG --id $MY_CLOUDFRONT_ID --distribution-config file://config.json
Enter fullscreen mode Exit fullscreen mode