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

Add example manifests #19

Merged
merged 1 commit into from
Jan 18, 2022
Merged

Add example manifests #19

merged 1 commit into from
Jan 18, 2022

Conversation

ulucinar
Copy link
Collaborator

@ulucinar ulucinar commented Dec 14, 2021

Description of your changes

In the context of: crossplane/terrajet#48

Adds generated example manifests for the Terraform resources.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

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: compute.gcp.jet.crossplane.io/v1alpha2
#kind: Instance
#metadata:
#  name: example
#spec:
#  forProvider:
#    bootDisk:
#    - initializeParams:
#      - image: debian-cloud/debian-9
#    machineType: e2-medium
#    metadata:
#      foo: bar
#    metadataStartupScript: echo hi > /test.txt
#    networkInterface:
#    - accessConfig:
#      - {}
#      networkRef:
#        name: example
#    scratchDisk:
#    - interface: SCSI
#    serviceAccount:
#    - email: ${google_service_account.default.email}
#      scopes:
#      - cloud-platform
#    tags:
#    - foo
#    - bar
#    zone: us-central1-a
#  providerConfigRef:
#    name: example

Corresponding Terraform registry example:

resource "google_compute_instance" "default" {
  name         = "test"
  machine_type = "e2-medium"
  zone         = "us-central1-a"

  tags = ["foo", "bar"]

  boot_disk {
    initialize_params {
      image = "debian-cloud/debian-9"
    }
  }

  // Local SSD disk
  scratch_disk {
    interface = "SCSI"
  }

  network_interface {
    network = "default"

    access_config {
      // Ephemeral public IP
    }
  }

  metadata = {
    foo = "bar"
  }

  metadata_startup_script = "echo hi > /test.txt"

  service_account {
    # Google recommends custom service accounts that have cloud-platform scope and permissions granted via IAM Roles.
    email  = google_service_account.default.email
    scopes = ["cloud-platform"]
  }
}

Copy link
Collaborator

@turkenh turkenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ulucinar!
It is great to have generated examples for all resources 👍

Apart from the comment that I've added for using acronyms, I would like us to consider putting them in generated folder under examples, instead of examples-generated at the repo root.

@ulucinar
Copy link
Collaborator Author

ulucinar commented Jan 12, 2022

Thanks @ulucinar! It is great to have generated examples for all resources 👍

Apart from the comment that I've added for using acronyms, I would like us to consider putting them in generated folder under examples, instead of examples-generated at the repo root.

Thank you @turkenh. I've moved the generated examples under to examples/generated as you suggested. All lines are also commented out as suggested here.

@ulucinar ulucinar requested a review from turkenh January 12, 2022 03:27
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
Copy link
Collaborator

@turkenh turkenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ulucinar!
I personally wouldn't prefer to comment out all yaml given it is already mentioned to be generated and needs to be tweaked, but not a blocker.

@turkenh turkenh merged commit 8c75223 into crossplane-contrib:main Jan 18, 2022
@ulucinar ulucinar deleted the fix-48 branch January 18, 2022 10:41
@ulucinar
Copy link
Collaborator Author

Thanks @turkenh!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants