aws-architect 6.6.32 → 6.6.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/BucketManager.js +6 -2
- package/package.json +1 -1
package/lib/BucketManager.js
CHANGED
|
@@ -164,10 +164,14 @@ class BucketManager {
|
|
|
164
164
|
await this.S3Manager.headBucket({ Bucket: bucket }).promise();
|
|
165
165
|
} catch (error) {
|
|
166
166
|
if (error.code !== 'NotFound') {
|
|
167
|
-
throw error;
|
|
167
|
+
throw { title: 'Failed to validate deployment bucket is available', error, bucket };
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
const params = { Bucket: bucket, ObjectOwnership: 'BucketOwnerEnforced' };
|
|
171
|
+
if (this.S3Manager.config.region !== 'us-east-1') {
|
|
172
|
+
params.CreateBucketConfiguration = { LocationConstraint: this.S3Manager.config.region };
|
|
173
|
+
}
|
|
174
|
+
await this.S3Manager.createBucket(params).promise();
|
|
171
175
|
await this.S3Manager.putPublicAccessBlock({
|
|
172
176
|
Bucket: bucket, PublicAccessBlockConfiguration: { BlockPublicAcls: true, BlockPublicPolicy: true, IgnorePublicAcls: true, RestrictPublicBuckets: true }
|
|
173
177
|
}).promise();
|