Closed marcosdiez closed 5 months ago
Hey!
The problem on CloudFrontWebDistribution
's priceClass
property actually is in the source documentation. I have submitted aws/aws-cdk#7926 to address that.
The other problems are probably a bug in how the jsii
runtime performs case adjustments in this particular case. I'd suppose because the configuration object/dict is nested within an array - possibly this causes the struct transformation not to happen.
So in any case, thank you for reporting this!
This issue has not received any attention in 2 years. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
This issue is important
The documentation is now correct, showing the "structified" Python version, rather than the bare JSON (which is sent unmodified over the wire):
source_bucket = s3.Bucket(self, "Bucket")
distribution = cloudfront.CloudFrontWebDistribution(self, "MyDistribution",
origin_configs=[cloudfront.SourceConfiguration(
s3_origin_source=cloudfront.S3OriginConfig(
s3_bucket_source=source_bucket
),
behaviors=[cloudfront.Behavior(is_default_behavior=True)]
)
]
)
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
:bug: Bug Report
Affected Languages
TypeScript
orJavascript
Python
Java
C#
,F#
, ...)General Information
What is the problem?
On the CDK 1.38.0 documentation, the example seems to be right (in
snake_case
), but what really works is incamelCase
.Here is an example:
https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_cloudfront.README.html
the example says:
but what really works is:
Since CDK tries to follow pep8 and parameters and methods
snake_case
, the example is right but the classes themselves are not. Hence I did not fill the bug on https://github.com/aws/jsii/issues/826Another Example:
source: https://docs.aws.amazon.com/cdk/api/latest/python/aws_cdk.aws_cloudfront/CloudFrontWebDistribution.html
price_class (Optional[PriceClass]) – The price class for the distribution (this impacts how many locations CloudFront uses for your distribution, and billing). Default: PriceClass.PriceClass100 the cheapest option for CloudFront is picked by default.
The valid name is actually
PriceClass.PRICE_CLASS_100