2017-02-21 3 views
0

tun dies (aws-sdk ruby ​​gem):Kann nicht Bucket Lifecycle-Konfiguration eingestellt

s3_client.put_bucket_lifecycle_configuration({ 
    bucket: bucket, 
    lifecycle_configuration: { 
    rules: [ 
     { 
     id: "clean-temporary", 
     status: "Disabled", # required, accepts Enabled, Disabled 
     prefix: "temporary", 
     filter: { 
      prefix: "temporary", 
     }, 
     expiration: { 
      days: 1, 
     }, 
     }, 
    ], 
    }, 
}) 

ich einen Fehler bekam: Aws::S3::Errors::BadRequest: [!]

Laut Release Notes, meine Version (11) unterstützen sie: S3-Bucket-Lebenszyklus-API wurde hinzugefügt. Beachten Sie, dass zur Zeit nur Objektablauf unterstützt wird.

Was mache ich falsch?

UPD: die s3cmd Versuchte, half nicht:

⇒ s3cmd -c s3cfg setlifecycle lifecycle_configuration.xml s3://my-new-bucket 
ERROR: S3 error: 405 (MethodNotAllowed) 
⇒ cat lifecycle_configuration.xml 
<?xml version="1.0" encoding="UTF-8"?> 
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Rule><ID>test</ID><Status>Enabled</Status><Expiration><Days>1</Days></Expiration><Prefix></Prefix></Rule></LifecycleConfiguration> 

Antwort

0

Gefunden eine Abhilfe:

s3cmd -c s3cfg setlifecycle lifecycle_configuration.xml s3://my-new-bucket --signature-v2 

wahrscheinlich aws-sdk Juwel ist mit dieser Funktion nicht kompatibel.

Verwandte Themen