diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5b9465e..eeec4f2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - run: wget https://github.com/mikefarah/yq/releases/download/v$YQ_VERSION/yq_linux_amd64.tar.gz -O - | tar xz && mv yq_linux_amd64 /usr/local/bin/yq - run: |- mkdir build - yq ".Resources.LogsLambda.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./handler.py)\"" axiom-cloudwatch-lambda-cloudformation-stack.template.yaml > build/axiom-cloudwatch-lambda-cloudformation-stack.yaml - yq ".Resources.BackfillerLambda.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./backfill.py)\"" axiom-cloudwatch-backfiller-lambda-cloudformation-stack.template.yaml > build/axiom-cloudwatch-backfiller-lambda-cloudformation-stack.yaml - yq ".Resources.AxiomCloudWatchLogsSubscriber.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./logs_subscriber.py)\"" axiom-cloudwatch-logs-subscriber-cloudformation-stack.template.yaml > build/axiom-cloudwatch-logs-subscriber-cloudformation-stack.yaml + yq ".Resources.LogsLambda.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./handler.py)\"" cloudwatch-ingester-axiom-cloudformation-stack.template.yaml > build/cloudwatch-ingester-axiom-cloudformation-stack.yaml + yq ".Resources.BackfillerLambda.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./backfill.py)\"" cloudwatch-backfiller-axiom-cloudformation-stack.template.yaml > build/cloudwatch-backfiller-axiom-cloudformation-stack.yaml + yq ".Resources.AxiomCloudWatchLogsSubscriber.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./logs_subscriber.py)\"" cloudwatch-subscriber-axiom-cloudformation-stack.template.yaml > build/cloudwatch-subscriber-axiom-cloudformation-stack.yaml - run: cat build/* diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d4f3b2f..3d0f86f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,9 +21,9 @@ jobs: - run: wget https://github.com/mikefarah/yq/releases/download/v$YQ_VERSION/yq_linux_amd64.tar.gz -O - | tar xz && mv yq_linux_amd64 /usr/local/bin/yq - run: |- mkdir build - yq ".Resources.LogsLambda.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./handler.py)\"" axiom-cloudwatch-lambda-cloudformation-stack.template.yaml > build/axiom-cloudwatch-lambda-cloudformation-stack.yaml - yq ".Resources.BackfillerLambda.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./backfill.py)\"" axiom-cloudwatch-backfiller-lambda-cloudformation-stack.template.yaml > build/axiom-cloudwatch-backfiller-lambda-cloudformation-stack.yaml - yq ".Resources.AxiomCloudWatchLogsSubscriber.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./logs_subscriber.py)\"" axiom-cloudwatch-logs-subscriber-cloudformation-stack.template.yaml > build/axiom-cloudwatch-logs-subscriber-cloudformation-stack.yaml + yq ".Resources.LogsLambda.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./handler.py)\"" cloudwatch-ingester-axiom-cloudformation-stack.template.yaml > build/cloudwatch-ingester-axiom-cloudformation-stack.yaml + yq ".Resources.BackfillerLambda.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./backfill.py)\"" cloudwatch-backfiller-axiom-cloudformation-stack.template.yaml > build/cloudwatch-backfiller-axiom-cloudformation-stack.yaml + yq ".Resources.AxiomCloudWatchLogsSubscriber.Properties.Code.ZipFile = \"$(sed 's/\"/\\\"/g' ./logs_subscriber.py)\"" cloudwatch-subscriber-axiom-cloudformation-stack.template.yaml > build/cloudwatch-subscriber-axiom-cloudformation-stack.yaml - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: diff --git a/README.md b/README.md index fef09fa..fdc7b78 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ Axiom CloudWatch Lambda uses the following CloudFormation stacks: 1. [Create an Axiom account](https://app.axiom.co). 2. Create a dataset in Axiom. 3. Create an API token in Axiom with permissions to ingest data to the dataset you created. -4. [Click this link to launch the Stack](https://console.aws.amazon.com/cloudformation/home?#/stacks/new?stackName=CloudWatch-Ingester-Axiom&templateURL=https://axiom-cloudformation.s3.amazonaws.com/stacks/axiom-cloudwatch-lambda-cloudformation-stack.yaml). -5. [Click this link to automatically subscribe to all existing log groups](https://console.aws.amazon.com/cloudformation/home?#/stacks/new?stackName=CloudWatch-Backfiller-Axiom&templateURL=https://axiom-cloudformation.s3.amazonaws.com/stacks/axiom-cloudwatch-backfiller-lambda-cloudformation-stack.yaml). -6. [Click this link to automatically subscribe to new log groups](https://console.aws.amazon.com/cloudformation/home?#/stacks/new?stackName=CloudWatch-Subscriber-Axiom&templateURL=https://axiom-cloudformation.s3.amazonaws.com/stacks/axiom-cloudwatch-logs-subscriber-cloudformation-stack.yaml). +4. [Click this link to launch the Stack](https://console.aws.amazon.com/cloudformation/home?#/stacks/new?stackName=cloudwatch-ingester-axiom&templateURL=https://axiom-cloudformation.s3.amazonaws.com/stacks/cloudwatch-ingester-axiom-cloudformation-stack.yaml). +5. [Click this link to automatically subscribe to all existing log groups](https://console.aws.amazon.com/cloudformation/home?#/stacks/new?stackName=cloudwatch-backfiller-axiom&templateURL=https://axiom-cloudformation.s3.amazonaws.com/stacks/cloudwatch-backfiller-axiom-cloudformation-stack.yaml). +6. [Click this link to automatically subscribe to new log groups](https://console.aws.amazon.com/cloudformation/home?#/stacks/new?stackName=cloudwatch-subscriber-axiom&templateURL=https://axiom-cloudformation.s3.amazonaws.com/stacks/cloudwatch-subscriber-axiom-cloudformation-stack.yaml). ## Logs Subscriber architecture diff --git a/axiom-cloudwatch-backfiller-lambda-cloudformation-stack.template.yaml b/cloudwatch-backfiller-axiom-cloudformation-stack.template.yaml similarity index 97% rename from axiom-cloudwatch-backfiller-lambda-cloudformation-stack.template.yaml rename to cloudwatch-backfiller-axiom-cloudformation-stack.template.yaml index bac067e..bb42d97 100644 --- a/axiom-cloudwatch-backfiller-lambda-cloudformation-stack.template.yaml +++ b/cloudwatch-backfiller-axiom-cloudformation-stack.template.yaml @@ -2,7 +2,7 @@ Parameters: LambdaFunctionName: Type: String Description: Name of the AWS Lambda Function. - Default: axiom-cloudwatch-backfiller-lambda + Default: cloudwatch-backfiller-axiom AllowedPattern: ".+" # required AxiomCloudWatchLambdaIngesterARN: Type: String diff --git a/axiom-cloudwatch-lambda-cloudformation-stack.template.yaml b/cloudwatch-ingester-axiom-cloudformation-stack.template.yaml similarity index 98% rename from axiom-cloudwatch-lambda-cloudformation-stack.template.yaml rename to cloudwatch-ingester-axiom-cloudformation-stack.template.yaml index d7436ab..fb86e02 100644 --- a/axiom-cloudwatch-lambda-cloudformation-stack.template.yaml +++ b/cloudwatch-ingester-axiom-cloudformation-stack.template.yaml @@ -20,7 +20,7 @@ Parameters: LambdaFunctionName: Type: String Description: Name of the AWS Lambda Function. - Default: axiom-cloudwatch-lambda + Default: cloudwatch-ingester-axiom AllowedPattern: ".+" # required DataTags: Type: String diff --git a/axiom-cloudwatch-logs-subscriber-cloudformation-stack.template.yaml b/cloudwatch-subscriber-axiom-cloudformation-stack.template.yaml similarity index 97% rename from axiom-cloudwatch-logs-subscriber-cloudformation-stack.template.yaml rename to cloudwatch-subscriber-axiom-cloudformation-stack.template.yaml index 3a2ccf5..840de97 100644 --- a/axiom-cloudwatch-logs-subscriber-cloudformation-stack.template.yaml +++ b/cloudwatch-subscriber-axiom-cloudformation-stack.template.yaml @@ -3,7 +3,7 @@ Parameters: LambdaFunctionName: Type: String Description: Name of the AWS Lambda Function. - Default: axiom-cloudwatch-logs-subscriber-lambda + Default: cloudwatch-subscriber-axiom AllowedPattern: ".+" # required AxiomCloudWatchLambdaIngesterARN: Type: String @@ -22,7 +22,7 @@ Resources: Type: AWS::S3::Bucket Properties: AccessControl: BucketOwnerFullControl - BucketName: !Join ["-", [!Ref AWS::StackName, "axiom", "cloudtrail"]] + BucketName: !Join ["-", [!Ref AWS::StackName, "cloudtrail"]] AxiomCloudWatchLogsSubscriberS3BucketPolicy: Type: AWS::S3::BucketPolicy DependsOn: AxiomCloudWatchLogsSubscriberS3Bucket