Skip to content

Commit

Permalink
source path pointing to hashicorp regsitry
Browse files Browse the repository at this point in the history
  • Loading branch information
umarali-nagoor authored and hkantare committed Nov 26, 2020
1 parent 49effba commit 0c417e0
Show file tree
Hide file tree
Showing 24 changed files with 183 additions and 172 deletions.
46 changes: 27 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,52 @@ is [1.1.1][v1.1.1].
Full examples are in the [examples](./examples/) folder, but basic usage is as follows for creation of COS instance:

```hcl
provider "ibm" {
}
data "ibm_resource_group" "cos_group" {
name = "test"
name = var.resource_group
}
module "cos" {
source = "../../modules/cos_instance"
name = "testcos"
resource_group_id = data.ibm_resource_group.cos_group.id
plan = "testplan"
location = "testregion"
source = "terraform-ibm-modules/cos/ibm//modules/cos_instance"
service_name = var.service_name
resource_group_id = data.ibm_resource_group.cos_group.id
plan = var.plan
region = var.region
}
```

Creation of cloud object storage bucket:

```hcl
provider "ibm" {
}
data "ibm_resource_group" "cos_group" {
name = "test"
name = var.resource_group
}
module "cos" {
source = "../../modules/cos_instance"
name = "testcos"
resource_group_id = data.ibm_resource_group.cos_group.id
plan = "testplan"
location = "testregion"
source = "terraform-ibm-modules/cos/ibm//modules/cos_instance"
service_name = var.service_name
resource_group_id = data.ibm_resource_group.cos_group.id
plan = var.plan
region = var.region
}
module "cos_bucket" {
source = "../../modules/cos_bucket"
source = "terraform-ibm-modules/cos/ibm//modules/cos_bucket"
bucket_name = "testbucket"
resource_instance_id = module.cos.cos_instance_id
cross_region_location = "testlocation"
storage_class = "teststorage"
bucket_name = var.bucket_name
cos_instance_id = module.cos.cos_instance_id
location = var.location
storage_class = var.storage_class
}
```
Expand Down
27 changes: 16 additions & 11 deletions examples/cos_bucket/README.md → examples/bucket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,30 @@ This module is used to create a cloud object storage bucket

## Example Usage
```
provider "ibm" {
}
data "ibm_resource_group" "cos_group" {
name = var.resource_group
}
module "cos" {
source = "../../modules/cos_instance"
name = var.name
resource_group_id = data.ibm_resource_group.cos_group.id
plan = var.plan
location = var.region
source = "terraform-ibm-modules/cos/ibm//modules/cos_instance"
service_name = var.service_name
resource_group_id = data.ibm_resource_group.cos_group.id
plan = var.plan
region = var.region
}
module "cos_bucket" {
source = "../../modules/cos_bucket"
source = "terraform-ibm-modules/cos/ibm//modules/cos_bucket"
bucket_name = var.bucket_name
resource_instance_id = module.cos.cos_instance_id
cross_region_location = var.location
storage_class = var.storage_class
bucket_name = var.bucket_name
cos_instance_id = module.cos.cos_instance_id
location = var.location
storage_class = var.storage_class
}
```
Expand All @@ -42,3 +46,4 @@ module "cos_bucket" {
| region | Target location or environment to create the resource instance. | string | n/a | yes |
| resource\_group | Name of the resource group | string | n/a | yes |

## NOTE: If we want to make use of a particular version of module, then set the argument "version" to respective module version.
31 changes: 31 additions & 0 deletions examples/bucket/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#####################################################
# COS Bucket
# Copyright 2020 IBM
#####################################################

provider "ibm" {
}

data "ibm_resource_group" "cos_group" {
name = var.resource_group
}

module "cos" {

source = "terraform-ibm-modules/cos/ibm//modules/cos_instance"

service_name = var.service_name
resource_group_id = data.ibm_resource_group.cos_group.id
plan = var.plan
region = var.region
}

module "cos_bucket" {
source = "terraform-ibm-modules/cos/ibm//modules/cos_bucket"

bucket_name = var.bucket_name
cos_instance_id = module.cos.cos_instance_id
location = var.location
storage_class = var.storage_class

}
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion examples/cos_bucket/.terraform/modules/modules.json

This file was deleted.

3 changes: 0 additions & 3 deletions examples/cos_bucket/.terraform/plugins/darwin_amd64/lock.json

This file was deleted.

30 changes: 0 additions & 30 deletions examples/cos_bucket/main.tf

This file was deleted.

1 change: 0 additions & 1 deletion examples/cos_instance/.terraform/modules/modules.json

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,28 @@ This module is used to create a cloud object storage instance.

## Example Usage
```
provider "ibm" {
}
data "ibm_resource_group" "cos_group" {
name = var.resource_group
}
module "cos" {
source = "../../modules/cos_instance"
name = var.name
resource_group_id = data.ibm_resource_group.cos_group.id
plan = var.plan
location = var.location
source = "terraform-ibm-modules/cos/ibm//modules/cos_instance"
service_name = var.service_name
resource_group_id = data.ibm_resource_group.cos_group.id
plan = var.plan
region = var.region
}
```

## NOTE: If we want to make use of a particular version of module, then set the argument "version" to respective module version.


## Inputs

| Name | Description | Type | Default | Required |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ data "ibm_resource_group" "cos_group" {
}

module "cos" {
source = "../../modules/cos_instance"

service_name = var.service_name
resource_group_id = data.ibm_resource_group.cos_group.id
plan = var.plan
region = var.region

source = "terraform-ibm-modules/cos/ibm//modules/cos_instance"

service_name = var.service_name
resource_group_id = data.ibm_resource_group.cos_group.id
plan = var.plan
region = var.region
}
File renamed without changes.
File renamed without changes.
49 changes: 49 additions & 0 deletions modules/bucket/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Module cos_bucket

This module is used to create a cloud object storage bucket

## Example Usage
```
provider "ibm" {
}
data "ibm_resource_group" "cos_group" {
name = var.resource_group
}
module "cos" {
source = "terraform-ibm-modules/cos/ibm//modules/cos_instance"
service_name = var.service_name
resource_group_id = data.ibm_resource_group.cos_group.id
plan = var.plan
region = var.region
}
module "cos_bucket" {
source = "terraform-ibm-modules/cos/ibm//modules/cos_bucket"
bucket_name = var.bucket_name
cos_instance_id = module.cos.cos_instance_id
location = var.location
storage_class = var.storage_class
}
```

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs


| Name | Description | Type | Default | Required |
|-----------------|------------------------------------------------------------------|:-------|---------|----------|
| bucket\_name | Name of the bucket | string | n/a | yes |
| storage\_class | Storage class to use for the bucket | string | n/a | yes |
| location | The location of a regional bucket | string | n/a | no |
| name | A descriptive name used to identify the resource instance | string | n/a | yes |
| plan | The name of the plan type supported by service. | string | n/a | yes |
| region | Target location or environment to create the resource instance. | string | n/a | yes |
| resource\_group | Name of the resource group | string | n/a | yes |

## NOTE: If we want to make use of a particular version of module, then set the argument "version" to respective module version.
8 changes: 4 additions & 4 deletions modules/cos_bucket/main.tf → modules/bucket/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#####################################################

resource "ibm_cos_bucket" "testBucket" {
bucket_name = var.bucket_name
resource_instance_id = var.cos_instance_id
cross_region_location = var.location
storage_class = var.storage_class
bucket_name = var.bucket_name
resource_instance_id = var.cos_instance_id
cross_region_location = var.location
storage_class = var.storage_class
}
File renamed without changes.
File renamed without changes.
50 changes: 0 additions & 50 deletions modules/cos_bucket/README.md

This file was deleted.

Loading

0 comments on commit 0c417e0

Please sign in to comment.