@guardian/cdk 63.6.0 → 63.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastly-logs-iam.d.ts","sourceRoot":"","sources":["../../../src/constructs/iam/fastly-logs-iam.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,mBAAoB,SAAQ,MAAM;gBACjC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,wBAAwB;
|
|
1
|
+
{"version":3,"file":"fastly-logs-iam.d.ts","sourceRoot":"","sources":["../../../src/constructs/iam/fastly-logs-iam.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,mBAAoB,SAAQ,MAAM;gBACjC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,wBAAwB;CAa5D"}
|
|
@@ -34,11 +34,10 @@ class GuFastlyLogsIamRole extends roles_1.GuRole {
|
|
|
34
34
|
assumedBy: new aws_iam_1.AccountPrincipal(fastly_aws_account_id_1.FASTLY_AWS_ACCOUNT_ID),
|
|
35
35
|
externalIds: [fastlyCustomerId],
|
|
36
36
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
policy.attachToRole(this);
|
|
37
|
+
new policies_1.GuAllowPolicy(scope, "GuFastlyLogsIamRoleAllowPolicy", {
|
|
38
|
+
actions: ["s3:PutObject", "s3:AbortMultipartUpload"],
|
|
39
|
+
resources: [`arn:aws:s3:::${props.bucketName}/${path}`],
|
|
40
|
+
}).attachToRole(this);
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
exports.GuFastlyLogsIamRole = GuFastlyLogsIamRole;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastly-logs-iam.js","sourceRoot":"","sources":["../../../src/constructs/iam/fastly-logs-iam.ts"],"names":[],"mappings":";;;AAAA,iDAAuD;AACvD,iFAA8E;AAE9E,kCAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"fastly-logs-iam.js","sourceRoot":"","sources":["../../../src/constructs/iam/fastly-logs-iam.ts"],"names":[],"mappings":";;;AAAA,iDAAuD;AACvD,iFAA8E;AAE9E,kCAAsD;AACtD,yCAA2C;AAC3C,mCAAiC;AAejC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,mBAAoB,SAAQ,cAAM;IAC7C,YAAY,KAAc,EAAE,KAA+B;QACzD,MAAM,EAAE,IAAI,GAAG,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,eAAe;QAC7C,MAAM,gBAAgB,GAAG,kCAA2B,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC;QACtF,KAAK,CAAC,KAAK,EAAE,qBAAqB,EAAE;YAClC,SAAS,EAAE,IAAI,0BAAgB,CAAC,6CAAqB,CAAC;YACtD,WAAW,EAAE,CAAC,gBAAgB,CAAC;SAChC,CAAC,CAAC;QAEH,IAAI,wBAAa,CAAC,KAAK,EAAE,gCAAgC,EAAE;YACzD,OAAO,EAAE,CAAC,cAAc,EAAE,yBAAyB,CAAC;YACpD,SAAS,EAAE,CAAC,gBAAgB,KAAK,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;SACxD,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;CACF;AAdD,kDAcC","sourcesContent":["import { AccountPrincipal } from \"aws-cdk-lib/aws-iam\";\nimport { FASTLY_AWS_ACCOUNT_ID } from \"../../constants/fastly-aws-account-id\";\nimport type { GuStack } from \"../core\";\nimport { GuFastlyCustomerIdParameter } from \"../core\";\nimport { GuAllowPolicy } from \"./policies\";\nimport { GuRole } from \"./roles\";\n\nexport interface GuFastlyLogsIamRoleProps {\n /**\n * S3 bucket name that Fastly will ship logs\n */\n bucketName: string;\n /**\n * Path within the S3 bucket where Fastly will ship logs.\n * @default - '*'\n * If path is not specified, access will be granted to the entire S3 bucket.\n */\n path?: string;\n}\n\n/**\n * Construct which creates the required IAM resources to support Fastly logging to an S3 bucket.\n * Importantly, it does not create a permanent IAM user, which was once a requirement.\n *\n * Specifically, this construct creates a role which can only be assumed in Fastly's AWS account,\n * with an attached policy allowing PUT access to an S3 bucket and path specified in the props.\n *\n * As mentioned, you should configure the S3 bucket used with `bucketName` and the path within\n * that bucket with the optional `path`. `path` defaults to `\"*\"` i.e. access is given to the\n * entire bucket.\n *\n * ```typescript\n * new GuFastlyLogsIamRole(stack, {\n * bucketName: \"gu-mobile-logs\"\n * path: \"fastly/*\"\n * })\n * ```\n *\n * See https://docs.fastly.com/en/guides/creating-an-aws-iam-role-for-fastly-logging\n */\nexport class GuFastlyLogsIamRole extends GuRole {\n constructor(scope: GuStack, props: GuFastlyLogsIamRoleProps) {\n const { path = \"*\" } = props; // set defaults\n const fastlyCustomerId = GuFastlyCustomerIdParameter.getInstance(scope).valueAsString;\n super(scope, \"GuFastlyLogsIamRole\", {\n assumedBy: new AccountPrincipal(FASTLY_AWS_ACCOUNT_ID),\n externalIds: [fastlyCustomerId],\n });\n\n new GuAllowPolicy(scope, \"GuFastlyLogsIamRoleAllowPolicy\", {\n actions: [\"s3:PutObject\", \"s3:AbortMultipartUpload\"],\n resources: [`arn:aws:s3:::${props.bucketName}/${path}`],\n }).attachToRole(this);\n }\n}\n"]}
|