generated from terraform-ibm-modules/terraform-ibm-module-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:
enable_log_archive
variable has been replace by `log_analysis…
…_enable_archive` and `activity_tracker_enable_archive` variables<br> - fixed some bugs related to using existing resources (#93)
- Loading branch information
1 parent
53d37fe
commit 25e36fb
Showing
9 changed files
with
248 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The terraform code in this directory is used by the existing resource test in tests/pr_test.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
############################################################################## | ||
# Resource Group | ||
############################################################################## | ||
|
||
module "resource_group" { | ||
source = "terraform-ibm-modules/resource-group/ibm" | ||
version = "1.1.5" | ||
# if an existing resource group is not set (null) create a new one using prefix | ||
resource_group_name = var.resource_group == null ? "${var.prefix}-resource-group" : null | ||
existing_resource_group_name = var.resource_group | ||
} | ||
|
||
############################################################################## | ||
# Create Cloud Object Storage instance and buckets | ||
############################################################################## | ||
|
||
module "cos" { | ||
source = "terraform-ibm-modules/cos/ibm" | ||
version = "8.2.13" | ||
resource_group_id = module.resource_group.resource_group_id | ||
region = var.region | ||
cos_instance_name = "${var.prefix}-cos" | ||
cos_tags = var.resource_tags | ||
bucket_name = "${var.prefix}-bucket" | ||
retention_enabled = false # disable retention for test environments - enable for stage/prod | ||
kms_encryption_enabled = false | ||
} | ||
|
||
module "additional_cos_bucket" { | ||
source = "terraform-ibm-modules/cos/ibm" | ||
version = "8.2.13" | ||
region = var.region | ||
create_cos_instance = false | ||
existing_cos_instance_id = module.cos.cos_instance_id | ||
bucket_name = "${var.prefix}-bucket-at" | ||
kms_encryption_enabled = false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
############################################################################## | ||
# Outputs | ||
############################################################################## | ||
|
||
output "resource_group_name" { | ||
description = "Resource group name" | ||
value = module.resource_group.resource_group_name | ||
} | ||
|
||
output "prefix" { | ||
description = "Prefix" | ||
value = var.prefix | ||
} | ||
|
||
output "cos_crn" { | ||
description = "COS CRN" | ||
value = module.cos.cos_instance_crn | ||
} | ||
|
||
output "bucket_name" { | ||
description = "Log Archive bucket name" | ||
value = module.cos.bucket_name | ||
} | ||
|
||
output "bucket_name_at" { | ||
description = "Activity Tracker bucket name" | ||
value = module.additional_cos_bucket.bucket_name | ||
} | ||
|
||
output "bucket_endpoint" { | ||
description = "Log Archive bucket endpoint" | ||
value = module.cos.s3_endpoint_public | ||
} | ||
|
||
output "bucket_endpoint_at" { | ||
description = "Activity Tracker bucket endpoint" | ||
value = module.additional_cos_bucket.s3_endpoint_public | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
provider "ibm" { | ||
ibmcloud_api_key = var.ibmcloud_api_key | ||
region = var.region | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
############################################################################## | ||
# Input variables | ||
############################################################################## | ||
|
||
variable "ibmcloud_api_key" { | ||
type = string | ||
description = "The IBM Cloud API Key" | ||
sensitive = true | ||
} | ||
|
||
variable "region" { | ||
type = string | ||
description = "Region" | ||
} | ||
|
||
variable "prefix" { | ||
type = string | ||
description = "The prefix to add to all resources." | ||
} | ||
|
||
variable "resource_group" { | ||
type = string | ||
description = "The name of an existing resource group to provision resources in. If not specified, a new resource group is created with the `prefix` variable." | ||
default = null | ||
} | ||
|
||
variable "resource_tags" { | ||
type = list(string) | ||
description = "The tags to add to the created resources." | ||
default = [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
terraform { | ||
required_version = ">= 1.3.0" | ||
required_providers { | ||
ibm = { | ||
source = "ibm-cloud/ibm" | ||
version = ">= 1.51.0" | ||
} | ||
} | ||
} |