Skip to content

Commit

Permalink
Merge pull request #110 from Peefy/feat-crossplane-xnetwork-kcl-function
Browse files Browse the repository at this point in the history
feat: upgrade crossplane kcl function to v0.0.2
  • Loading branch information
Peefy authored Jan 3, 2024
2 parents 8eab047 + 3ffd351 commit a9d4572
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 1 addition & 2 deletions crossplane-xnetwork-kcl-function/kcl.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[package]
name = "crossplane-xnetwork-kcl-function"
edition = "0.0.1"
version = "0.0.1"
version = "0.0.2"

6 changes: 5 additions & 1 deletion crossplane-xnetwork-kcl-function/main.k
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
id = option("params")?.oxr?.id or ""
# Get the XR spec fields
id = option("params")?.oxr?.spec.id or ""
# Render XR to crossplane managed resources
network_id_labels = {"networks.meta.fn.crossplane.io/network-id" = id} if id else {}
vpc = {
apiVersion = "ec2.aws.upbound.io/v1beta1"
kind = "VPC"
metadata.name = "vpc"
metadata.labels: network_id_labels
spec.forProvider = {
region = "eu-west-1"
Expand All @@ -14,6 +17,7 @@ vpc = {
gateway = {
apiVersion = "ec2.aws.upbound.io/v1beta1"
kind = "InternetGateway"
metadata.name = "gateway"
metadata.labels: network_id_labels
spec.forProvider = {
region = "eu-west-1"
Expand Down

0 comments on commit a9d4572

Please sign in to comment.