feat: grant S3 bucket access to EC2 instance role for document storage management

This commit is contained in:
vickytechkey 2026-08-16 19:02:37 +05:30
parent 420469dc9e
commit 3713bcdee2

View file

@ -113,6 +113,21 @@ export class AwsCdkStack extends cdk.Stack {
],
}));
// S3 access for Betasupplierdocument storage
role.addToPolicy(new iam.PolicyStatement({
actions: [
's3:ListBucket',
's3:GetBucketLocation',
's3:GetObject',
's3:PutObject',
's3:DeleteObject',
],
resources: [
'arn:aws:s3:::betasupplierdocument-764709663363-ap-south-2-an',
'arn:aws:s3:::betasupplierdocument-764709663363-ap-south-2-an/*',
],
}));
// 3. Define the EC2 Instance (t4g.medium)
const instance = new ec2.Instance(this, 'internalsInstance', {
vpc,