better-france-43525
09/08/2025, 1:03 PMnew aws.iam.RolePolicy("buildRoleMinimal", {
role: buildRole.id,
policy: pulumi.all([artifactBucket.arn]).apply(([artifactArn]) => JSON.stringify({
Version: "2012-10-17",
Statement: [
// Logs
{
Effect: "Allow",
Action: [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:DescribeLogGroups",
"logs:DescribeLogStreams",
"logs:GetLogEvents",
],
Resource: "*",
},
// VPC ENI + required Describe permissions (expanded)
{
Effect: "Allow",
Action: [
"ec2:CreateNetworkInterface",
"ec2:CreateNetworkInterfacePermission",
"ec2:DeleteNetworkInterface",
"ec2:DescribeNetworkInterfaces",
"ec2:DescribeVpcs",
"ec2:DescribeSubnets",
"ec2:DescribeSecurityGroups",
"ec2:DescribeDhcpOptions",
"ec2:DescribeRouteTables",
"ec2:DescribeInternetGateways",
"ec2:DescribeNatGateways"
],
Resource: "*",
},
// Optional: read params during build
{
Effect: "Allow",
Action: [
"ssm:GetParameter",
"ssm:GetParameters",
"ssm:GetParametersByPath",
],
Resource: "*",
},
// S3 access to the CodePipeline artifact bucket (source in, output out)
{
Effect: "Allow",
Action: [
"s3:GetObject",
"s3:GetObjectVersion",
"s3:PutObject",
"s3:DeleteObject",
"s3:ListBucket",
"s3:GetBucketAcl",
"s3:GetBucketLocation",
"s3:PutObjectTagging",
"s3:AbortMultipartUpload",
"s3:ListBucketMultipartUploads",
"s3:ListMultipartUploadParts",
],
Resource: [
artifactArn,
`${artifactArn}/*`,
],
},
{
Effect: "Allow",
Action: [
"codebuild:CreateReport",
"codebuild:CreateReportGroup",
"codebuild:UpdateReportGroup",
"codebuild:DeleteReportGroup",
"codebuild:UpdateReport",
"codebuild:GetReport",
"codebuild:GetReportGroup",
"codebuild:GetReportGroup",
"codebuild:BatchGetReportGroups",
"codebuild:ListReportGroups"
],
Resource: "*"
}
],
})),
});
elasatic beanstalk has the following artifact bucket policy:
new aws.s3.BucketPolicy("artifactBucketPolicy", {
bucket: artifactBucket.id,
policy: pulumi.all([ebServiceRole.arn, ebRole.arn, artifactBucket.bucket]).apply(([ebServiceRoleArn, ebRoleArn, bucketName]) => {
return JSON.stringify({
Version: "2012-10-17",
Statement: [
{
Effect: "Allow",
Principal: {
AWS: [ebServiceRoleArn, ebRoleArn]
},
Action: [
"s3:ListBucket",
"s3:GetBucketLocation",
"s3:GetBucketAcl"
],
Resource: `arn:aws:s3:::${bucketName}`
},
{
Effect: "Allow",
Principal: {
AWS: [ebServiceRoleArn, ebRoleArn]
},
Action: [
"s3:GetObject",
"s3:GetObjectVersion",
"s3:PutObjectTagging"
],
Resource: `arn:aws:s3:::${bucketName}/*`
}
]
});
})
});little-cartoon-10569
09/08/2025, 8:01 PMlittle-cartoon-10569
09/08/2025, 8:24 PMbetter-france-43525
09/08/2025, 8:25 PMlittle-cartoon-10569
09/08/2025, 8:27 PMlittle-cartoon-10569
09/08/2025, 8:28 PMNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by