Skip to content

Commit

Permalink
fix: change names to remove s3 prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Usman committed Feb 12, 2025
1 parent 2acba43 commit f290016
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/blueprint-construct/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export default class BlueprintConstruct {
new addons.OpaGatekeeperAddOn(),
new addons.PrometheusNodeExporterAddOn(),
new addons.S3CSIDriverAddOn({
s3BucketName: "s3-csi-driver-for-blueprints-xbucket",
bucketNames: ["s3-csi-driver-for-blueprints-xbucket"],
}),
new addons.SecretsStoreAddOn(),
new addons.SSMAgentAddOn(),
Expand Down
4 changes: 2 additions & 2 deletions lib/addons/s3-csi-driver/iam-policy.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as iam from 'aws-cdk-lib/aws-iam';

export function getS3DriverPolicyStatements(s3BucketNames: string[]): iam.PolicyStatement[] {
export function getS3DriverPolicyStatements(bucketNames: string[]): iam.PolicyStatement[] {
// new IAM policy to grand access to S3 bucket
// https://github.com/awslabs/mountpoint-s3/blob/main/doc/CONFIGURATION.md#iam-permissions
const s3BucketArns = s3BucketNames.map((name) => `arn:aws:s3:::${name}`);
const s3BucketArns = bucketNames.map((name) => `arn:aws:s3:::${name}`);
return [
new iam.PolicyStatement({
sid: 'S3MountpointFullBucketAccess',
Expand Down
6 changes: 3 additions & 3 deletions lib/addons/s3-csi-driver/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface S3CSIDriverAddOnProps extends HelmAddOnUserProps {
/**
* The names of the S3 buckets to be used by the driver
*/
s3BucketNames: string[];
bucketNames: string[];
/**
* Create Namespace with the provided one (will not if namespace is kube-system)
*/
Expand All @@ -36,7 +36,7 @@ const defaultProps: HelmAddOnUserProps & S3CSIDriverAddOnProps = {
version: "v1.11.0",
repository: "https://awslabs.github.io/mountpoint-s3-csi-driver",
createNamespace: false,
s3BucketNames: []
bucketNames: []
};

@supportsALL
Expand All @@ -59,7 +59,7 @@ export class S3CSIDriverAddOn extends HelmAddOn {

const s3BucketPolicy = new iam.Policy(cluster, S3_DRIVER_POLICY, {
statements:
getS3DriverPolicyStatements(this.options.s3BucketNames)
getS3DriverPolicyStatements(this.options.bucketNames)
});
serviceAccount.role.attachInlinePolicy(s3BucketPolicy);

Expand Down

0 comments on commit f290016

Please sign in to comment.