-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
aws:cloudformationAWS CloudFormationAWS CloudFormationaws:s3Amazon Simple Storage ServiceAmazon Simple Storage Servicegood first issueGood item to work on for newcomersGood item to work on for newcomerstype: featureNew feature, or improvement to an existing featureNew feature, or improvement to an existing feature
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Deploying an S3 Bucket with cors config using CDK to LocalStack creates the bucket, but doesn't add the cors config to it.
Expected Behavior
Deploying an S3 Bucket with cors config using CDK to LocalStack should add the cors config to the created bucket.
How are you starting LocalStack?
With a docker-compose file
Steps To Reproduce
How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)
docker run localstack/localstack
Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)
- bootstrap LocalStack with CDK :
cdklocal bootstrap aws://000000000000/eu-west-3 - deploy an example stack to LocalStack containing an S3 bucket with cors, here's an example configuration I'm using:
this.bucket = new s3.Bucket(this, 'Bucket', {
bucketName: 'dev-storage-local',
removalPolicy: cdk.RemovalPolicy.RETAIN,
versioned: true,
objectOwnership: s3.ObjectOwnership.BUCKET_OWNER_ENFORCED,
cors: [
{
allowedOrigins: ['*'],
allowedHeaders: ['*'],
maxAge: 3000,
allowedMethods: [s3.HttpMethods.GET, s3.HttpMethods.HEAD, s3.HttpMethods.PUT, s3.HttpMethods.POST],
},
],
});- after deployment with
cdklocalverify that the bucket was correctly created :awslocal s3api list-buckets --region eu-west-3 - try getting the cors config for the bucket in local :
awslocal s3api get-bucket-cors --bucket dev-storage-local --region eu-west-3
=> the above command returns this error message that the CORS configuration doesn't exist:
An error occurred (NoSuchCORSConfiguration) when calling the GetBucketCors operation: The CORS configuration does not exist
Environment
- OS: macOS Ventura 13.1
- LocalStack: 1.4.0Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
aws:cloudformationAWS CloudFormationAWS CloudFormationaws:s3Amazon Simple Storage ServiceAmazon Simple Storage Servicegood first issueGood item to work on for newcomersGood item to work on for newcomerstype: featureNew feature, or improvement to an existing featureNew feature, or improvement to an existing feature