crossplane-contrib / provider-jet-aws

AWS Provider for Crossplane that is built with Terrajet.
https://crossplane.io
Apache License 2.0
37 stars 30 forks source link

Generate example manifests #138

Open ulucinar opened 2 years ago

ulucinar commented 2 years ago

Description of your changes

In the context of: https://github.com/crossplane-contrib/terrajet/issues/48

Adds generated example manifests for the Terraform resources.

I have:

How has this code been tested

An example generated manifest:

# This example manifest is auto-generated, and has not been tested.
# Please make the necessary adjustments before using it.
#apiVersion: ec2.aws.jet.crossplane.io/v1alpha2
#kind: NetworkInterface
#metadata:
#  name: example
#spec:
#  forProvider:
#    attachment:
#    - deviceIndex: 1
#      instanceRef:
#        name: example
#    privateIps:
#    - 10.0.0.50
#    securityGroupRefs:
#    - name: example
#    subnetIdRef:
#      name: example
#  providerConfigRef:
#    name: example

Corresponding Terraform registry example:

resource "aws_network_interface" "test" {
  subnet_id       = aws_subnet.public_a.id
  private_ips     = ["10.0.0.50"]
  security_groups = [aws_security_group.web.id]

  attachment {
    instance     = aws_instance.test.id
    device_index = 1
  }
}
ulucinar commented 2 years ago

I have couple of comments but it's quite hard to know whether they are doable or not without seeing the approach taken, which your planned one pager should help with.

Can we comment out the whole YAML in cases where it definitely won't work, for example the ones that contain any ${...} section? Commenting out the whole YAML for every example that hasn't been tested could also be a good option, as described here.

Thanks @muvaf for the comments. We now generate the example manifests with all lines commented out as suggested. They can selectively be uncommented/edited when adjusting the example manifests.

maltejk commented 2 years ago

@muvaf did you find time to review this? Thank you!