-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Description
User Story
As a Terraform user, I want to create Power Platform Pipeline through Terraform so that I can automate the built-in ALM user experience, when creating a multistage environment deployment.
Use case:
- Create and manage Pipeline Host
- Create and manage Pipeline
- Create and manage Pipeline Stage
We deploy DEV-TEST-PROD environments and would like to also create built-in pipelines to connect these environments and give end users the full experience to deploy their solutions.
Resource
- Resource Name:
powerplatform_pipelineorpowerplatform_data_record - Service Name:
Power Platform Pipelines - Documentation Link: https://learn.microsoft.com/en-us/power-platform/alm/pipelines
Potential Terraform Configuration
# Sample Terraform config that describes how the new resource might look.
resource "powerplatform_data_record" "pipeline" {
environment_id = var.environment_id
table_logical_name = "deploymentpipeline"
columns = {
name = "String"
description = "String"
deploymenttype = "Choice" # Standard, Source Control, ADO Pipeline
enableaideploymentnotes = true/false #Yes/No Choice Enabled, Disabled
enableredeployment = true/false #Yes/No Choice Enabled, Disabled
}
}
resource "powerplatform_data_record" "pipeline_stage" {
environment_id = var.environment_id
table_logical_name = "deploymentstage"
columns = {
name = "String"
description = "String"
deploymentpipelineid = id #Lookup Pipeline ID
previousdeploymentstageid = id #Lookup Pipeline Stage
targetdeploymentenvironmentid = id #Lookup Pipeline Stage
isdelegateddeployment = true/false #Yes/No Choice Enabled, Disabled
predeploymentsteprequired = true/false #Yes/No Choice Enabled, Disabled
delegateddeploymenttype = "Choice" # Stage Owner, Service Principal
issharingenabled = true/false #Yes/No Choice Enabled, Disabled
preexportsteprequired = true/false #Yes/No Choice Enabled, Disabled
spnclientid = "String" # SPN Client ID
}
}
---OR---
resource "powerplatform_pipeline" "pipeline" {
environment_id = var.environment_id
name = "String"
description = "String"
deploymenttype = "Choice" # Standard, Source Control, ADO Pipeline
enableaideploymentnotes = true/false #Yes/No Choice Enabled, Disabled
enableredeployment = true/false #Yes/No Choice Enabled, Disabled
}
resource "powerplatform_pipeline_stage" "stage" {
environment_id = var.environment_id
name = "String"
description = "String"
deploymentpipelineid = id #Lookup Pipeline ID
previousdeploymentstageid = id #Lookup Pipeline Stage
targetdeploymentenvironmentid = id #Lookup Pipeline Stage
isdelegateddeployment = true/false #Yes/No Choice Enabled, Disabled
predeploymentsteprequired = true/false #Yes/No Choice Enabled, Disabled
delegateddeploymenttype = "Choice" # Stage Owner, Service Principal
issharingenabled = true/false #Yes/No Choice Enabled, Disabled
preexportsteprequired = true/false #Yes/No Choice Enabled, Disabled
spnclientid = "String" # SPN Client ID
}
Additional Validation Rules
API documentation
| Action | Verb | URL | Status Codes | Comments |
|---|---|---|---|---|
| Create | POST | /api/v1/resources | 201 | |
| Read | GET | /api/v1/resources/{id} | 200 | |
| Update | PUT | /api/v1/resources/{id} | 200 | |
| Delete | DELETE | /api/v1/resources/{id} | 204 |
JSON
{}Definition of Done
- Data Transfer Objects (dtos) in
dto.go - Resource Model in
model.go - API Client functions in
api_{name}.go - Resource Implementation in
resource_{name}.go - Unit Tests in
resource_{name}_test.gofor Happy Path, Error conditions, boundry cases - Acceptance Tests in
resource_{name}_test.gofor Happy Path - Resource Added to
provider.goandprovider_test.go - Example in the
/examplesfolder - Schema documented using
MarkdownDescription - Change log entry
changie new -k added - Run
make precommitbefore PR
See the contributing guide for more information about what's expected for contributions.