github.com/kubevela/workflow@v0.6.0/charts/vela-workflow/templates/definitions/apply-terraform-config.yaml (about)

     1  # Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
     2  # Definition source cue file: vela-templates/definitions/internal/apply-terraform-config.cue
     3  apiVersion: core.oam.dev/v1beta1
     4  kind: WorkflowStepDefinition
     5  metadata:
     6    annotations:
     7      definition.oam.dev/alias: ""
     8      definition.oam.dev/description: Apply terraform configuration in the step
     9      definition.oam.dev/example-url: https://raw.githubusercontent.com/kubevela/workflow/main/examples/workflow-run/apply-terraform-resource.yaml
    10    name: apply-terraform-config
    11    namespace: {{ include "systemDefinitionNamespace" . }}
    12  spec:
    13    schematic:
    14      cue:
    15        template: |
    16          import (
    17          	"vela/op"
    18          )
    19  
    20          apply: op.#Apply & {
    21          	value: {
    22          		apiVersion: "terraform.core.oam.dev/v1beta2"
    23          		kind:       "Configuration"
    24          		metadata: {
    25          			name:      "\(context.name)-\(context.stepName)"
    26          			namespace: context.namespace
    27          		}
    28          		spec: {
    29          			deleteResource: parameter.deleteResource
    30          			variable:       parameter.variable
    31          			forceDelete:    parameter.forceDelete
    32          			if parameter.source.path != _|_ {
    33          				path: parameter.source.path
    34          			}
    35          			if parameter.source.remote != _|_ {
    36          				remote: parameter.source.remote
    37          			}
    38          			if parameter.source.hcl != _|_ {
    39          				hcl: parameter.source.hcl
    40          			}
    41          			if parameter.providerRef != _|_ {
    42          				providerRef: parameter.providerRef
    43          			}
    44          			if parameter.jobEnv != _|_ {
    45          				jobEnv: parameter.jobEnv
    46          			}
    47          			if parameter.writeConnectionSecretToRef != _|_ {
    48          				writeConnectionSecretToRef: parameter.writeConnectionSecretToRef
    49          			}
    50          			if parameter.region != _|_ {
    51          				region: parameter.region
    52          			}
    53          		}
    54          	}
    55          }
    56          check: op.#ConditionalWait & {
    57          	continue: apply.value.status != _|_ && apply.value.status.apply != _|_ && apply.value.status.apply.state == "Available"
    58          }
    59          parameter: {
    60          	// +usage=specify the source of the terraform configuration
    61          	source: close({
    62          		// +usage=directly specify the hcl of the terraform configuration
    63          		hcl: string
    64          	}) | close({
    65          		// +usage=specify the remote url of the terraform configuration
    66          		remote: *"https://github.com/kubevela-contrib/terraform-modules.git" | string
    67          		// +usage=specify the path of the terraform configuration
    68          		path?: string
    69          	})
    70          	// +usage=whether to delete resource
    71          	deleteResource: *true | bool
    72          	// +usage=the variable in the configuration
    73          	variable: {...}
    74          	// +usage=this specifies the namespace and name of a secret to which any connection details for this managed resource should be written.
    75          	writeConnectionSecretToRef?: {
    76          		name:      string
    77          		namespace: *context.namespace | string
    78          	}
    79          	// +usage=providerRef specifies the reference to Provider
    80          	providerRef?: {
    81          		name:      string
    82          		namespace: *context.namespace | string
    83          	}
    84          	// +usage=region is cloud provider's region. It will override the region in the region field of providerRef
    85          	region?: string
    86          	// +usage=the envs for job
    87          	jobEnv?: {...}
    88          	// +usae=forceDelete will force delete Configuration no matter which state it is or whether it has provisioned some resources
    89          	forceDelete: *false | bool
    90          }
    91