This module handles opinionated SAP HANA SVPC configuration and deployment.
The resources/services/activations/deletions that this module will create/trigger are:
- Create a Compute Instance that will host SAP HANA SVPC
- Create a Static IP Adresse for the Compute Instance
- Create a 2 Persistent Disks to host SAP HANA's File systems
You can go in the examples folder complete working example. However, here's an example of how to use the module in a main.tf file.
module "gcp_sap_hana_svpc_with_network" {
source = "../../modules/sap_hana_svpc_with_network"
subnetwork = "${var.subnetwork}"
linux_image_family = "${var.linux_image_family}"
linux_image_project = "${var.linux_image_project}"
instance_name = "${var.instance_name}"
instance_type = "${var.instance_type}"
description = "${var.description}"
network = "${var.network}"
host_project_id = "${var.host_project_id}"
project_id = "${var.project_id}"
region = "${var.region}"
zone = "${var.zone}"
service_account_email = "${var.service_account_email}"
boot_disk_type = "${var.boot_disk_type}"
boot_disk_size = "${var.boot_disk_size}"
autodelete_disk = "true"
pd_ssd_size = "${var.pd_ssd_size}"
pd_hdd_size = "${var.pd_hdd_size}"
disk_name_0 = "${var.disk_name_0}"
disk_name_1 = "${var.disk_name_1}"
sap_hana_deployment_bucket = "${var.sap_hana_deployment_bucket}"
sap_deployment_debug = "false"
post_deployment_script = "${var.post_deployment_script}"
sap_hana_sid = "${var.sap_hana_sid}"
sap_hana_instance_number = "${var.sap_hana_instance_number}"
sap_hana_sidadm_password = "${var.sap_hana_sidadm_password}"
sap_hana_system_password = "${var.sap_hana_system_password}"
network_tags = "${var.network_tags}"
sap_hana_sidadm_uid = 900
sap_hana_sapsys_gid = 900
address_name = "${var.address_name}"
priority = "${var.priority}"
route_destination_range = "${var.route_destination_range}"
route_tags = "${var.route_tags}"
ip_cidr_range = "${var.ip_cidr_range}"
}
Make sure you've gone through the root Requirement Section
Follow instructions here to properly Download SAP HANA from the SAP Marketplace, and upload it to a GCS bucket.
The compute instance created by this submodule will need to download SAP HANA from a GCS bucket in order install it. Follow the instructions below to ensure a successful installation:
- Create a new service account
- Grant this new service account the following permissions on the bucket where you uploaded SAP HANA installation file:
- Storage Object Viewer:
roles/storage.objectViewer
- Storage Object Viewer:
You may use the following gcloud command:
gcloud projects add-iam-policy-binding <project-id> --member=serviceAccount:<service-account-email> --role=roles/storage.objectViewer
- When configuring the module, use this newly created service account's email, to set the
service_account_email
input variable.
If you need to run a post deployment script, the script needs to be accessible via a https:// or gs:// URl. The recommended way is to use a GCS Bucket in the following way.:
-
Upload the post-deployment-script to a GCS bucket.
-
Grant the following role on the bucket to the service account attached to the instance if the bucket is not in the same project as the service account:
- Storage Object Viewer:
roles/storage.objectViewer
- Storage Object Viewer:
-
Set the value of the
post_deployment_script
input to the URI of the post-deployment script storage bucket object, likegs://<bucket_name>/<script_name>
.
Name | Description | Type | Default | Required |
---|---|---|---|---|
address_name | Name of static IP adress to add to the instance's access config. | string | n/a | yes |
autodelete_disk | Whether the disk will be auto-deleted when the instance is deleted. | string | "false" |
no |
boot_disk_size | Root disk size in GB. | string | n/a | yes |
boot_disk_type | The GCE boot disk type. May be set to pd-standard (for PD HDD) or pd-ssd. | string | n/a | yes |
device_name_pd_hdd | device name for standard persistant disk | string | "backup" |
no |
device_name_pd_ssd | device name for ssd persistant disk | string | "pdssd" |
no |
disk_name_0 | Name of first disk. | string | "sap-hana-pd-sd-0" |
no |
disk_name_1 | Name of second disk. | string | "sap-hana-pd-sd-1" |
no |
disk_type_0 | The GCE data disk type. May be set to pd-ssd. | string | "pd-ssd" |
no |
disk_type_1 | The GCE data disk type. May be set to pd-standard (for PD HDD). | string | "pd-standard" |
no |
instance_name | A unique name for the resource, required by GCE. Changing this forces a new resource to be created. | string | n/a | yes |
instance_type | The GCE instance/machine type. | string | n/a | yes |
linux_image_family | GCE image family. | string | n/a | yes |
linux_image_project | Project name containing the linux image. | string | n/a | yes |
network_tags | List of network tags to attach to the instance. | list | n/a | yes |
pd_hdd_size | Persistent disk size in GB. | string | "" |
no |
pd_ssd_size | Persistent disk size in GB. | string | "" |
no |
post_deployment_script | SAP HANA post deployment script. Must be a gs:// or https:// link to the script. | string | "" |
no |
project_id | The ID of the project in which the resources will be deployed. | string | n/a | yes |
region | Region to deploy the resources. Should be in the same region as the zone. | string | n/a | yes |
sap_deployment_debug | Debug flag for SAP HANA deployment. | string | "false" |
no |
sap_hana_deployment_bucket | SAP hana deployment bucket. | string | n/a | yes |
sap_hana_instance_number | SAP HANA instance number | string | n/a | yes |
sap_hana_sapsys_gid | SAP HANA SAP System GID | string | n/a | yes |
sap_hana_sid | SAP HANA System Identifier. When using the SID to enter a user session, like this for example, su - [SID]adm , make sure that [SID] is in lower case. |
string | n/a | yes |
sap_hana_sidadm_password | SAP HANA System Identifier Admin password | string | n/a | yes |
sap_hana_sidadm_uid | SAP HANA System Identifier Admin UID | string | n/a | yes |
sap_hana_system_password | SAP HANA system password | string | n/a | yes |
service_account_email | Email of service account to attach to the instance. | string | n/a | yes |
startup_script | Startup script to install SAP HANA. | string | n/a | yes |
subnetwork | The name or self_link of the subnetwork where the isntance will be deployed. The subnetwork must exist in the same region this instance will be created in. | string | n/a | yes |
zone | The zone that the instance should be created in. | string | n/a | yes |
Name | Description |
---|---|
instance_name | |
machine_type | |
zone |