Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Generate example YAMLs #48

Closed
muvaf opened this issue Sep 2, 2021 · 4 comments · May be fixed by #173
Closed

Generate example YAMLs #48

muvaf opened this issue Sep 2, 2021 · 4 comments · May be fixed by #173
Assignees
Labels
beta enhancement New feature or request

Comments

@muvaf
Copy link
Member

muvaf commented Sep 2, 2021

What problem are you facing?

Right now at this scale (+700 for AWS +650 for Azure etc.), we cannot write an example YAML for each resource. But we need them for documentation, Crossplane Conformance and just to make sure resource-specific stuff works, like external-name -> id field.

How could Terrajet help solve your problem?

We can have a tool that will take HCL example and print its YAML version using the same strcase instance that our schema generator uses. The source of input would depend on provider but for example, AWS stores examples in their repo directly though it's not a complete list.

@muvaf muvaf added enhancement New feature or request beta labels Sep 2, 2021
@muvaf
Copy link
Member Author

muvaf commented Oct 21, 2021

@jbw976 mentioned that having an example YAML generated with the skeleton schema could help bootstrapping the examples. For example, we can have an example YAML generated like the following:

#
# This file is generated by Terrajet to help the author of examples.
# Please uncomment the lines once you test and make sure the example works.
#
#apiVersion: ec2.aws.tf.crossplane.io/v1alpha1
#kind: Instance
#metadata:
#  name: sample-instance
#spec:
#  forProvider:
#    region: some_value
#    ami: some_value
#    instanceType: some_value

@turkenh
Copy link
Member

turkenh commented Dec 3, 2021

Cross-linking this comment here.

Here is the source of examples for aws_instance: https://github.com/hashicorp/terraform-provider-aws/blob/main/website/docs/r/instance.html.markdown#example-usage

@muvaf
Copy link
Member Author

muvaf commented Dec 14, 2021

@ulucinar Bunch of PRs have been opened. As we talked last week, could you write down about the approach you're taking in this issue and some other possible options for discussion before going further?

@ulucinar
Copy link
Collaborator

ulucinar commented Mar 9, 2022

Closing this issue as we have generated example manifests for the big three providers with the following PRs:

@ulucinar ulucinar closed this as completed Mar 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beta enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants