@@ -53,6 +53,29 @@ func resourceApigeeEnvironment() *schema.Resource {
53
53
ForceNew : true ,
54
54
Description : `The Apigee Organization associated with the Apigee environment,
55
55
in the format 'organizations/{{org_name}}'.` ,
56
+ },
57
+ "api_proxy_type" : {
58
+ Type : schema .TypeString ,
59
+ Computed : true ,
60
+ Optional : true ,
61
+ ForceNew : true ,
62
+ ValidateFunc : validateEnum ([]string {"API_PROXY_TYPE_UNSPECIFIED" , "PROGRAMMABLE" , "CONFIGURABLE" , "" }),
63
+ Description : `Optional. API Proxy type supported by the environment. The type can be set when creating
64
+ the Environment and cannot be changed. Possible values: ["API_PROXY_TYPE_UNSPECIFIED", "PROGRAMMABLE", "CONFIGURABLE"]` ,
65
+ },
66
+ "deployment_type" : {
67
+ Type : schema .TypeString ,
68
+ Computed : true ,
69
+ Optional : true ,
70
+ ForceNew : true ,
71
+ ValidateFunc : validateEnum ([]string {"DEPLOYMENT_TYPE_UNSPECIFIED" , "PROXY" , "ARCHIVE" , "" }),
72
+ Description : `Optional. Deployment type supported by the environment. The deployment type can be
73
+ set when creating the environment and cannot be changed. When you enable archive
74
+ deployment, you will be prevented from performing a subset of actions within the
75
+ environment, including:
76
+ Managing the deployment of API proxy or shared flow revisions;
77
+ Creating, updating, or deleting resource files;
78
+ Creating, updating, or deleting target servers. Possible values: ["DEPLOYMENT_TYPE_UNSPECIFIED", "PROXY", "ARCHIVE"]` ,
56
79
},
57
80
"description" : {
58
81
Type : schema .TypeString ,
@@ -97,6 +120,18 @@ func resourceApigeeEnvironmentCreate(d *schema.ResourceData, meta interface{}) e
97
120
} else if v , ok := d .GetOkExists ("description" ); ! isEmptyValue (reflect .ValueOf (descriptionProp )) && (ok || ! reflect .DeepEqual (v , descriptionProp )) {
98
121
obj ["description" ] = descriptionProp
99
122
}
123
+ deploymentTypeProp , err := expandApigeeEnvironmentDeploymentType (d .Get ("deployment_type" ), d , config )
124
+ if err != nil {
125
+ return err
126
+ } else if v , ok := d .GetOkExists ("deployment_type" ); ! isEmptyValue (reflect .ValueOf (deploymentTypeProp )) && (ok || ! reflect .DeepEqual (v , deploymentTypeProp )) {
127
+ obj ["deploymentType" ] = deploymentTypeProp
128
+ }
129
+ apiProxyTypeProp , err := expandApigeeEnvironmentApiProxyType (d .Get ("api_proxy_type" ), d , config )
130
+ if err != nil {
131
+ return err
132
+ } else if v , ok := d .GetOkExists ("api_proxy_type" ); ! isEmptyValue (reflect .ValueOf (apiProxyTypeProp )) && (ok || ! reflect .DeepEqual (v , apiProxyTypeProp )) {
133
+ obj ["apiProxyType" ] = apiProxyTypeProp
134
+ }
100
135
101
136
url , err := replaceVars (d , config , "{{ApigeeBasePath}}{{org_id}}/environments" )
102
137
if err != nil {
@@ -184,6 +219,12 @@ func resourceApigeeEnvironmentRead(d *schema.ResourceData, meta interface{}) err
184
219
if err := d .Set ("description" , flattenApigeeEnvironmentDescription (res ["description" ], d , config )); err != nil {
185
220
return fmt .Errorf ("Error reading Environment: %s" , err )
186
221
}
222
+ if err := d .Set ("deployment_type" , flattenApigeeEnvironmentDeploymentType (res ["deploymentType" ], d , config )); err != nil {
223
+ return fmt .Errorf ("Error reading Environment: %s" , err )
224
+ }
225
+ if err := d .Set ("api_proxy_type" , flattenApigeeEnvironmentApiProxyType (res ["apiProxyType" ], d , config )); err != nil {
226
+ return fmt .Errorf ("Error reading Environment: %s" , err )
227
+ }
187
228
188
229
return nil
189
230
}
@@ -216,6 +257,18 @@ func resourceApigeeEnvironmentUpdate(d *schema.ResourceData, meta interface{}) e
216
257
} else if v , ok := d .GetOkExists ("description" ); ! isEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , descriptionProp )) {
217
258
obj ["description" ] = descriptionProp
218
259
}
260
+ deploymentTypeProp , err := expandApigeeEnvironmentDeploymentType (d .Get ("deployment_type" ), d , config )
261
+ if err != nil {
262
+ return err
263
+ } else if v , ok := d .GetOkExists ("deployment_type" ); ! isEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , deploymentTypeProp )) {
264
+ obj ["deploymentType" ] = deploymentTypeProp
265
+ }
266
+ apiProxyTypeProp , err := expandApigeeEnvironmentApiProxyType (d .Get ("api_proxy_type" ), d , config )
267
+ if err != nil {
268
+ return err
269
+ } else if v , ok := d .GetOkExists ("api_proxy_type" ); ! isEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , apiProxyTypeProp )) {
270
+ obj ["apiProxyType" ] = apiProxyTypeProp
271
+ }
219
272
220
273
url , err := replaceVars (d , config , "{{ApigeeBasePath}}{{org_id}}/environments/{{name}}" )
221
274
if err != nil {
@@ -344,6 +397,14 @@ func flattenApigeeEnvironmentDescription(v interface{}, d *schema.ResourceData,
344
397
return v
345
398
}
346
399
400
+ func flattenApigeeEnvironmentDeploymentType (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
401
+ return v
402
+ }
403
+
404
+ func flattenApigeeEnvironmentApiProxyType (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
405
+ return v
406
+ }
407
+
347
408
func expandApigeeEnvironmentName (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
348
409
return v , nil
349
410
}
@@ -355,3 +416,11 @@ func expandApigeeEnvironmentDisplayName(v interface{}, d TerraformResourceData,
355
416
func expandApigeeEnvironmentDescription (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
356
417
return v , nil
357
418
}
419
+
420
+ func expandApigeeEnvironmentDeploymentType (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
421
+ return v , nil
422
+ }
423
+
424
+ func expandApigeeEnvironmentApiProxyType (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
425
+ return v , nil
426
+ }
0 commit comments