forked from IBM-Cloud/terraform-provider-ibm
-
Notifications
You must be signed in to change notification settings - Fork 2
Terraform New Feature Development Process
SunithaGudisagar edited this page Sep 4, 2024
·
7 revisions
API Spec:
- clone https://github.ibm.com/riaas/api-spec and move your feature below maturity ga block,
- run command
./build/node_modules/.bin/build-vpc-spec -x public ./spec "" --feature <YOUR FEATURE NAME> -o openapi.yaml - now the spec is ready
- Also add examples for new feature https://github.ibm.com/riaas/api-spec/tree/master/spec/examples here
Generating SDK:
- Get the https://github.ibm.com/CloudEngineering/openapi-sdkgen appropriate version of the release.
- https://github.ibm.com/Bluemix/genesis-ui/blob/master/scripts/sdk/sdk-generator/generate.sh locate the sdk generator here SDKGEN=./openapi-sdkgen and locate your above spec here APIDOCS=scoped/openapi.yaml
- run sh generate.sh
- make the appropriate hand edits mentioned https://github.ibm.com/ibmcloud/vpc-go-sdk/blob/master/release.md here. OR
- you can also use script https://github.ibm.com/Bluemix/vpc-iac-core/tree/sdk-generation to generate SDK.
Terraform Development:
- clone https://github.com/ibm-vpc/terraform-provider-ibm/tree/master
- place your SDK at common/github.com/IBM/vpc-go-sdk
- In go.mod refer the above sdk "replace github.com/IBM/vpc-go-sdk v0.57.0 => ./common/github.com/IBM/vpc-go-sdk"
- Generate the required resource and datasource by referring the doc : https://github.com/ibm-vpc/terraform-provider-ibm/wiki/Terraform-development-using-generator.
- Create the appropriate files(datasource, resource, acceptancetest, docs) and resolve the errors.
- Test the above files with your terraform configuration and attach the results.
- Create PR in ibm-vpc repo and Assign for review.
- Verify doc in tool https://registry.terraform.io/tools/doc-preview
- Upload the binary to artifactory - https://github.com/ibm-vpc/terraform-provider-ibm/wiki/Upload-Binary-to-Artifactory
Release feature:
- Once the feature is available in https://github.com/IBM/vpc-go-sdk, remove common SDK and modify the go.mod with the appropriate version.
- Test again in the prod env and close the PR and create PR for upstream "https://github.com/IBM-Cloud/terraform-provider-ibm"
- Ask Harini to review.