Comments (6)
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.
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.
@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.
@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.
I tried using
put-bucket-lifecycle-configuration
and I get no error, however it does not apply the configuration provided. When I useget-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.
@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)
- AWS CLI fails to find a newly created db parameter group HOT 3
- ImportError: cannot import name 'is_s3express_bucket' from 'botocore.utils' when lambda update-function-code HOT 4
- dynamodb update-table missing delete-protection-enabled option
- KMS Decrypt with valid key and cipher-text returns error HOT 2
- Cross platform deploy on aws cloudformation package breaks path seperators
- s3api create-bucket does not work for express one zone directory buckets HOT 2
- (AccessDenied) when calling the ListBuckets operation: Access Denied HOT 1
- EC2::Client#describe_security_groups undocumented & unchecked options limitation. HOT 3
- aws sso login failed on WSL2
- Neither Cryptography 38.0.4 or Cryptography 40.0.1 works HOT 1
- S3Api get-bucket-location returns "EU" for buckets created in eu-west-1 (Ireland) HOT 2
- Have a command to generate a Redis Auth token just like RDS
- Add creds to .netrc for codeartifact pip login. HOT 2
- [AWS][EC2] create-volume tagging request is made in a second time causing rejection from tagging policies
- list-state-machines does not return all records HOT 2
- aws lambda invoke retries while lambda execution has not failed HOT 1
- Warnings when using Python 3.12 HOT 3
- Unable to generate long-living pre-signed URL HOT 7
- role parameter in eks update-kubeconfig is not being used for aws cli connection HOT 4
- `aws codeartifact login --tool npm` fails with "This command does not support workspaces." HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-cli.