Skip to content

Commit

Permalink
Merge pull request microsoft#966 from xuzhang3/f/elastic_poop_project
Browse files Browse the repository at this point in the history
`azuredevops_elastic_pool` - Support `project_id`
  • Loading branch information
xuzhang3 authored Feb 2, 2024
2 parents 2edaa8a + 7ab9a37 commit c10392c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions azuredevops/internal/service/taskagent/resource_elastic_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ func ResourceAgentPoolVMSS() *schema.Resource {
Optional: true,
Default: true,
},

"project_id": {
Type: schema.TypeString,
Optional: true,
},
},
}
}
Expand All @@ -115,6 +120,14 @@ func resourceAzureAgentPoolVMSSCreate(d *schema.ResourceData, m interface{}) err
PoolName: converter.String(d.Get("name").(string)),
}

if v, ok := d.GetOk("project_id"); ok {
projectId, err := uuid.Parse(v.(string))
if err != nil {
return fmt.Errorf(" parse Project Id: %s. Error: %+v", v, err)
}
args.ProjectId = &projectId
}

seId := d.Get("service_endpoint_id").(string)
seUUId, err := uuid.Parse(seId)
if err != nil {
Expand Down Expand Up @@ -196,6 +209,7 @@ func resourceAzureAgentPoolVMSSRead(d *schema.ResourceData, m interface{}) error
d.Set("recycle_after_each_use", elasticPool.RecycleAfterEachUse)
d.Set("agent_interactive_ui", elasticPool.AgentInteractiveUI)
d.Set("time_to_live_minutes", elasticPool.TimeToLiveMinutes)
d.Set("project_id", d.Get("project_id").(string))

d.Set("auto_provision", agentPool.AutoProvision)
d.Set("auto_update", agentPool.AutoUpdate)
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/elastic_pool.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ The following arguments are supported:

- `auto_update` - (Optional) Specifies whether or not agents within the pool should be automatically updated. Defaults to `true`.

- `project_id` - (Optional) The ID of the project where a new Elastic Pool will be created.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:
Expand Down

0 comments on commit c10392c

Please sign in to comment.