3 ms·
I had a JSON file with the following format: [{“Key”:”Company”},{“Value”:”${company}”},…] I asked it to write a Python script that replaces any word surrounde
by scarface74 4y ago
I had a JSON file with the following format:
[{“Key”:”Company”},{“Value”:”${company}”},…]
I asked it to write a Python script that replaces any word surrounded by ${} with the value in its corresponding environment variable and accept the path of the file as a command line argument —json-file using argparse. It worked perfectly.
Then I started asking it to write a script to successively do the following
Given the same json file, write a snippet of YML that looks like sample CF templates parameter section that I gave it.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGui...
It worked perfectly.
Then I told it to accept an optional argument that generated the corresponding meta data section. It worked flawlessly. I gave it sample expected output
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-interface.html https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGui...
Then I told it to output the format needed to pass those parameters to a nested stack and gave it an example;
Parameters:
Company: !Ref company
…
It worked again.
Finally, I needed it to generate the Python code to generate the CodeBuild Environment section and I gave it an example.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environmentvariable.html https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGui...