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

AWS::ApiGateway.AccessLogSetting.DestinationArn AllowedPatternRegex #1160

Closed
jlhood opened this issue Oct 16, 2019 · 1 comment
Closed

AWS::ApiGateway.AccessLogSetting.DestinationArn AllowedPatternRegex #1160

jlhood opened this issue Oct 16, 2019 · 1 comment
Assignees
Labels
good first issue Good for newcomers new rule New rule v1 v1.X

Comments

@jlhood
Copy link

jlhood commented Oct 16, 2019

Description of issue.

Amazon API Gateway just announced support for writing Access Logs directly to Kinesis Data Firehose instead of CloudWatch Logs.

Buried in the CloudFormation documentation is this constraint:

DestinationArn
The Amazon Resource Name (ARN) of the CloudWatch Logs log group or Kinesis Data Firehose delivery stream to receive access logs. If you specify a Kinesis Data Firehose delivery stream, the stream name must begin with amazon-apigateway-.

The stream name prefix constraint is likely going to trip up customers who are letting CloudFormation name their Kinesis Data Firehose delivery stream since it won't have the required prefix unless their stack name begins with amazon-apigateway-.

Opening this issue to see if cfn-lint could help users by detecting this scenario and issuing a warning/error.

@kddejong kddejong self-assigned this Oct 22, 2019
@kddejong kddejong added the new rule New rule label Oct 24, 2019
@PatMyron
Copy link
Contributor

PatMyron commented Aug 26, 2020

As described here, this needs AllowedPatternRegex to enforce:

"CidrIp": {
"AllowedPattern": "x.x.x.x/y",
"AllowedPatternRegex": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/([0-9]|[1-2][0-9]|3[0-2]))$"
},


This AllowedPatternRegex seems usable for a couple properties at least:

AWS::ApiGateway::Deployment.AccessLogSetting.DestinationArn

AWS::ApiGateway::Stage.AccessLogSetting.DestinationArn

@PatMyron PatMyron added the good first issue Good for newcomers label Aug 26, 2020
@PatMyron PatMyron changed the title Error if API GW Access Logging points to Kinesis Data Firehose not prefixed with amazon-apigateway- AWS::ApiGateway.AccessLogSetting.DestinationArn AllowedPatternRegex Aug 26, 2020
@kddejong kddejong added the v1 v1.X label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers new rule New rule v1 v1.X
Projects
None yet
Development

No branches or pull requests

3 participants