This module handles opinionated SAP APP DR SVPC configuration and deployment.
The resources/services/activations/deletions that this module will create/trigger are:
- Create a Compute Instance that whill host SAP HANA
- Create a Static IP Adresse for the Compute Instance
- Create a 2 Persistent Disks to host SAP App Dr'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_app_dr_svpc" {
source = "../../modules/sap_app_dr_svpc"
subnetwork = "${var.subnetwork}"
instance_name = "${var.instance_name}"
instance_type = "${var.instance_type}"
project_id = "${var.project_id}"
subnetwork_project = "${var.subnetwork_project}"
region = "${var.region}"
service_account_email = "${var.service_account_email}"
address_name = "${var.address_name}"
zone_1 = "${var.zone_1}"
zone_2 = "${var.zone_2}"
usc_class = "${var.usc_class}"
scs_user = "${var.scs_user}"
sap_user = "${var.sap_user}"
network_tags = "${var.network_tags}"
disk_type = "${var.disk_type}"
pd_ssd_size = "${var.pd_ssd_size}"
snapshot_name_0 = "${var.snapshot_name_0}"
snapshot_name_1 = "${var.snapshot_name_1}"
snapshot_name_2 = "${var.snapshot_name_2}"
source_disk_0 = "${var.source_disk_0}"
source_disk_1 = "${var.source_disk_1}"
source_disk_2 = "${var.source_disk_2}"
}
Make sure you've gone through the root Requirement Section
The compute instance created by this submodule will need to download SAP APP DRfrom 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 APP DRinstallation 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 |
disk_type | The GCE data disk type. May be set to pd-standard (for PD HDD) or pd-ssd. | string | n/a | yes |
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 |
network_tags | List of network tags to attach to the instance. | list | n/a | yes |
pd_ssd_size | Persistent disk size in GB | 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_user | Second disk created from snapshot | string | n/a | yes |
scs_user | Third disk created from snapshot | string | n/a | yes |
service_account_email | Email of service account to attach to the instance. | string | n/a | yes |
snapshot_name_0 | First Snapshot name | string | n/a | yes |
snapshot_name_1 | Second Snapshot name | string | n/a | yes |
snapshot_name_2 | Third Snapshot name | string | n/a | yes |
source_disk_0 | First Source Disk | string | n/a | yes |
source_disk_1 | Second Source Disk | string | n/a | yes |
source_disk_2 | Third Source Disk | 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 |
usc_class | First disk created from snapshot | string | n/a | yes |
zone_1 | The zone that the instance should be created in. | string | n/a | yes |
zone_2 | The zone that the instance should be created in. | string | n/a | yes |
Name | Description |
---|---|
instance_name | Name of instance |
zone_1 | Compute Engine instance deployment zone |
zone_2 | Compute Engine instance deployment zone |