Ross Coundon
03/08/2022, 9:18 PMcreatePortfolioDataBuckets(removalPolicy: RemovalPolicy, countries: string[]): EnvVarBucketMap {
const envVarBucketMap: EnvVarBucketMap = {};
for (const country of countries) {
const bucket = new sst.Bucket(this, `${this.stage}-${country}-portfolio-data`, {
s3Bucket: {
removalPolicy,
accessControl: BucketAccessControl.PRIVATE,
blockPublicAccess: BlockPublicAccess.BLOCK_ALL,
versioned: true,
bucketName: `${this.stage}-${country}-portfolio-data`,
},
});
bucket.s3Bucket.addCorsRule(corsBucketRule);
const envVarName = `${country.toUpperCase()}_PORTFOLIO_BUCKET`;
envVarBucketMap[envVarName] = bucket;
}
return envVarBucketMap;
}
This function is called only once in the stack, the value of the string array that’s passed in is ['germany', 'italy']
so the bucket names and IDs should be unique. Can anyone see what could be causing the issue?Ross Coundon
03/08/2022, 9:18 PMthdxr
03/08/2022, 9:19 PMthdxr
03/08/2022, 9:19 PMRoss Coundon
03/08/2022, 9:19 PMthdxr
03/08/2022, 9:20 PMRoss Coundon
03/08/2022, 9:20 PMRoss Coundon
03/08/2022, 9:27 PM