github.com/kubevela/workflow@v0.6.0/examples/workflow-run/apply-terraform-resource.yaml (about) 1 apiVersion: core.oam.dev/v1alpha1 2 kind: WorkflowRun 3 metadata: 4 name: apply-terraform-resource 5 namespace: default 6 spec: 7 workflowSpec: 8 steps: 9 - name: provider 10 type: apply-terraform-provider 11 properties: 12 type: alibaba 13 name: my-alibaba-provider 14 accessKey: <accessKey> 15 secretKey: <secretKey> 16 region: cn-hangzhou 17 - name: configuration 18 type: apply-terraform-config 19 properties: 20 source: 21 path: alibaba/cs/dedicated-kubernetes 22 remote: https://github.com/FogDong/terraform-modules 23 providerRef: 24 name: my-alibaba-provider 25 writeConnectionSecretToRef: 26 name: my-terraform-secret 27 namespace: vela-system 28 variable: 29 name: regular-check-ack 30 new_nat_gateway: true 31 vpc_name: "tf-k8s-vpc-regular-check" 32 vpc_cidr: "10.0.0.0/8" 33 vswitch_name_prefix: "tf-k8s-vsw-regualr-check" 34 vswitch_cidrs: [ "10.1.0.0/16", "10.2.0.0/16", "10.3.0.0/16" ] 35 k8s_name_prefix: "tf-k8s-regular-check" 36 k8s_version: 1.24.6-aliyun.1 37 k8s_pod_cidr: "192.168.5.0/24" 38 k8s_service_cidr: "192.168.2.0/24" 39 k8s_worker_number: 2 40 cpu_core_count: 4 41 memory_size: 8 42 tags: 43 created_by: "Terraform-of-KubeVela" 44 created_from: "module-tf-alicloud-ecs-instance" 45 - name: add-cluster 46 type: vela-cli 47 if: always 48 properties: 49 storage: 50 secret: 51 - name: secret-mount 52 secretName: my-terraform-secret 53 mountPath: /kubeconfig/ack 54 command: 55 - vela 56 - cluster 57 - join 58 - /kubeconfig/ack/KUBECONFIG 59 - --name=ack 60 - name: clean-cli-jobs 61 type: clean-jobs 62 properties: 63 namespace: vela-system 64 labelSelector: 65 "workflow.oam.dev/step-name": apply-terraform-resource-add-cluster 66 - name: distribute-config 67 type: apply-object 68 properties: 69 cluster: ack 70 value: 71 apiVersion: v1 72 kind: ConfigMap 73 metadata: 74 name: my-cm 75 namespace: default 76 data: 77 test-key: test-value