Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Commit

Permalink
Merged in TER-281_update-ghost-provider-examples (pull request #18)
Browse files Browse the repository at this point in the history
TER-281: Update examples and readme

Approved-by: Jordan Caussat <[email protected]>
Approved-by: [email protected] <[email protected]>
Approved-by: PERRIER Aurélien <[email protected]>
Approved-by: Jérôme Respaut <[email protected]>
Approved-by: Patrick Decat <[email protected]>
Approved-by: Burak Karamahmut <[email protected]>
  • Loading branch information
Jordan Caussat committed Jun 6, 2018
2 parents 451d6f7 + 15439fc commit eacfaae
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 6 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ If you're building the provider, follow the instructions to [install it as a plu

Examples are available in the examples directory:

- `basic`: shows how to define a simple ghost application
- `full_app_model`: exposes all the configuration parameters available to create your cloud deploy app.
- `minimal_app_model`: shows the minimal configuration required to create a cloud deploy app.
- `basic_import`: shows how to ignore parameters during imports.
- `shared_modules_features`: shows how modules and features can be shared across ghost\_app resources using `locals`. It also shows how to write or import scripts.

Create a new Ghost App
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_import/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ provider "ghost" {
}

resource "ghost_app" "basic_import" {
// You can ignore parameters using lifecycle.ignore_changes meta-parameter
// You can ignore parameters using lifecycle.ignore_changes meta-parameter.
lifecycle {
ignore_changes = ["log_notifications", "safe_deployment"]
}
Expand Down
File renamed without changes.
13 changes: 9 additions & 4 deletions examples/basic/main.tf → examples/full_app_model/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ provider "ghost" {
endpoint = "https://localhost"
}

// This example exposes all the configuration parameters available to create
// your cloud deploy app.
resource "ghost_app" "basic" {
name = "wordpress"
env = "dev"
Expand All @@ -13,6 +15,8 @@ resource "ghost_app" "basic" {
instance_type = "t2.micro"
vpc_id = "vpc-1234567"

instance_monitoring = true

log_notifications = [
"[email protected]",
]
Expand All @@ -35,10 +39,11 @@ resource "ghost_app" "basic" {

optional_volumes = [
{
device_name = "/dev/xvdd"
volume_type = "gp2"
volume_size = 20
iops = 0
device_name = "/dev/xvdd"
volume_type = "gp2"
volume_size = 20
iops = 0
launch_block_device_mappings = true
},
]

Expand Down
1 change: 1 addition & 0 deletions examples/minimal_app_model/inputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
variable "password" {}
23 changes: 23 additions & 0 deletions examples/minimal_app_model/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
provider "ghost" {
user = "demo"
password = "${var.password}"
endpoint = "https://localhost"
}

// This example shows the minimal configuration required to create an app.
// Be aware that such a minimal configuration is not recommended for real usage.
resource "ghost_app" "basic" {
name = "wordpress"
env = "dev"
role = "webfront"
vpc_id = "vpc-1234567"

build_infos = {
subnet_id = "subnet-1234567"
source_ami = "ami-1234567"
}

environment_infos = {}

modules = []
}

0 comments on commit eacfaae

Please sign in to comment.