Terraform v0.12.4
- provider.google v2.10.0
How to:
Step 1. In GCP console, on the top right toolbar, click the Open Cloud Shell button.
Step 2. Clone the gsp303 repository from gitgub:
git clone https://github.com/neolin-cloudmile/gsp303.git
cd gsp303
Step 3. Setup the environment and install Terraform
./setup_terraform_and_cloud_shell.sh
Step 4. Go to the folder tfnet
cd tfnet
Step.5 Run Terraform, running this creation tasks approximately 3-5 minutes
terraform init
terraform fmt
terraform plan
terraform apply
Step 6. Verify resource created by Terraform
Step 7. Run terraform destroy to destroy the resource, this destroy tasks approximately 3-5 minutes
Reference:
Automating IIS Feature Installation with Powershell
https://weblog.west-wind.com/posts/2017/may/25/automating-iis-feature-installation-with-powershell
Google Cloud - Compute Engine
https://cloud.google.com/compute/docs/tutorials/basic-webserver-iis
Create a instance windows server:
gcloud compute instances create instance-win --image-family=windows-2016 --image-project=windows-cloud --zone=us-central1-a --scopes storage-ro --metadata windows-startup-script-url=gs://win-startup-scripts/setupserver.ps1
Check serial port outport of GCE:
gcloud compute instances get-serial-port-output my-instance --zone us-central1-a
Check GCS objects:
gsutil ls -r gs://win-startup-scripts/
Set a new user and get password from windows instances:
gcloud compute reset-windows-password vm-bastionhost --user app_admin --zone us-central1-a
Grant anyone on the internet READ access to the object example-object:
gsutil acl ch -u AllUsers:R gs://win-startup-scripts/startup.ps1
gsutil commands - acl
https://cloud.google.com/storage/docs/gsutil/commands/acl#ch-examples