-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does it support multiple s3 buckets? #27
Comments
Hello, it depends what do you want to achieve. Why do you need multiple S3 buckets? |
That would be useful, in our case we have several buckets for each one of our websites. The need for a bucket-per-site its because in our bussiness every site corresponds to different areas, and every area has its own cost-center and pay the bills with different budgets (maybe not the best solution, but that implementation was made by our TI team who manage AWS accounts time ago). |
If every site has a different ownership/ content / domain name, then it makes sense to deploy the solution separately for each website. Note that I haven't tested multiple deployments in the same AWS Account, it might require some code change to make it work. |
@alecsvaldez What all would we need to change? Both buckets have public access blocked so I added permissions allowing the cloudfront distribution to access the s3 bucket objects and the optimisation works fine for the first bucket. But after deploying the new stack it's not able to access the images from 2nd the s3 bucket, on checking cloudwatch logs it throwing access denied error. Error for reference -
|
You can go to /bin/image-optimization.ts file and add new stack #!/usr/bin/env node
import "source-map-support/register";
import * as cdk from "aws-cdk-lib";
import { ImageOptimizationStack } from "../lib/image-optimization-stack";
const app = new cdk.App();
// Production stack
new ImageOptimizationStack(app, "ImgTransformationStackProd", {});
// Dev stack
new ImageOptimizationStack(app, "ImgTransformationStackDev", {}); now you can deploy the stack you want
|
I have multiple s3 buckets,
When I run cdk bootstrap, a cdk s3 bucket is generated. After that, I can cdk deploy -c bucket_name .., but it is only configured for a single bucket at this time. If I want to configure multiple buckets, can I run it multiple times? npx deploy -c
The text was updated successfully, but these errors were encountered: