Giter VIP home page Giter VIP logo

Comments (6)

RyanFitzSimmonsAK avatar RyanFitzSimmonsAK commented on June 16, 2024

Hi @shirady, thanks for reaching out. I'd recommend that you update to a more recent version of the CLI, and try that operation again. 2.8.7 is very, very out of date, and that's a likely reason for parameter validation errors like this one.

from aws-cli.

shirady avatar shirady commented on June 16, 2024

Hi @RyanFitzSimmonsAK,
I updated the version (aws-cli/2.15.10 Python/3.11.7 Darwin/23.0.0 source/arm64 prompt/off) and I still have this issue. I also tried to use the file created in the terminal by running:

cat > life-cycle-policy.json << EOF
{
    "Rules": [
        {
            "Expiration": {
                "Days": 1
            },
            "ID": "cleanbucket",
            "Filter": {
                "Prefix": ""
            },
            "Status": "Enabled"
        }
    ]
}
EOF

and then: aws s3api put-bucket-lifecycle --bucket <bucet-name> --lifecycle-configuration file://lcpolicy.json
And still have:

Parameter validation failed:
Missing required parameter in LifecycleConfiguration.Rules[0]: "Prefix"
Unknown parameter in LifecycleConfiguration.Rules[0]: "Filter", must be one of: Expiration, ID, Prefix, Status, Transition, NoncurrentVersionTransition, NoncurrentVersionExpiration, AbortIncompleteMultipartUpload

I also tried to add policy with the console, get it, and put it with AWS CLI, and still it throws the same error.

BTW, would you please update the example in your documentation put-bucket-lifecycle in AWS CLI, to your API (Prefix should be inside Filter, here).

from aws-cli.

bwerschler avatar bwerschler commented on June 16, 2024

@shirady I encountered the same issue. The "put-bucket-lifecycle" command has been depreciated, so while it's still available, it only accepts the older lifecycle policy format that doesn't include filter statements.

Try using the same syntax and JSON file, but replace "put-bucket-lifecycle" with "put-bucket-lifecycle-configuration", which will accept the filter statements and should pass validation.

from aws-cli.

elcunzio avatar elcunzio commented on June 16, 2024

@shirady I encountered the same issue. The "put-bucket-lifecycle" command has been depreciated, so while it's still available, it only accepts the older lifecycle policy format that doesn't include filter statements.

Try using the same syntax and JSON file, but replace "put-bucket-lifecycle" with "put-bucket-lifecycle-configuration", which will accept the filter statements and should pass validation.

I tried using put-bucket-lifecycle-configuration and I get no error, however it does not apply the configuration provided. When I use get-bucket-lifecycle-configuration subsequently I see that the configuration has not changed.

from aws-cli.

bwerschler avatar bwerschler commented on June 16, 2024

I tried using put-bucket-lifecycle-configuration and I get no error, however it does not apply the configuration provided. When I use get-bucket-lifecycle-configuration subsequently I see that the configuration has not changed.

It sounds like you may be encountering a different issue. Can you provide a sanitized copy of the JSON you're attempting to apply?

from aws-cli.

RyanFitzSimmonsAK avatar RyanFitzSimmonsAK commented on June 16, 2024

@shirady I encountered the same issue. The "put-bucket-lifecycle" command has been depreciated, so while it's still available, it only accepts the older lifecycle policy format that doesn't include filter statements.

Try using the same syntax and JSON file, but replace "put-bucket-lifecycle" with "put-bucket-lifecycle-configuration", which will accept the filter statements and should pass validation.

This is correct.

I tried using put-bucket-lifecycle-configuration and I get no error, however it does not apply the configuration provided. When I use get-bucket-lifecycle-configuration subsequently I see that the configuration has not changed.

I was not able to reproduce this behavior. I was able to successfully apply the lifecycle policy mentioned here in your earlier comment using put-bucket-lifecycle-configuration. Could you provide debug logs of that behavior? You can get debug logs by adding --debug to your input, and redacting any sensitive information. Thanks!

from aws-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.