Skip to content

Commit 0c76c2d

Browse files
committed
adding READMEs to examples
1 parent 53577b0 commit 0c76c2d

File tree

3 files changed

+133
-0
lines changed

3 files changed

+133
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Additional IP addresses example
2+
3+
This example shows how to add additional IP addresses to the certifcate using the module.
4+
5+
```hcl
6+
terraform {
7+
required_version = ">= 0.12.31"
8+
required_providers {
9+
google = {
10+
version = "~> 3.69"
11+
}
12+
}
13+
}
14+
15+
provider "google" {
16+
project = var.project_id
17+
region = var.project_region
18+
}
19+
20+
data "google_project" "project" {}
21+
22+
resource "google_service_account" "test" {
23+
account_id = "test-account"
24+
}
25+
26+
resource "google_compute_address" "test" {
27+
name = "test-ip"
28+
address_type = "EXTERNAL"
29+
}
30+
31+
module "tls_cert" {
32+
source = "devops-rob/tls/gcp"
33+
34+
project_id = var.project_id
35+
region = var.project_region
36+
service_account_email = google_service_account.test.email
37+
tls_bucket = "test-tls-bucket"
38+
tls_cert_name = "devopsrob"
39+
40+
ip_addresses = [
41+
google_compute_address.test.address,
42+
"127.0.0.1",
43+
]
44+
}
45+
```
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Updated Certficate Authority example
2+
3+
This example shows how to specify the Certificate Authority subject in the module.
4+
5+
```hcl
6+
terraform {
7+
required_version = ">= 0.12.31"
8+
required_providers {
9+
google = {
10+
version = "~> 3.69"
11+
}
12+
}
13+
}
14+
15+
provider "google" {
16+
project = var.project_id
17+
region = var.project_region
18+
}
19+
20+
data "google_project" "project" {}
21+
22+
variable "project_id" {}
23+
variable "project_region" {}
24+
25+
resource "google_service_account" "test" {
26+
account_id = "test-account"
27+
}
28+
29+
module "tls_cert" {
30+
source = "devops-rob/tls/gcp"
31+
32+
project_id = var.project_id
33+
region = var.project_region
34+
service_account_email = google_service_account.test.email
35+
tls_bucket = "test-tls-bucket"
36+
tls_cert_name = "devopsrob"
37+
38+
tls_ca_subject = {
39+
common_name = "HashiCorp Inc. Root"
40+
organization = "HashiCorp, Inc"
41+
organizational_unit = "Department of Certificate Authority"
42+
street_address = ["123 Hashi Street"]
43+
locality = "The Internet"
44+
province = "London"
45+
country = "UK"
46+
postal_code = "SW1 2EG"
47+
}
48+
49+
}
50+
```

examples/minimal-example/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Minimal exmample
2+
3+
This example shows a minimal way of using the module with all of the default variavle values.
4+
5+
```hcl
6+
terraform {
7+
required_version = ">= 0.12.31"
8+
required_providers {
9+
google = {
10+
version = "~> 3.69"
11+
}
12+
}
13+
}
14+
15+
provider "google" {
16+
project = var.project_id
17+
region = var.project_region
18+
}
19+
20+
data "google_project" "project" {}
21+
22+
variable "project_id" {}
23+
variable "project_region" {}
24+
25+
resource "google_service_account" "test" {
26+
account_id = "test-account"
27+
}
28+
29+
module "tls_cert" {
30+
source = "devops-rob/tls/gcp"
31+
32+
project_id = var.project_id
33+
region = var.project_region
34+
service_account_email = google_service_account.test.email
35+
tls_bucket = "test-tls-bucket"
36+
tls_cert_name = "devopsrob"
37+
}
38+
```

0 commit comments

Comments
 (0)