From e8f744925ea6153b576bf2f3ede1bd97d9325eed Mon Sep 17 00:00:00 2001 From: ljacobsson Date: Thu, 15 Dec 2022 20:01:16 +0100 Subject: [PATCH] removing logs policy --- package.json | 2 +- src/commands/pipes/pipe-builder.js | 23 +++-------------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index cd99df1..4c1cc47 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mhlabs/evb-cli", - "version": "1.1.48", + "version": "1.1.49", "description": "A package for building EventBridge/CloudWatch Events patterns", "main": "index.js", "scripts": { diff --git a/src/commands/pipes/pipe-builder.js b/src/commands/pipes/pipe-builder.js index 4918b7e..3db7854 100644 --- a/src/commands/pipes/pipe-builder.js +++ b/src/commands/pipes/pipe-builder.js @@ -8,7 +8,7 @@ async function build(command) { const templateName = cmd.template; const template = templateParser.load(templateName, true); if (!template) { - console.log(`Template "${templateName}" does not exist or could not be parsed.`); + console.log(`Template "${templateName}" does not exist or could not be parsed. Please use the '--template ' option to use another file.`); return; } const compatibleSources = await getSources(template); @@ -34,7 +34,7 @@ async function build(command) { target = { type: type, arn: arn, name: type.split(":")[1] } } const targetConfig = supportedTypes.find(p => p.Type === target.type); - const targetObj = await buildParametersForSide(targetConfig.TargetSchemaName); + const targetObj = await buildParametersForSide(targetConfig.TargetSchemaName); const sourcePropertyName = sourceConfig.SourceSchemaName.replace("PipeSource", ""); const targetPropertyName = targetConfig.TargetSchemaName.replace("PipeTarget", ""); const pipeName = `${source.name}To${target.name}Pipe`; @@ -75,24 +75,7 @@ async function build(command) { } ] }, - Policies: [ - { - PolicyName: "LogsPolicy", - PolicyDocument: { - Version: "2012-10-17", - Statement: [ - { - Effect: "Allow", - Action: [ - "logs:CreateLogStream", - "logs:CreateLogGroup", - "logs:PutLogEvents"], - Resource: "*" - }, - ], - } - } - ] + Policies: [] } }; sourceConfig.SourcePolicy.Statement[0].Resource = source.arn || JSON.parse(JSON.stringify((sourceConfig.SourcePolicy.Statement[0].Resource || sourceConfig.ArnGetter)).replace(/#RESOURCE_NAME#/g, source.name));