Skip to content

Commit

Permalink
Satellite Storage
Browse files Browse the repository at this point in the history
create & validate

create and validate

Read & Create Function

Satellite Config Terraform

satellite storage final

assignment-creation

read function

assignment

complete sat-storage

create changed

read changed

update & delete modified

review comments

regex changed

final changes

delete assignments param added

storage configuration final

add assignments to groups

data sources for config and assignment added

storage configuration enhancements

storage configuration design updated

storage configuration data source updated

storage configuration data source updated - 1

satellite-storage docs added

comments added

secrets updated
  • Loading branch information
aayushsss1 authored and aayushsss1 committed Aug 30, 2023
1 parent 5bc91f6 commit 36287bc
Show file tree
Hide file tree
Showing 27 changed files with 2,154 additions and 26 deletions.
66 changes: 48 additions & 18 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "go.mod|go.sum|.*.map|^.secrets.baseline$",
"lines": null
},
"generated_at": "2023-08-29T14:07:58Z",
"generated_at": "2023-08-30T11:57:03Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -552,31 +552,41 @@
"hashed_secret": "91199272d5d6a574a51722ca6f3d1148edb1a0e7",
"is_secret": false,
"is_verified": false,
"line_number": 94,
"line_number": 95,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "a8d42722d33725b90f8e5ca1ae8aed3edaac55bd",
"is_secret": false,
"is_verified": false,
"line_number": 109,
"line_number": 110,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "5f28e11957b762c5558d22b7ad9b15d822cb856a",
"is_secret": false,
"is_verified": false,
"line_number": 111,
"line_number": 112,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "c88488e962fe2062632f389e755794fc3c29ff0d",
"is_secret": false,
"is_verified": false,
"line_number": 112,
"line_number": 113,
"type": "Secret Keyword",
"verified_result": null
}
],
"examples/ibm-satellite/modules/configuration/README.md": [
{
"hashed_secret": "bf10dae7b89461df3fd3c48f86ec23543710e8cd",
"is_secret": false,
"is_verified": false,
"line_number": 67,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -826,15 +836,15 @@
"hashed_secret": "c8b6f5ef11b9223ac35a5663975a466ebe7ebba9",
"is_secret": false,
"is_verified": false,
"line_number": 1715,
"line_number": 1734,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "8abf4899c01104241510ba87685ad4de76b0c437",
"is_secret": false,
"is_verified": false,
"line_number": 1721,
"line_number": 1740,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -1116,7 +1126,7 @@
"hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4",
"is_secret": false,
"is_verified": false,
"line_number": 395,
"line_number": 400,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -1126,15 +1136,15 @@
"hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4",
"is_secret": false,
"is_verified": false,
"line_number": 218,
"line_number": 223,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "17f5f58d3d8d9871c52ab032989df3d810d2443e",
"is_secret": false,
"is_verified": false,
"line_number": 369,
"line_number": 378,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -1144,7 +1154,7 @@
"hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4",
"is_secret": false,
"is_verified": false,
"line_number": 444,
"line_number": 460,
"type": "Secret Keyword",
"verified_result": null
}
Expand All @@ -1154,15 +1164,15 @@
"hashed_secret": "3046d9f6cfaaeea6eed9bb7a4ab010fe49b0cfd4",
"is_secret": false,
"is_verified": false,
"line_number": 88,
"line_number": 189,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f",
"is_secret": false,
"is_verified": false,
"line_number": 451,
"line_number": 523,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -2847,6 +2857,16 @@
"verified_result": null
}
],
"ibm/service/satellite/resource_ibm_satellite_storage_configuration_test.go": [
{
"hashed_secret": "f32b67c7e26342af42efabc674d441dca0a281c5",
"is_secret": false,
"is_verified": false,
"line_number": 118,
"type": "Secret Keyword",
"verified_result": null
}
],
"ibm/service/schematics/data_source_ibm_schematics_action.go": [
{
"hashed_secret": "49f3bb8f759241df51c899d3725d877bad58f66e",
Expand Down Expand Up @@ -3790,15 +3810,15 @@
"hashed_secret": "d47dcacc720a39e236679ac3e311a0d58bb6519e",
"is_secret": false,
"is_verified": false,
"line_number": 223,
"line_number": 227,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "e66e7d67fdf3c596c435fc7828b13205e4950a0f",
"is_secret": false,
"is_verified": false,
"line_number": 225,
"line_number": 229,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -3844,15 +3864,15 @@
"hashed_secret": "d47dcacc720a39e236679ac3e311a0d58bb6519e",
"is_secret": false,
"is_verified": false,
"line_number": 148,
"line_number": 161,
"type": "Secret Keyword",
"verified_result": null
},
{
"hashed_secret": "e66e7d67fdf3c596c435fc7828b13205e4950a0f",
"is_secret": false,
"is_verified": false,
"line_number": 150,
"line_number": 163,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down Expand Up @@ -4721,6 +4741,16 @@
"verified_result": null
}
],
"website/docs/r/satellite_storage_configuration.html.markdown": [
{
"hashed_secret": "d4c3d66fd0c38547a3c7a4c6bdc29c36911bc030",
"is_secret": false,
"is_verified": false,
"line_number": 42,
"type": "Secret Keyword",
"verified_result": null
}
],
"website/docs/r/sm_arbitrary_secret.html.markdown": [
{
"hashed_secret": "d47dcacc720a39e236679ac3e311a0d58bb6519e",
Expand Down Expand Up @@ -5068,7 +5098,7 @@
}
]
},
"version": "0.13.1+ibm.47.dss",
"version": "0.13.1+ibm.61.dss",
"word_list": {
"file": null,
"hash": null
Expand Down
23 changes: 22 additions & 1 deletion examples/ibm-satellite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ This example uses below modules to set up the satellite location with IBM enviro
5. [satellite-route](modules/route) This module will create openshift route.
6. [satellite-endpoint](modules/endpoint) This module will create satellite endpoint.
7. [satellite-dns](modules/dns) This module will register public IPs to control plane & open-shit cluster subdomain DNS records.

8. [satellite-storage-configuration](modules/configuration) This module will create and manage storage configurations in your satellite location.
9. [satellite-storage-assignment](modules/assignment) This module will assign your storage configurations to clusters or cluster groups.

## Usage

Expand Down Expand Up @@ -115,6 +116,26 @@ module "satellite-endpoint" {
client_certificate = var.client_certificate
}
module "satellite-storage-configuration" {
source = "./modules/configuration"
location = var.location
config_name = var.config_name
storage_template_name = var.storage_template_name
storage_template_version = var.storage_template_version
user_config_parameters = var.user_config_parameters
user_secret_parameters = var.user_secret_parameters
storage_class_parameters = var.storage_class_parameters
}
module "satellite-storage-assignment"{
source = "./modules/assignment"
assignment_name = var.assignment_name
cluster = var.cluster
config = var.config
controller = var.controller
}
```

## Note
Expand Down
8 changes: 8 additions & 0 deletions examples/ibm-satellite/assignment.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module "satellite-storage-assignment"{
source = "./modules/assignment"

assignment_name = var.assignment_name
cluster = var.cluster
config = var.config
controller = var.controller
}
11 changes: 11 additions & 0 deletions examples/ibm-satellite/configuration.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module "satellite-storage-configuration" {
source = "./modules/configuration"

location = var.location
config_name = var.config_name
storage_template_name = var.storage_template_name
storage_template_version = var.storage_template_version
user_config_parameters = var.user_config_parameters
user_secret_parameters = var.user_secret_parameters
storage_class_parameters = var.storage_class_parameters
}
85 changes: 85 additions & 0 deletions examples/ibm-satellite/modules/assignment/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# This Module is used to create satellite storage assignment

This module creates a `satellite storage assignment` based on a storage template of your choice. For more information on storage templates and their parameters refer -> https://cloud.ibm.com/docs/satellite?topic=satellite-storage-template-ov&interface=ui

## Prerequisite

* Set up the IBM Cloud command line interface (CLI), the Satellite plug-in, and other related CLIs.
* Install cli and plugin package
```console
ibmcloud plugin install container-service
```
## Usage

```
terraform init
```
```
terraform plan
```
```
terraform apply
```
```
terraform destroy
```
## Example Usage

``` hcl
module "satellite-storage-assignment" {
assignment_name = var.assignment_name
cluster = var.cluster
config = var.config
controller = var.controller
}
```

### Assigning a Configuration to a cluster
```hcl
resource "ibm_satellite_storage_assignment" "odf_assignment" {
assignment_name = var.assignment_name
config = var.config
cluster = var.cluster
controller = var.controller
}
```

### Assigning a Configuration to Cluster Groups
```hcl
resource "ibm_satellite_storage_assignment" "odf_assignment" {
assignment_name = var.assignment_name
config = var.config
groups = var.groups
}
```

### Updating the Configuration Revision to a cluster
```hcl
resource "ibm_satellite_storage_assignment" "odf_assignment" {
assignment_name = var.assignment_name
config = var.config
cluster = var.cluster
controller = var.controller
update_config_revision = true
}
```

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

| Name | Description | Type | Required |
|------|-------------|------|---------|
| ibmcloud\_api\_key | IBM Cloud API key | `string` | true |
| assignment_name | Name of the Assignment. | `string` | true |
| groups | One or more cluster groups on which you want to apply the configuration. Note that at least one cluster group is required. | `list[string]` | true |
| cluster | ID of the Satellite cluster or Service Cluster that you want to apply the configuration to. | `string` | true |
| config | Storage Configuration Name or ID. | `string` | true |
| controller | The Name or ID of the Satellite Location. | `string` | true |
| update_config_revision | Update an assignment to the latest available storage configuration version. | `bool` | false |

## Note
* You cannot use the `groups` argument with `cluster` & `controller`, this is applicable when creating assignments to cluster groups.
* Similarly `cluster` & `controller` are to be used together and cannot be used with `groups`, this is applicable when creating assignments to clusters.


<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
7 changes: 7 additions & 0 deletions examples/ibm-satellite/modules/assignment/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Provision satellite_storage_assignment resource instance
resource "ibm_satellite_storage_assignment" "instance" {
assignment_name = var.assignment_name
cluster = var.cluster
config = var.config
controller = var.controller
}
7 changes: 7 additions & 0 deletions examples/ibm-satellite/modules/assignment/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
required_providers {
ibm = {
source = "ibm-cloud/ibm"
}
}
}
Loading

0 comments on commit 36287bc

Please sign in to comment.