[Documentation]: Python examples for aws_acm_certificate
do not work
#33613
Labels
documentation
Introduces or discusses updates to documentation.
service/acm
Issues and PRs that pertain to the acm service.
Terraform Core Version
1.5.5
AWS Provider Version
4.67.0
Affected Resource(s)
I'm attempting to create an ACM certificate along with the domain validation records in Python using cdktf without success. I'm not sure if the problem is with the result of the 'domain_validation_options' for the certificate is correct or with the for_each looping. In either case the example code is incorrect.
Starting with the example code found at (https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acm_certificate_validation?lang=python) with non-relevant code removed, I have the following code that illustrates the problem:
On running;
I get the following results;
The original code source of the example posted in the documentation is generated by some tool and doesn't seem to handle converting string interpolations between Typescript and Python.
When I change line 24 from:
To:
Where the difference is;
Additionally I made similar changes to line 47. Originally it was;
To:
Now the results of running 'cdktf deploy' with these changes results with following error;
At this point I'm stuck and not sure if I'm making a progress. Neither have I found a way to effectively debug this issue further.
Expected Behavior
A Route53 domain validation record to be created.
Actual Behavior
Deployment generates the following error;
tf-test-python ╷
│ Error: Missing key/value separator
│
│ on cdk.tf.json line 52, in resource.aws_route53_record.example (example_2):
│ 52: "for_each": "${toset({{ for dvo in {example.domain_validation_options} : dvo.domain_name => {\n name = dvo.resource_record_name\n record = dvo.resource_record_value\n type = dvo.resource_record_type\n }}})}",
│
│ Expected an equals sign ("=") to mark the beginning of the attribute value.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Here's the cdktf.json file;
Steps to Reproduce
init the project
cdktf init --template=typescript --providers=hashicorp/aws --local
paste the following into main.py
set the domain name and hosted zone id to correct values.
run the deployment
cdktf deploy
Debug Output
No response
Panic Output
No response
Important Factoids
Here is the cdk.tf.json file generated;
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: