Skip to content

Commit

Permalink
working terraform vm plan
Browse files Browse the repository at this point in the history
  • Loading branch information
mcascone committed Feb 1, 2023
1 parent 4a3d9e9 commit 20fe0fc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.terraform/
.terraform.lock*
*.tfstate*
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<!-- spell:disable -->
<!-- markdownlint-disable MD033 -->

# This is a Work In Progress

* Currently running locally and auth'ing with `gcloud auth`:

```shell
❯ gc auth list
Credentialed Accounts
ACTIVE ACCOUNT
* [email protected]

To set the active account, run:
$ gcloud config set account `ACCOUNT`
```

# Docker to GCP VM

This is a [GitHub Action](https://github.com/features/actions) that can deploy any [Docker](https://www.bitovi.com/academy/learn-docker.html)-based app
Expand Down Expand Up @@ -39,7 +54,6 @@ You'll need to [enable authentication](https://cloud.google.com/docs/authenticat
## Environment variables

<!-- # TODO: clarify this -->
For environment variables in your app, you can provide:

* `repo_env` - A file in your repo that contains env vars
* `ghv_env` - An entry in [Github actions variables](https://docs.github.com/en/actions/learn-github-actions/variables)
Expand Down Expand Up @@ -130,7 +144,7 @@ The following inputs can be used as `step.with` keys
| `checkout` | Boolean | Set to `false` if the code is already checked out (Default is `true`) (Optional) |
| `gcp_access_key_id` | String | GCP access key ID |
| `gcp_default_region` | String | GCP default region |
| `gcp_ami_id` | String | GCP AMI ID. Will default to latest Ubuntu 22.04 server image (HVM). Accepts `ami-####` values |
| `gcp_image_id` | String | GCP Machine Image ID. Will default to latest Ubuntu 22.04 server image (HVM). Accepts `ami-####` values |
| `domain_name` | String | Define the root domain name for the application. e.g. bitovi.com' |
| `sub_domain` | String | Define the sub-domain part of the URL. Defaults to `${org}-${repo}-{branch}` |
| `root_domain` | Boolean | Deploy application to root domain. Will create root and www records. Defaults to `false` |
Expand Down
21 changes: 21 additions & 0 deletions gcp_instance_temp.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

# Create a VM instance from a public image
# in the `default` VPC network and subnet

resource "google_compute_instance" "tftest" {
project = "278540881566"
name = "my-vm"
machine_type = "n1-standard-1"
zone = "us-central1-a"

boot_disk {
initialize_params {
image = "ubuntu-minimal-2210-kinetic-amd64-v20230126"
}
}

network_interface {
network = "default"
access_config {}
}
}

0 comments on commit 20fe0fc

Please sign in to comment.