Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…der-ibm into vmrm
  • Loading branch information
michaelkad committed Feb 13, 2024
2 parents f2750ab + 458df8e commit e6b0b95
Show file tree
Hide file tree
Showing 187 changed files with 3,729 additions and 4,595 deletions.
188 changes: 61 additions & 127 deletions .secrets.baseline

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
# 1.62.0 (Jan 30, 2024)
Features
* Support for Power Virtual Instance
- **Datasources**
- ibm_pi_volume_clone
- **Resources**
- ibm_pi_volume_clone
Enhancements
* Support security groups for Kuberentes workers ([4953](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4953))
* Support service_subnet, pod_subnet for Satellite location ([4953](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4953))
* Add resource instance sample config code part in the website doc ([5023](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5023))
* fix(vpc-routing-table): support removing of advertise routes and accept routes from array ([5039](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5039))
* support parameters for resource instance datasource ([5065](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5065))
* remove forcenew from workerpool fields in cluster resource and added ApplyOnce ([4955](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4955))
* SM fixes ([5045](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5045))
* Terraform support for ICD isolated compute and multitenant cores ([4628](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4628))
* Refactor Cloud connection refactor data source and documentation ([5053](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5053))
* support empty lists for CBR rule contexts and zone addresses ([5058](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5058))
* fix(IAM Policy Management): Add operator support to subject_attributes in Authorziation Policy ([5076](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5076))
* fix(routing-table-route) - fix routing table route advertise patch and action ([5069](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5069))
* encode test ids as constants for easy replacement ([5059](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5059))
* Adding the fix for cos deletion access denied issue ([5083](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5083))
* fix: fixed name update issue on is_instance boot_volume ([5084](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5084))

BugFixes
* CD scc doc updates ([4984](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/4984))
* Fix mtu requirement bug ([5027](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5027))
* listing all the connection for transit gateway over the pagination set ([5033](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5033))
* Projects issue #2672 - "Terraform sees inputs as changed ([5042](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5033))
* added a nil check on data source of bm servers ([5062](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5062))
* Soft remove the datasources for secretManager v1 ([5063](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5063))
* Schematics agent related fixes for GA ([5041](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5041))
* SM docs fix ([5080](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5080))

# 1.62.0-beta0 (Jan 21, 2024)
Features
* Support for Power Virtual Instance
Expand Down
58 changes: 58 additions & 0 deletions examples/ibm-openpages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# OpenPages example

This example shows 1 usage scenario.

#### Scenario 1: Create an OpenPages service instance.

```terraform
resource "ibm_resource_instance" "openpages_instance" {
name = "terraform-automation"
service = "openpages"
plan = "essentials"
location = "global"
resource_group_id = data.ibm_resource_group.default_group.id
parameters_json = <<EOF
{
"aws_region": "us-east-1",
"baseCurrency": "USD",
"initialContentType": "_no_samples",
"selectedSolutions": ["ORM"]
}
EOF
timeouts {
create = "200m"
}
}
To provison your instance with the correct configuration, update the `parameters_json` field with the appropriate values.
```

## Dependencies

- The owner of the `ibmcloud_api_key` has permission to create an OpenPages instance under the specified resource group.

## Configuration

- `ibmcloud_api_key` - An API key for IBM Cloud services. If you don't have one already, go to https://cloud.ibm.com/iam/#/apikeys and create a new key.

## Running the configuration

For the planning phase

```bash
terraform init
terraform plan
```

For the apply phase

```bash
terraform apply
```

For the destroy

```bash
terraform destroy
```
23 changes: 23 additions & 0 deletions examples/ibm-openpages/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
data "ibm_resource_group" "default_group" {
is_default = true
}

resource "ibm_resource_instance" "openpages_instance" {
name = "terraform-automation"
service = "openpages"
plan = "essentials"
location = "global"
resource_group_id = data.ibm_resource_group.default_group.id
parameters_json = <<EOF
{
"aws_region": "us-east-1",
"baseCurrency": "USD",
"initialContentType": "_no_samples",
"selectedSolutions": ["ORM"]
}
EOF

timeouts {
create = "200m"
}
}
4 changes: 4 additions & 0 deletions examples/ibm-openpages/provider.tf
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
}
4 changes: 4 additions & 0 deletions examples/ibm-openpages/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Enter your IBM Cloud API Key. If you don't have one already, go to IBM Cloud to get an API Key: https://cloud.ibm.com/iam#/apikeys
# Use the global region
ibmcloud_api_key = ""
region = "global"
10 changes: 10 additions & 0 deletions examples/ibm-openpages/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
variable "ibmcloud_api_key" {
description = "IBM Cloud API key"
type = string
}

variable "region" {
description = "Region"
type = string
default = "global"
}
7 changes: 7 additions & 0 deletions examples/ibm-openpages/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm",
}
}
}
4 changes: 2 additions & 2 deletions examples/ibm-project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ provider "ibm" {

// Provision project_config resource instance
resource "ibm_project_config" "project_config_instance" {
project_id = ibm_project.project_instance.project_id
project_id = ibm_project.project_instance.id
definition {
name = "static-website-dev"
description = "Website - development"
Expand Down Expand Up @@ -32,7 +32,7 @@ resource "ibm_project" "project_instance" {

// Provision project_environment resource instance
resource "ibm_project_environment" "project_environment_instance" {
project_id = ibm_project.project_instance.project_id
project_id = ibm_project.project_instance.id
definition {
name = "environment-stage"
description = "environment for stage project"
Expand Down
14 changes: 0 additions & 14 deletions examples/ibm-secrets-manager/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -488,17 +488,3 @@ data "ibm_sm_en_registration" "sm_en_registration_instance" {
region = var.region
endpoint_type = var.endpoint_type
}


// Create secrets_manager_secrets data source
data "ibm_secrets_manager_secrets" "secrets_manager_secrets_instance" {
instance_id = var.secrets_manager_instance_id
secret_type = var.secrets_manager_secrets_secret_type
}

// Create secrets_manager_secret data source
data "ibm_secrets_manager_secret" "secrets_manager_secret_instance" {
instance_id = var.secrets_manager_instance_id
secret_type = var.secrets_manager_secret_secret_type
secret_id = var.secrets_manager_secret_id
}
18 changes: 0 additions & 18 deletions examples/ibm-secrets-manager/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,6 @@ variable "endpoint_type" {
default = "private"
}

// Data source arguments for secrets_manager_secrets
variable "secrets_manager_secrets_secret_type" {
description = "The secret type."
type = string
default = null
}

// Data source arguments for secrets_manager_secret
variable "secrets_manager_secret_secret_type" {
description = "The secret type. Supported options include: arbitrary, iam_credentials, username_password."
type = string
default = "arbitrary"
}
variable "secrets_manager_secret_id" {
description = "The v4 UUID that uniquely identifies the secret."
type = string
}

// Resource arguments for sm_secret_group
variable "sm_secret_group_description" {
description = "An extended description of your secret group.To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group."
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca
github.com/IBM/appconfiguration-go-admin-sdk v0.3.0
github.com/IBM/appid-management-go-sdk v0.0.0-20210908164609-dd0e0eaf732f
github.com/IBM/cloud-databases-go-sdk v0.4.0
github.com/IBM/cloud-databases-go-sdk v0.5.0
github.com/IBM/cloudant-go-sdk v0.0.43
github.com/IBM/code-engine-go-sdk v0.0.0-20231106200405-99e81b3ee752
github.com/IBM/container-registry-go-sdk v1.1.0
Expand All @@ -24,8 +24,8 @@ require (
github.com/IBM/ibm-hpcs-uko-sdk v0.0.20-beta
github.com/IBM/keyprotect-go-client v0.12.2
github.com/IBM/networking-go-sdk v0.44.0
github.com/IBM/platform-services-go-sdk v0.55.0
github.com/IBM/project-go-sdk v0.1.6
github.com/IBM/platform-services-go-sdk v0.56.3
github.com/IBM/project-go-sdk v0.2.0
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5
github.com/IBM/scc-go-sdk/v5 v5.1.4
github.com/IBM/schematics-go-sdk v0.2.3
Expand Down
10 changes: 6 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ github.com/IBM/appconfiguration-go-admin-sdk v0.3.0 h1:OqFxnDxro0JiRwHBKytCcseY2
github.com/IBM/appconfiguration-go-admin-sdk v0.3.0/go.mod h1:xPxAYhr/uywUIDEo/JqWbkUdTryPdzRdYBfUpA5IjoE=
github.com/IBM/appid-management-go-sdk v0.0.0-20210908164609-dd0e0eaf732f h1:4c1kqY4GqmkQ+tO03rneDb74Tv7BhTj8jDiDB1p8mdM=
github.com/IBM/appid-management-go-sdk v0.0.0-20210908164609-dd0e0eaf732f/go.mod h1:d22kTYY7RYBWcQlZpqrSdshpB/lJ16viWS5Sbjtlc8s=
github.com/IBM/cloud-databases-go-sdk v0.4.0 h1:pmmMbJb/axolBEpCqq85idcZiimAOTacCyLUfAhXCqI=
github.com/IBM/cloud-databases-go-sdk v0.4.0/go.mod h1:nCIVfeZnhBYIiwByT959dFP4VWUeNLxomDYy63tTC6M=
github.com/IBM/cloud-databases-go-sdk v0.5.0 h1:Bie6MnT1jLchQmtKVA20HHETTPdlOR+i11P2kJ55viM=
github.com/IBM/cloud-databases-go-sdk v0.5.0/go.mod h1:nCIVfeZnhBYIiwByT959dFP4VWUeNLxomDYy63tTC6M=
github.com/IBM/cloudant-go-sdk v0.0.43 h1:YxTy4RpAEezX32YIWnds76hrBREmO4u6IkBz1WylNuQ=
github.com/IBM/cloudant-go-sdk v0.0.43/go.mod h1:WeYrJPaHTw19943ndWnVfwMIlZ5z0XUM2uEXNBrwZ1M=
github.com/IBM/code-engine-go-sdk v0.0.0-20231106200405-99e81b3ee752 h1:S5NT0aKKUqd9hnIrPN/qUijKx9cZjJi3kfFpog0ByDA=
Expand Down Expand Up @@ -160,8 +160,10 @@ github.com/IBM/networking-go-sdk v0.44.0 h1:6acyMd6hwxcjK3bJ2suiUBTjzg8mRFAvYD76
github.com/IBM/networking-go-sdk v0.44.0/go.mod h1:XtqYRInR5NHmFUXhOL6RovpDdv6PnJfZ1lPFvssA8MA=
github.com/IBM/platform-services-go-sdk v0.55.0 h1:W598xZanL61bwd8O2DQexr4qjIr+/tP0Y845zoms5yA=
github.com/IBM/platform-services-go-sdk v0.55.0/go.mod h1:CWSprvsCsXWvujmBzbtoJSmbRZS9FVV3O594b0t/GiM=
github.com/IBM/project-go-sdk v0.1.6 h1:sGrR0ej5wgBDhR2Xvf8Tgi5NmgMAJ77yep/CPGhvOx8=
github.com/IBM/project-go-sdk v0.1.6/go.mod h1:lqe0M4cKvABI1iHR1b+KfasVcxQL6nl2VJ8eOyQs8Ig=
github.com/IBM/platform-services-go-sdk v0.56.3 h1:DQ1VMQSknhPsdT7d+AybKiZT82esczAkHCIBkwYubzQ=
github.com/IBM/platform-services-go-sdk v0.56.3/go.mod h1:+U6Kg7o5u/Bh4ZkLxjymSgfdpVsaWAtsMtzhwclUry0=
github.com/IBM/project-go-sdk v0.2.0 h1:DMv0HQfS3GQHkkagZ4E2vt1H1paN5Gh357K9izeaGj8=
github.com/IBM/project-go-sdk v0.2.0/go.mod h1:lqe0M4cKvABI1iHR1b+KfasVcxQL6nl2VJ8eOyQs8Ig=
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 h1:NPUhkoOCRuv3OFWt19PmwjXGGTKlvmbuPg9fUrBUNe4=
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5/go.mod h1:b07XHUVh0XYnQE9s2mqgjYST1h9buaQNqN4EcKhOsX0=
github.com/IBM/sarama v1.41.2 h1:ZDBZfGPHAD4uuAtSv4U22fRZBgst0eEwGFzLj0fb85c=
Expand Down
12 changes: 0 additions & 12 deletions ibm/acctest/acctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -1269,18 +1269,6 @@ func init() {
fmt.Println("[INFO] Set the environment variable SECRETS_MANAGER_SERVICE_CREDENTIALS_COS_CRN for testing service credentials' tests, else tests fail if not set correctly")
}

SecretsManagerSecretType = os.Getenv("SECRETS_MANAGER_SECRET_TYPE")
if SecretsManagerSecretType == "" {
SecretsManagerSecretType = "username_password"
fmt.Println("[INFO] Set the environment variable SECRETS_MANAGER_SECRET_TYPE for testing data_source_ibm_secrets_manager_secrets_test, else it is set to default value. For data_source_ibm_secrets_manager_secret_test, tests will fail if this is not set correctly")
}

SecretsManagerSecretID = os.Getenv("SECRETS_MANAGER_SECRET_ID")
if SecretsManagerSecretID == "" {
// SecretsManagerSecretID = "644f4a69-0d17-198f-3b58-23f2746c706d"
fmt.Println("[WARN] Set the environment variable SECRETS_MANAGER_SECRET_ID for testing data_source_ibm_secrets_manager_secret_test else tests will fail if this is not set correctly")
}

Tg_cross_network_account_api_key = os.Getenv("IBM_TG_CROSS_ACCOUNT_API_KEY")
if Tg_cross_network_account_api_key == "" {
fmt.Println("[INFO] Set the environment variable IBM_TG_CROSS_ACCOUNT_API_KEY for testing ibm_tg_connection resource else tests will fail if this is not set correctly")
Expand Down
33 changes: 5 additions & 28 deletions ibm/conns/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ import (
"github.com/IBM/eventstreams-go-sdk/pkg/schemaregistryv1"
"github.com/IBM/ibm-hpcs-uko-sdk/ukov4"
scc "github.com/IBM/scc-go-sdk/v5/securityandcompliancecenterapiv3"
"github.com/IBM/secrets-manager-go-sdk/v2/secretsmanagerv1"
"github.com/IBM/secrets-manager-go-sdk/v2/secretsmanagerv2"
)

Expand Down Expand Up @@ -283,7 +282,6 @@ type ClientSession interface {
CatalogManagementV1() (*catalogmanagementv1.CatalogManagementV1, error)
EnterpriseManagementV1() (*enterprisemanagementv1.EnterpriseManagementV1, error)
ResourceControllerV2API() (*resourcecontroller.ResourceControllerV2, error)
SecretsManagerV1() (*secretsmanagerv1.SecretsManagerV1, error)
SecretsManagerV2() (*secretsmanagerv2.SecretsManagerV2, error)
SchematicsV1() (*schematicsv1.SchematicsV1, error)
SatelliteClientSession() (*kubernetesserviceapiv1.KubernetesServiceApiV1, error)
Expand Down Expand Up @@ -540,7 +538,6 @@ type clientSession struct {
// Resource Controller Option
resourceControllerErr error
resourceControllerAPI *resourcecontroller.ResourceControllerV2
secretsManagerClientV1 *secretsmanagerv1.SecretsManagerV1
secretsManagerClient *secretsmanagerv2.SecretsManagerV2
secretsManagerClientErr error

Expand Down Expand Up @@ -1086,11 +1083,6 @@ func (sess clientSession) ResourceControllerV2API() (*resourcecontroller.Resourc
return sess.resourceControllerAPI, sess.resourceControllerErr
}

// IBM Cloud Secrets Manager V1 Basic API
func (session clientSession) SecretsManagerV1() (*secretsmanagerv1.SecretsManagerV1, error) {
return session.secretsManagerClientV1, session.secretsManagerClientErr
}

// IBM Cloud Secrets Manager V2 Basic API
func (session clientSession) SecretsManagerV2() (*secretsmanagerv2.SecretsManagerV2, error) {
return session.secretsManagerClient, session.secretsManagerClientErr
Expand Down Expand Up @@ -1884,11 +1876,14 @@ func (c *Config) ClientSession() (interface{}, error) {
})
}
session.pushServiceClient = pnclient

// event notifications
enurl := fmt.Sprintf("https://%s.event-notifications.cloud.ibm.com/event-notifications", c.Region)
if c.Visibility == "private" {
session.eventNotificationsApiClientErr = fmt.Errorf("Event Notifications Service does not support private endpoints")

if c.Visibility == "private" || c.Visibility == "public-and-private" {
enurl = fmt.Sprintf("https://private.%s.event-notifications.cloud.ibm.com/event-notifications", c.Region)
}

if fileMap != nil && c.Visibility != "public-and-private" {
enurl = fileFallBack(fileMap, c.Visibility, "IBMCLOUD_EVENT_NOTIFICATIONS_API_ENDPOINT", c.Region, enurl)
}
Expand Down Expand Up @@ -3084,24 +3079,6 @@ func (c *Config) ClientSession() (interface{}, error) {
}
session.resourceControllerAPI = resourceControllerClient

// SECRETS MANAGER Service
secretsManagerClientOptions := &secretsmanagerv1.SecretsManagerV1Options{
Authenticator: authenticator,
}
/// Construct the service client.
session.secretsManagerClientV1, err = secretsmanagerv1.NewSecretsManagerV1(secretsManagerClientOptions)
if err != nil {
session.secretsManagerClientErr = fmt.Errorf("[ERROR] Error occurred while configuring IBM Cloud Secrets Manager API service: %q", err)
}
if session.secretsManagerClient != nil && session.secretsManagerClient.Service != nil {
// Enable retries for API calls
session.secretsManagerClient.Service.EnableRetries(c.RetryCount, c.RetryDelay)
// Add custom header for analytics
session.secretsManagerClient.SetDefaultHeaders(gohttp.Header{
"X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)},
})
}

// SECRETS MANAGER Service V2
// Construct an "options" struct for creating the service client.
var smBaseUrl string
Expand Down

0 comments on commit e6b0b95

Please sign in to comment.