-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cloudfront): additional cloudfront distribution metrics (#28777)
This PR supports the activation of [additional cloudfront distribution metrics](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/viewing-cloudfront-metrics.html#monitoring-console.distributions-additional). ```ts new cloudfront.Distribution(this, 'myDist', { defaultBehavior: { origin: new origins.HttpOrigin('www.example.com') }, publishAdditionalMetrics: true, // added }); ``` Closes #22922. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
1 parent
c17dbde
commit 95d187e
Showing
12 changed files
with
1,273 additions
and
1 deletion.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...ribution-additional-metrics.js.snapshot/MyTestDefaultTestDeployAssertB8AA280E.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...bution-additional-metrics.js.snapshot/MyTestDefaultTestDeployAssertB8AA280E.template.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...cloudfront/test/integ.distribution-additional-metrics.js.snapshot/MyTestStack.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
236 changes: 236 additions & 0 deletions
236
...oudfront/test/integ.distribution-additional-metrics.js.snapshot/MyTestStack.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,236 @@ | ||
{ | ||
"Resources": { | ||
"DistB3B78991": { | ||
"Type": "AWS::CloudFront::Distribution", | ||
"Properties": { | ||
"DistributionConfig": { | ||
"DefaultCacheBehavior": { | ||
"CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6", | ||
"Compress": true, | ||
"TargetOriginId": "MyTestStackDistOrigin1CBA48A7B", | ||
"ViewerProtocolPolicy": "allow-all" | ||
}, | ||
"Enabled": true, | ||
"HttpVersion": "http2", | ||
"IPV6Enabled": true, | ||
"Origins": [ | ||
{ | ||
"CustomOriginConfig": { | ||
"OriginProtocolPolicy": "https-only" | ||
}, | ||
"DomainName": "www.example.com", | ||
"Id": "MyTestStackDistOrigin1CBA48A7B" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"DistMonitoringSubscriptionDD7607C2": { | ||
"Type": "AWS::CloudFront::MonitoringSubscription", | ||
"Properties": { | ||
"DistributionId": { | ||
"Ref": "DistB3B78991" | ||
}, | ||
"MonitoringSubscription": { | ||
"RealtimeMetricsSubscriptionConfig": { | ||
"RealtimeMetricsSubscriptionStatus": "Enabled" | ||
} | ||
} | ||
} | ||
}, | ||
"Alarm1F9009D71": { | ||
"Type": "AWS::CloudWatch::Alarm", | ||
"Properties": { | ||
"ComparisonOperator": "GreaterThanThreshold", | ||
"Dimensions": [ | ||
{ | ||
"Name": "DistributionId", | ||
"Value": { | ||
"Ref": "DistB3B78991" | ||
} | ||
} | ||
], | ||
"EvaluationPeriods": 1, | ||
"MetricName": "OriginLatency", | ||
"Namespace": "AWS/CloudFront", | ||
"Period": 300, | ||
"Statistic": "Average", | ||
"Threshold": 1 | ||
} | ||
}, | ||
"Alarm2A7122E13": { | ||
"Type": "AWS::CloudWatch::Alarm", | ||
"Properties": { | ||
"ComparisonOperator": "GreaterThanThreshold", | ||
"Dimensions": [ | ||
{ | ||
"Name": "DistributionId", | ||
"Value": { | ||
"Ref": "DistB3B78991" | ||
} | ||
} | ||
], | ||
"EvaluationPeriods": 1, | ||
"MetricName": "CacheHitRate", | ||
"Namespace": "AWS/CloudFront", | ||
"Period": 300, | ||
"Statistic": "Average", | ||
"Threshold": 1 | ||
} | ||
}, | ||
"Alarm32341D8D9": { | ||
"Type": "AWS::CloudWatch::Alarm", | ||
"Properties": { | ||
"ComparisonOperator": "GreaterThanThreshold", | ||
"Dimensions": [ | ||
{ | ||
"Name": "DistributionId", | ||
"Value": { | ||
"Ref": "DistB3B78991" | ||
} | ||
} | ||
], | ||
"EvaluationPeriods": 1, | ||
"MetricName": "401ErrorRate", | ||
"Namespace": "AWS/CloudFront", | ||
"Period": 300, | ||
"Statistic": "Average", | ||
"Threshold": 1 | ||
} | ||
}, | ||
"Alarm4671832C8": { | ||
"Type": "AWS::CloudWatch::Alarm", | ||
"Properties": { | ||
"ComparisonOperator": "GreaterThanThreshold", | ||
"Dimensions": [ | ||
{ | ||
"Name": "DistributionId", | ||
"Value": { | ||
"Ref": "DistB3B78991" | ||
} | ||
} | ||
], | ||
"EvaluationPeriods": 1, | ||
"MetricName": "403ErrorRate", | ||
"Namespace": "AWS/CloudFront", | ||
"Period": 300, | ||
"Statistic": "Average", | ||
"Threshold": 1 | ||
} | ||
}, | ||
"Alarm548383B2F": { | ||
"Type": "AWS::CloudWatch::Alarm", | ||
"Properties": { | ||
"ComparisonOperator": "GreaterThanThreshold", | ||
"Dimensions": [ | ||
{ | ||
"Name": "DistributionId", | ||
"Value": { | ||
"Ref": "DistB3B78991" | ||
} | ||
} | ||
], | ||
"EvaluationPeriods": 1, | ||
"MetricName": "404ErrorRate", | ||
"Namespace": "AWS/CloudFront", | ||
"Period": 300, | ||
"Statistic": "Average", | ||
"Threshold": 1 | ||
} | ||
}, | ||
"Alarm65738D89F": { | ||
"Type": "AWS::CloudWatch::Alarm", | ||
"Properties": { | ||
"ComparisonOperator": "GreaterThanThreshold", | ||
"Dimensions": [ | ||
{ | ||
"Name": "DistributionId", | ||
"Value": { | ||
"Ref": "DistB3B78991" | ||
} | ||
} | ||
], | ||
"EvaluationPeriods": 1, | ||
"MetricName": "502ErrorRate", | ||
"Namespace": "AWS/CloudFront", | ||
"Period": 300, | ||
"Statistic": "Average", | ||
"Threshold": 1 | ||
} | ||
}, | ||
"Alarm77B1024B6": { | ||
"Type": "AWS::CloudWatch::Alarm", | ||
"Properties": { | ||
"ComparisonOperator": "GreaterThanThreshold", | ||
"Dimensions": [ | ||
{ | ||
"Name": "DistributionId", | ||
"Value": { | ||
"Ref": "DistB3B78991" | ||
} | ||
} | ||
], | ||
"EvaluationPeriods": 1, | ||
"MetricName": "503ErrorRate", | ||
"Namespace": "AWS/CloudFront", | ||
"Period": 300, | ||
"Statistic": "Average", | ||
"Threshold": 1 | ||
} | ||
}, | ||
"Alarm8AEE8034F": { | ||
"Type": "AWS::CloudWatch::Alarm", | ||
"Properties": { | ||
"ComparisonOperator": "GreaterThanThreshold", | ||
"Dimensions": [ | ||
{ | ||
"Name": "DistributionId", | ||
"Value": { | ||
"Ref": "DistB3B78991" | ||
} | ||
} | ||
], | ||
"EvaluationPeriods": 1, | ||
"MetricName": "504ErrorRate", | ||
"Namespace": "AWS/CloudFront", | ||
"Period": 300, | ||
"Statistic": "Average", | ||
"Threshold": 1 | ||
} | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...-integ/test/aws-cloudfront/test/integ.distribution-additional-metrics.js.snapshot/cdk.out
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...teg/test/aws-cloudfront/test/integ.distribution-additional-metrics.js.snapshot/integ.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.