Create a Bucket with Object Lock
Last updated
Was this helpful?
Was this helpful?
aws configure
AWS Access Key ID [None]: ENTER_YOUR_ACCESS_KEY
AWS Secret Access Key [None]: ENTER_YOUR_SECRET_KEY
Default region name [None]: eu-central-1
Default output format [None]: jsonpowershell
Set-AWSCredential -AccessKey YOUR_ACCESS_KEY -SecretKey YOUR_SECRET_KEY -StoreAs IONOS-S3aws s3api create-bucket --bucket YOUR_BUCKET_NAME --object-lock-enabled-for-bucket --endpoint-url https://s3-eu-central-1.ionoscloud.com --create-bucket-configuration LocationConstraint=eu-central-1powershell
New-S3Bucket -BucketName YOUR_BUCKET_NAME -ObjectLockEnabledForBucket $true -EndpointUrl "https://s3-eu-central-1.ionoscloud.com" -ProfileName IONOS-S3aws s3api put-object-lock-configuration --bucket YOUR_BUCKET_NAME --object-lock-configuration '{"ObjectLockEnabled": "Enabled", "Rule": {"DefaultRetention": {"Mode": "COMPLIANCE", "Days": 50}}}'powershell
Write-S3ObjectLockConfiguration -BucketName YOUR_BUCKET_NAME -ObjectLockConfiguration_ObjectLockEnabled Enabled -DefaultRetention_Mode COMPLIANCE -DefaultRetention_Days 50 -EndpointUrl "https://s3-eu-central-1.ionoscloud.com" -ProfileName IONOS-S3