Skip to content

Commit

Permalink
feat: remove RestAPI as required provider (#193)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: restapi provider configuration no longer required to run module

IMPORTANT: If you are upgrading to this version, ensure that you only upgrade from a version >= v3.1.0 to prevent your instance from being destroyed.
  • Loading branch information
MatthewLemmond authored Feb 21, 2023
1 parent c946a25 commit 9f0764f
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 72 deletions.
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "go.sum|^.secrets.baseline$",
"lines": null
},
"generated_at": "2022-12-29T22:58:13Z",
"generated_at": "2023-02-20T17:28:12Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -82,7 +82,7 @@
"hashed_secret": "ff9ee043d85595eb255c05dfe32ece02a53efbb2",
"is_secret": false,
"is_verified": false,
"line_number": 46,
"line_number": 44,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down
19 changes: 0 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,12 @@ One emerging pattern is to create one Key Protect instance per VPC. All workload

## Usage

Although the restapi provider is currently a required provider for this module, it is no longer used for any function within the module. It will be removed in the next major version release of this module.

```hcl
provider "ibm" {
ibmcloud_api_key = "XXXXXXXXXX"
region = "us-south"
}
# Retrieve IAM access token (required for restapi provider)
data "ibm_iam_auth_token" "token_data" {
}
provider "restapi" {
uri = "https:"
write_returns_object = false
create_returns_object = false
debug = false
headers = {
Authorization = data.ibm_iam_auth_token.token_data.iam_access_token
Bluemix-Instance = module.key_protect_module.key_protect_guid
Content-Type = "application/vnd.ibm.kms.policy+json"
}
}
module "key_protect_all_inclusive" {
# Replace "main" with a GIT release version to lock into a specific release
source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-key-protect-all-inclusive.git?ref=main"
Expand Down Expand Up @@ -100,7 +82,6 @@ You need the following permissions to run this module.
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.49.0 |
| <a name="requirement_restapi"></a> [restapi](#requirement\_restapi) | >= 1.18.0 |

## Modules

Expand Down
16 changes: 0 additions & 16 deletions examples/default/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,3 @@ provider "ibm" {
ibmcloud_api_key = var.ibmcloud_api_key
region = var.region
}

# Retrieve IAM access token (required for restapi provider)
data "ibm_iam_auth_token" "token_data" {
}

provider "restapi" {
uri = "https:"
write_returns_object = false
create_returns_object = false
debug = false # set to true to show detailed logs, but use carefully as it might print sensitive values.
headers = {
Authorization = data.ibm_iam_auth_token.token_data.iam_access_token
Bluemix-Instance = module.key_protect_all_inclusive.key_protect_guid
Content-Type = "application/vnd.ibm.kms.policy+json"
}
}
4 changes: 0 additions & 4 deletions examples/default/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@ terraform {
source = "IBM-Cloud/ibm"
version = "1.49.0"
}
restapi = {
source = "Mastercard/restapi"
version = "1.18.0"
}
}
}
15 changes: 0 additions & 15 deletions examples/existing-resources/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,3 @@ provider "ibm" {
ibmcloud_api_key = var.ibmcloud_api_key
region = var.region
}

data "ibm_iam_auth_token" "token_data" {
}

provider "restapi" {
uri = "https:"
write_returns_object = false
create_returns_object = false
debug = false # set to true to show detailed logs, but use carefully as it might print sensitive values.
headers = {
Authorization = data.ibm_iam_auth_token.token_data.iam_access_token
Bluemix-Instance = module.existing_key_protect.key_protect_guid
Content-Type = "application/vnd.ibm.kms.policy+json"
}
}
4 changes: 0 additions & 4 deletions examples/existing-resources/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@ terraform {
source = "IBM-Cloud/ibm"
version = "1.49.0"
}
restapi = {
source = "Mastercard/restapi"
version = "1.18.0"
}
}
}
6 changes: 0 additions & 6 deletions module-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,6 @@
"version_constraints": [
"\u003e= 1.49.0"
]
},
"restapi": {
"source": "Mastercard/restapi",
"version_constraints": [
"\u003e= 1.18.0"
]
}
},
"managed_resources": {},
Expand Down
6 changes: 0 additions & 6 deletions version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,5 @@ terraform {
source = "IBM-Cloud/ibm"
version = ">= 1.49.0"
}
# ignore linter error - include providers required by all child modules
# tflint-ignore: terraform_unused_required_providers
restapi = {
source = "Mastercard/restapi"
version = ">= 1.18.0"
}
}
}

0 comments on commit 9f0764f

Please sign in to comment.