Malformed XML when setting bucket lifecycle with Go SDK
0
I have been trying to use the Go SDK to put a lifecycle configuration for a bucket but I keep getting Malformed XML errors. This is the relevant section of the code:
rule := types.LifecycleRule{
Status: types.ExpirationStatusDisabled,
ID: aws.String("testid2"),
NoncurrentVersionExpiration: &types.NoncurrentVersionExpiration{
NewerNoncurrentVersions: 4,
NoncurrentDays: 1,
},
Filter: filter,
}
bucketConfig := types.BucketLifecycleConfiguration{
Rules: []types.LifecycleRule{rule},
}
putBucketConfigInput := &s3.PutBucketLifecycleConfigurationInput{
Bucket: aws.String("beer-sample-default-default-test5"),
LifecycleConfiguration: &bucketConfig,
}
bucketLifecycleOutput, err := client.PutBucketLifecycleConfiguration(aws.BackgroundContext(),
putBucketConfigInput, func(*s3.Options) {})
Would love to get some idea on where I'm going wrong. Thanks!
Topics
asked a month ago5 views
1 Answers
0
Hello,
We need some more details on this use case. Therefore, could you please provide the following information:
1) SDK Version being used. 2) Complete Error message 3) If there are any further code level debug logs, that would help us too.
Further, you can also raise an issue directly at the Go SDK github community: https://github.com/aws/aws-sdk-go/issues
Looking forward for your response.
Thank you.
Relevant questions
S3 Bucket Delete Marker Policy Not Working
asked 2 months agos3 Glacier Transition
asked 3 months agoS3 Bucket Object Versioning & Lifecycle Rules - Applied to Existing Objects or only New?
Accepted Answerasked 5 years agoMalformed XML when setting bucket lifecycle with Go SDK
asked a month ago"Bucket name already exists", but it is not listed on the S3 Mgmt Console
asked 4 years agoAccess denied when trying to GET objects uploaded to s3 bucket via aws sdk using cloudfront
asked 6 months agoPHP SDK and listObjectsV2
asked 3 months agoUsing JavaScript and AWS SDK to access S3 Bucket without Credentials
asked 2 years agoNew to AWS, my lifecycle rule seems to not be applied (Versioned bucket)
asked a year agoAWS S3 Replication With Lifecycle Policy - Cross Account
asked 2 years ago
Hi Did you try this ?
NoncurrentDays: aws.Int64(int64(1))
Just to be sure .. and in 2 times : first step the NoncurrentDays then the NewerNoncurrentVersions
++