@@ -15,7 +15,7 @@ export interface GuFastlyLogsIamRoleProps {
1515 * @default - '*'
1616 * If paths are not specified, access will be granted to the entire S3 bucket.
1717 */
18- path ?: string [ ] ;
18+ paths ?: string [ ] ;
1919 /**
2020 * The name of the IAM role
2121 */
@@ -36,15 +36,15 @@ export interface GuFastlyLogsIamRoleProps {
3636 * ```typescript
3737 * new GuFastlyLogsIamRole(stack, {
3838 * bucketName: "gu-mobile-logs"
39- * path: "fastly/*"
39+ * paths: [ "fastly/*"]
4040 * })
4141 * ```
4242 *
4343 * See https://docs.fastly.com/en/guides/creating-an-aws-iam-role-for-fastly-logging
4444 */
4545export class GuFastlyLogsIamRole extends GuRole {
4646 constructor ( scope : GuStack , props : GuFastlyLogsIamRoleProps ) {
47- const { path = "*" } = props ; // set defaults
47+ const { paths = [ "*" ] } = props ; // set defaults
4848 const fastlyCustomerId = GuFastlyCustomerIdParameter . getInstance ( scope ) . valueAsString ;
4949 super ( scope , "GuFastlyLogsIamRole" , {
5050 assumedBy : new AccountPrincipal ( FASTLY_AWS_ACCOUNT_ID ) ,
@@ -53,7 +53,7 @@ export class GuFastlyLogsIamRole extends GuRole {
5353
5454 new GuAllowPolicy ( scope , "GuFastlyLogsIamRoleAllowPolicy" , {
5555 actions : [ "s3:PutObject" , "s3:AbortMultipartUpload" ] ,
56- resources : [ `arn:aws:s3:::${ props . bucketName } /${ path } ` ] ,
56+ resources : paths . map ( ( path ) => `arn:aws:s3:::${ props . bucketName } /${ path } ` ) ,
5757 } ) . attachToRole ( this ) ;
5858 }
5959}
0 commit comments