Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directions referring to appending .<region> to CreateTemplateURLPrefix and LambdaS3BucketNamePrefix appear to be unnecessary and confusing #13

Open
stephen-leavitt-sonymusicpub-com opened this issue Dec 11, 2019 · 0 comments

Comments

@stephen-leavitt-sonymusicpub-com

The parameters CreateTemplateURLPrefix and LambdaS3BucketNamePrefix have descriptions that seem to direct the user to append . to the end of them. In both cases, the CloudFormation template is already appending AWS::Region to them, so if the user specifies this manually as well, it leads to buckets not being found.

cwl-s3-export.template:282

        "StackCreateCloudWatchLogExport": {
            "Type": "AWS::CloudFormation::Stack",
            "Properties": {
                "Parameters": {
                    "CloudWatchLogGroup": {"Ref": "CloudWatchLogGroup"},
                    "KinesisShards": {"Ref": "KinesisShards"},
                    "LogFormat": {"Ref": "LogFormat"},
                    "SubscriptionFilterPattern": {"Ref": "SubscriptionFilterPattern"},
                    "S3BucketName": {"Ref": "S3BucketName"},
                    "S3LogFolderName": {"Ref": "S3LogFolderName"},
                    "LambdaS3BucketNamePrefix": {"Ref": "LambdaS3BucketNamePrefix"},
                    "LambdaPackageName": {"Ref": "LambdaPackageName"},
                    "AlertLogicAWSAccountId": {"Ref": "AlertLogicAWSAccountId"},
                    "AlertLogicPublicApiKey": {"Ref": "AlertLogicPublicApiKey"},
                    "AlertLogicAccountId": {"Ref": "AlertLogicAccountId"},
                    "DestinationArn": {
                        "Fn::GetAtt": [
                            "CloudWatchLogGroupInfo",
                            "destinationArn"
                        ]
                    }
                },
                "TemplateURL": {
                    "Fn::Join": [
                        "",
                        [
                            {
                                "Ref": "CreateTemplateURLPrefix"
                            },
                            ".",
                            {
                                "Ref": "AWS::Region"
                            },
                            "/templates/create-cwl-s3-export.template"
                        ]
                    ]
                },
                "TimeoutInMinutes": "10"
            }
        }

create-cwl-s3-export.template:355 (Note that LambdaS3BucketNamePrefix is not used, that alertlogic-public-repo. is hard-wired as part of the prefix, with the AWS::Region appended to it).

        "CreateLambdaS3ExportWorkerFunction": {
            "Type": "AWS::Lambda::Function",
            "Properties": {
                "Handler": "index.handler",
                "Description": "CloudWatch Logs export to S3 function.",
                "Role": {
                    "Fn::GetAtt": [
                        "LambdaS3ExportWorkerRole",
                        "Arn"
                    ]
                },
                "Code": {
                    "S3Bucket": {
                        "Fn::Join": [
                            "",
                            [
                                "alertlogic-public-repo.",
                                {
                                    "Ref": "AWS::Region"
                                }
                            ]
                        ]
                    },
                    "S3Key": {
                        "Ref": "LambdaPackageName"
                    }
                },
                "Runtime": "nodejs8.10",
                "Timeout": "300"
            },
            "DependsOn": [
                "LambdaS3ExportWorkerPolicy"
            ]
        },

Recommend updating CreateLambdaS3ExportWorkerFunction to use LambdaS3BucketNamePrefix instead of hard-wiring alertlogic-public-repo., and removing instructions from the parameter descriptions directing the user to append . to the end of CreateTemplateURLPrefix and LambdaS3BucketNamePrefix if the current AWS region is going to be automatically appended by the CloudFormation template anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant