88)
99
1010const NameKey = "name"
11+ const ManagedRuntimeKey = "runtime"
1112const StatusKey = "status"
1213
1314func resourceApplicationPool () * schema.Resource {
@@ -22,6 +23,11 @@ func resourceApplicationPool() *schema.Resource {
2223 Type : schema .TypeString ,
2324 Required : true ,
2425 },
26+ ManagedRuntimeKey : {
27+ Type : schema .TypeString ,
28+ Optional : true ,
29+ Default : "" ,
30+ },
2531 StatusKey : {
2632 Type : schema .TypeString ,
2733 Optional : true ,
@@ -34,7 +40,8 @@ func resourceApplicationPool() *schema.Resource {
3440func resourceApplicationPoolCreate (ctx context.Context , d * schema.ResourceData , m interface {}) diag.Diagnostics {
3541 client := m .(* iis.Client )
3642 name := d .Get (NameKey ).(string )
37- pool , err := client .CreateAppPool (ctx , name )
43+ runtime := d .Get (ManagedRuntimeKey ).(string )
44+ pool , err := client .CreateAppPool (ctx , name , runtime )
3845 if err != nil {
3946 return diag .FromErr (err )
4047 }
@@ -54,6 +61,9 @@ func resourceApplicationPoolRead(ctx context.Context, d *schema.ResourceData, m
5461 if err = d .Set (NameKey , appPool .Name ); err != nil {
5562 return diag .FromErr (err )
5663 }
64+ if err = d .Set (ManagedRuntimeKey , appPool .ManagedRuntimeKey ); err != nil {
65+ return diag .FromErr (err )
66+ }
5767 if err = d .Set (StatusKey , appPool .Status ); err != nil {
5868 return diag .FromErr (err )
5969 }
@@ -62,8 +72,8 @@ func resourceApplicationPoolRead(ctx context.Context, d *schema.ResourceData, m
6272
6373func resourceApplicationPoolUpdate (ctx context.Context , d * schema.ResourceData , m interface {}) diag.Diagnostics {
6474 client := m .(* iis.Client )
65- if d .HasChange (NameKey ) {
66- applicationPool , err := client .UpdateAppPool (ctx , d .Id (), d .Get (NameKey ).(string ))
75+ if d .HasChange (NameKey ) || d . HasChange ( ManagedRuntimeKey ) {
76+ applicationPool , err := client .UpdateAppPool (ctx , d .Id (), d .Get (NameKey ).(string ), d . Get ( ManagedRuntimeKey ).( string ) )
6777 if err != nil {
6878 return diag .FromErr (err )
6979 }
0 commit comments