-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_api_management: Deploy APIM in a vnet #5494
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -62,6 +62,14 @@ func resourceArmApiManagementService() *schema.Resource { | |||||
}, | ||||||
}, | ||||||
|
||||||
"private_ip_addresses": { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we put computed values at the end of the block? |
||||||
Type: schema.TypeList, | ||||||
Computed: true, | ||||||
Elem: &schema.Schema{ | ||||||
Type: schema.TypeString, | ||||||
}, | ||||||
}, | ||||||
|
||||||
"publisher_name": { | ||||||
Type: schema.TypeString, | ||||||
Required: true, | ||||||
|
@@ -460,6 +468,21 @@ func resourceArmApiManagementService() *schema.Resource { | |||||
Type: schema.TypeString, | ||||||
Computed: true, | ||||||
}, | ||||||
|
||||||
"vnet_type": { | ||||||
Type: schema.TypeString, | ||||||
Optional: true, | ||||||
ValidateFunc: validation.StringInSlice([]string{ | ||||||
"External", | ||||||
"Internal", | ||||||
"None", | ||||||
}, false), | ||||||
}, | ||||||
|
||||||
"subnet_id": { | ||||||
Type: schema.TypeString, | ||||||
Optional: true, | ||||||
}, | ||||||
}, | ||||||
} | ||||||
} | ||||||
|
@@ -514,6 +537,12 @@ func resourceArmApiManagementServiceCreateUpdate(d *schema.ResourceData, meta in | |||||
CustomProperties: customProperties, | ||||||
Certificates: certificates, | ||||||
HostnameConfigurations: hostnameConfigurations, | ||||||
VirtualNetworkType: virtualNetworkTypeStringToType(utils.String(d.Get("vnet_type").(string))), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should be able to go
Suggested change
|
||||||
VirtualNetworkConfiguration: &apimanagement.VirtualNetworkConfiguration{ | ||||||
Vnetid: utils.String(""), | ||||||
Subnetname: utils.String(""), | ||||||
Comment on lines
+542
to
+543
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. COuld we also support these two values? |
||||||
SubnetResourceID: utils.String(d.Get("subnet_id").(string)), | ||||||
}, | ||||||
}, | ||||||
Tags: tags.Expand(t), | ||||||
Sku: sku, | ||||||
|
@@ -657,6 +686,7 @@ func resourceArmApiManagementServiceRead(d *schema.ResourceData, meta interface{ | |||||
d.Set("management_api_url", props.ManagementAPIURL) | ||||||
d.Set("scm_url", props.ScmURL) | ||||||
d.Set("public_ip_addresses", props.PublicIPAddresses) | ||||||
d.Set("private_ip_addresses", props.PrivateIPAddresses) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should we reading in the other new values here too |
||||||
|
||||||
if err := d.Set("security", flattenApiManagementCustomProperties(props.CustomProperties)); err != nil { | ||||||
return fmt.Errorf("Error setting `security`: %+v", err) | ||||||
|
@@ -1366,3 +1396,15 @@ func flattenApiManagementPolicies(d *schema.ResourceData, input apimanagement.Po | |||||
|
||||||
return []interface{}{output} | ||||||
} | ||||||
|
||||||
func virtualNetworkTypeStringToType(s *string) apimanagement.VirtualNetworkType { | ||||||
switch *s { | ||||||
case "External": | ||||||
return apimanagement.VirtualNetworkTypeExternal | ||||||
case "Internal": | ||||||
return apimanagement.VirtualNetworkTypeInternal | ||||||
case "None": | ||||||
return apimanagement.VirtualNetworkTypeNone | ||||||
} | ||||||
return apimanagement.VirtualNetworkTypeNone | ||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we put these new values into a
virtual_network
block?