amazon web services - AWS CLI for CloudFront create-invalidation returns old invalidation -


i'm trying use aws cli create invalidations on cloudfront in ci service automatically invalidate files on deployment. however, cli returns success message, invalidation referenced month old , no new invalidation created.

i'm installing , enabling cloudfront:

pip install awscli aws configure set preview.cloudfront true aws configure set preview.create-invalidation true 

then create invalidation:

aws cloudfront create-invalidation --cli-input-json '{"distributionid":"abc123abc123","invalidationbatch":{"paths":{"quantity":1,"items":["/index.html"]},"callerreference":"codeship"}}' 

an example of response, when ran command on 7/13 @ 4pm et:

{   "invalidation": {     "status": "completed",     "invalidationbatch": {       "paths": {         "items": [           "/index.html"         ],         "quantity": 1       },       "callerreference": "codeship"     },     "id": "1234567890",     "createtime": "2015-06-12t18:39:56.360z"   },   "location": "https://cloudfront.amazonaws.com/2015-04-17/distribution/abc123abc123/invalidation/1234567890" } 

when logged cloudfront can see 1 invalidation 6/12, nothing yesterday when ran command.

am doing wrong? cli api work?

looks you're passing same callerreference every call createinvalidation? callerreference uniquely identifies particular invalidation request, cloudfront gives result of first invalidation use callerreference. documentation:

a value specify uniquely identify invalidation request. cloudfront uses value prevent accidentally resubmitting identical request. whenever create new invalidation request, must specify new value callerreference , change other values in request applicable. 1 way ensure value of callerreference unique use timestamp, example, 20120301090000.

if make second invalidation request same value callerreference, , if rest of request same, cloudfront doesn't create new invalidation request. instead, cloudfront returns information invalidation request created same callerreference.

if callerreference value sent in previous invalidation batch request content of path different original request, cloudfront returns invalidationbatchalreadyexists error.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -