Skip to content

Commit

Permalink
fix: template-url (for large templates) needs to contain region
Browse files Browse the repository at this point in the history
  • Loading branch information
OlafConijn committed Nov 18, 2023
1 parent 0b5de44 commit a2a86ea
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/util/aws-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -695,11 +695,7 @@ export class CfnUtil {
}
const putObjectRequest: PutObjectCommandInput = { Bucket: bucketName, Key: `${stackName}-${templateHash}.json`, Body: stackInput.TemplateBody, ACL: 'bucket-owner-full-control' };
await s3Service.send(new PutObjectCommand(putObjectRequest));
if (binding.region.includes('us-gov')) {
stackInput.TemplateURL = `https://${bucketName}.s3-${binding.region}.amazonaws.com/${putObjectRequest.Key}`;
} else {
stackInput.TemplateURL = `https://${bucketName}.amazonaws.com/${putObjectRequest.Key}`;
}
stackInput.TemplateURL = `https://${bucketName}.s3-${binding.region}.amazonaws.com/${putObjectRequest.Key}`;
delete stackInput.TemplateBody;
}
}
Expand Down

0 comments on commit a2a86ea

Please sign in to comment.