Skip to content

Commit

Permalink
removing examples into starter github repos
Browse files Browse the repository at this point in the history
  • Loading branch information
tiny-dancer committed May 30, 2021
1 parent 7bc4cf5 commit f81af47
Show file tree
Hide file tree
Showing 27 changed files with 88 additions and 278 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ brew install optum/tap/runiac

Download the pre-compiled binaries from the [releases](https://github.com/Optum/runiac/releases) page and copy to the desired location.

## Tutorial
## Getting Started

For more detailed examples of runiac, be sure to check out the [examples](examples/) directory!
For more detailed examples of runiac, be sure to check out the [starters on github!](https://github.com/topics/runiac-starter)

## Using runiac

Expand Down
25 changes: 25 additions & 0 deletions cmd/cli/cmd/new_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package cmd

import (
"testing"

"github.com/stretchr/testify/require"
)

func TestNew(t *testing.T) {
tests := map[string]string{
"foobar": "foobar",
"foo()bar": "foo__bar",
"!234 Test": "_234_Test",
"!@#$%^&*()": "__________",
"trailing space ": "trailing_space",
"\nwhite space\n\t": "white_space",
"domain\\user": "domain_user",
}

for in, expected := range tests {
result := sanitizeMachineName(in)

require.Equal(t, expected, result, "sanitizeMachineName(\"%s\") = \"%s\"; want \"%s\"", in, result, expected)
}
}
53 changes: 0 additions & 53 deletions examples/arm-azure-hello-world/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions examples/arm-azure-hello-world/entrypoint.sh

This file was deleted.

4 changes: 0 additions & 4 deletions examples/arm-azure-hello-world/runiac.yml

This file was deleted.

63 changes: 0 additions & 63 deletions examples/arm-azure-hello-world/step1_default/main.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,10 @@ The following steps assume you are running on a Linux or macOS system, but the p
See the top-level README for information on obtaining these items:

- An Azure subscription
- Docker

## Running

If you did not clone this repository, you can have runiac scaffold a copy of this example by running:

```bash
runiac new --url github.com/optum/runiac//examples/terraform-azure-hello-world
```

Assuming you've set up your subscription and login credentials, you can execute runiac using the following command:

```bash
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project: azure-hello-world
primary_region: centralus
regional_regions: centralus
regional_regions: centralus,eastus,westus,uksouth,southeastasia
runner: terraform
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource azurerm_resource_group hub {
name = "${local.namespace-}rg-runiac-hub-${var.runiac_region}"
location = var.runiac_region
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
terraform {
backend "local" {
path = "default.tfstate"
path = "azure/${var.runiac_step}/terraform.tfstate"
workspace_dir = "/runiac/tfstate"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource "azurerm_resource_group" "spoke" {
name = "${local.namespace-}rg-runiac-spoke-${var.runiac_region}"
location = var.runiac_region
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Configure the Azure Provider
provider "azurerm" {
subscription_id = var.runiac_account_id
features {}
}

terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 2.58.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
locals {
namespace- = var.runiac_namespace == "" ? "" : "${var.runiac_namespace}-"
}

variable "runiac_account_id" {
type = string
}

variable "runiac_region" {
type = string
}

variable "runiac_environment" {
type = string
}

variable "runiac_namespace" {
type = string
}

variable "runiac_step" {
type = string
}

variable "runiac_primary_region" {
type = string
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ variable runiac_step {
type = string
}

variable resource_group {
variable runiac_step {
type = string
default = "rg-runiac-sample"
}

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions examples/terraform-azure-hello-world/step1_default/main.tf

This file was deleted.

2 changes: 0 additions & 2 deletions examples/terraform-gcp-hello-world/.gitignore

This file was deleted.

74 changes: 0 additions & 74 deletions examples/terraform-gcp-hello-world/README.md

This file was deleted.

12 changes: 0 additions & 12 deletions examples/terraform-gcp-hello-world/entrypoint.sh

This file was deleted.

4 changes: 0 additions & 4 deletions examples/terraform-gcp-hello-world/runiac.yml

This file was deleted.

6 changes: 0 additions & 6 deletions examples/terraform-gcp-hello-world/step1_default/main.tf

This file was deleted.

5 changes: 0 additions & 5 deletions examples/terraform-gcp-hello-world/step1_default/providers.tf

This file was deleted.

Loading

0 comments on commit f81af47

Please sign in to comment.