Deploy Mainframe Connector on Cloud Run

This page discusses how you can deploy Mainframe Connector on Cloud Run as a remote service using Terraform. You can then use the Mainframe Connector remote service to transcode, store, and export mainframe data on Google Cloud. You can trigger this service from your mainframe to perform remote transcoding, or as a standalone instance that is integrated with an existing extract, transfer, and load (ETL) workflow.

You can also deploy multiple instances of the Mainframe Connector remote service. For more information, see Deploy multiple instances of the Mainframe Connector.

To deploy Mainframe Connector on Cloud Run using Terraform, use the following steps:

  1. Download the Mainframe Connector deployment tar file to your local machine.

  2. Extract the files in the deployment tar file.

    tar -xvf ./deployment.tar
    

    The main.tf and vars.tf files are extracted from deployment tar file.

  3. Review and edit the variables in the vars.tf file. Most of the variables already have default values. The only mandatory variables you need to set are project and connector_service_account_email.

    • project: The Google Cloud project in which you want to install Mainframe Connector.
    • connector_service_account_email: The service account that has all the permissions for the operations you want to perform using Mainframe Connector.

    You can also set the network configuration using the connector_service_ingress and connector_service_vpc_access variables.

  4. Run the terraform init command with a Cloud Storage bucket and prefix as arguments. Using a Cloud Storage bucket and prefix helps you save the deployment state in the bucket. You can also reuse the same bucket and prefix when you upgrade Mainframe Connector.

    terraform init \
    -backend-config bucket=DEPLOYMENT_STATE_BUCKET \
    -backend-config prefix=BUCKET_PREFIX
    

    Replace the following:

    • DEPLOYMENT_STATE_BUCKET: The name of the Cloud Storage bucket.
    • BUCKET_PREFIX: The prefix that you want to use in the Cloud Storage bucket.
  5. Create a .tfvars file to define variables that you want Terraform to use during the Mainframe Connector deployment.

  6. Open the .tfvars file and define the following variables as key-value pairs.

    • instance_id: Define an instance_id to separate different workloads when you want to have multiple instances of Mainframe Connector, or to use different service accounts.
    • project: The project in which you want to deploy Mainframe Connector.
    • connector_service_ingress: The ingress type.
    • additional_labels: Additional labels if you want to test the deployment.
    • connector_service_account_email: The service account email ID of Mainframe Connector.

    Save your changes and close the file.

  7. Deploy Mainframe Connector.

    terraform apply -var-file=VARIABLE_FILE_NAME
    

    Replace VARIABLE_FILE_NAME with the variables file you created in the previous step.

  8. (Optional) To check if Mainframe Connector is deployed and running, go to the Cloud Run page, and select the Services tab. You should see your deployment listed in the table.

    Go to Cloud Run

Deploy multiple instances of the Mainframe Connector

To limit access for specific jobs, you might need to deploy multiple instances of the Mainframe Connector. You can do this by deploying the Mainframe Connector multiple times with different variables and service accounts. Since the Mainframe Connector remote service is based on Cloud Run, you will only be billed when each service is actually running. You also don't need to set up high availability (HA) as each instance is already load balanced and highly available.

What's next