-
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
virtual_machine_scale_set datasource - support network_interfaces #10585
Merged
katbyte
merged 12 commits into
hashicorp:master
from
shurikk:add-network-profile-to-virtual-machine-scale-set-data
Apr 28, 2021
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2d5544e
add network_profile to virtual_machine_scale_set data
4cde852
update docs
4e826ae
Update azurerm/internal/services/compute/virtual_machine_scale_set_da…
shurikk 6909b40
address comments
2451218
Merge remote-tracking branch 'origin/master' into add-network-profile…
katbyte 30aade3
update to use new schema
katbyte 717612c
cleanup
katbyte 7eeb707
dox fixes
katbyte df42f02
fix schema
katbyte 1304179
Update azurerm/internal/services/compute/virtual_machine_scale_set_da…
katbyte 6d0896c
required -> computed
katbyte 4e68d70
remove set specific code
katbyte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,6 +207,47 @@ func VirtualMachineScaleSetNetworkInterfaceSchema() *schema.Schema { | |
} | ||
} | ||
|
||
func VirtualMachineScaleSetNetworkInterfaceSchemaForDataSource() *schema.Schema { | ||
return &schema.Schema{ | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"name": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
|
||
"ip_configuration": virtualMachineScaleSetIPConfigurationSchemaForDataSource(), | ||
|
||
"dns_servers": { | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
}, | ||
}, | ||
"enable_accelerated_networking": { | ||
Type: schema.TypeBool, | ||
Computed: true, | ||
}, | ||
"enable_ip_forwarding": { | ||
Type: schema.TypeBool, | ||
Computed: true, | ||
}, | ||
"network_security_group_id": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
"primary": { | ||
Type: schema.TypeBool, | ||
Computed: true, | ||
}, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
func virtualMachineScaleSetIPConfigurationSchema() *schema.Schema { | ||
return &schema.Schema{ | ||
Type: schema.TypeList, | ||
|
@@ -280,6 +321,70 @@ func virtualMachineScaleSetIPConfigurationSchema() *schema.Schema { | |
} | ||
} | ||
|
||
func virtualMachineScaleSetIPConfigurationSchemaForDataSource() *schema.Schema { | ||
return &schema.Schema{ | ||
Type: schema.TypeList, | ||
Required: true, | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"name": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
|
||
"application_gateway_backend_address_pool_ids": { | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
}, | ||
}, | ||
|
||
"application_security_group_ids": { | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
}, | ||
}, | ||
|
||
"load_balancer_backend_address_pool_ids": { | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
}, | ||
}, | ||
|
||
"load_balancer_inbound_nat_rules_ids": { | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
}, | ||
}, | ||
|
||
"primary": { | ||
Type: schema.TypeBool, | ||
Computed: true, | ||
}, | ||
|
||
"public_ip_address": virtualMachineScaleSetPublicIPAddressSchemaForDataSource(), | ||
|
||
"subnet_id": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
|
||
"version": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
func virtualMachineScaleSetPublicIPAddressSchema() *schema.Schema { | ||
return &schema.Schema{ | ||
Type: schema.TypeList, | ||
|
@@ -340,6 +445,53 @@ func virtualMachineScaleSetPublicIPAddressSchema() *schema.Schema { | |
} | ||
} | ||
|
||
func virtualMachineScaleSetPublicIPAddressSchemaForDataSource() *schema.Schema { | ||
return &schema.Schema{ | ||
Type: schema.TypeList, | ||
Optional: true, | ||
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. Should we change this to |
||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"name": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
|
||
"domain_name_label": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
|
||
"idle_timeout_in_minutes": { | ||
Type: schema.TypeInt, | ||
Computed: true, | ||
}, | ||
|
||
"ip_tag": { | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"tag": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
"type": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
||
"public_ip_prefix_id": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
func ExpandVirtualMachineScaleSetNetworkInterface(input []interface{}) (*[]compute.VirtualMachineScaleSetNetworkConfiguration, error) { | ||
output := make([]compute.VirtualMachineScaleSetNetworkConfiguration, 0) | ||
|
||
|
@@ -666,10 +818,10 @@ func flattenVirtualMachineScaleSetIPConfiguration(input compute.VirtualMachineSc | |
"public_ip_address": publicIPAddresses, | ||
"subnet_id": subnetId, | ||
"version": string(input.PrivateIPAddressVersion), | ||
"application_gateway_backend_address_pool_ids": schema.NewSet(schema.HashString, applicationGatewayBackendAddressPoolIds), | ||
"application_security_group_ids": schema.NewSet(schema.HashString, applicationSecurityGroupIds), | ||
"load_balancer_backend_address_pool_ids": schema.NewSet(schema.HashString, loadBalancerBackendAddressPoolIds), | ||
"load_balancer_inbound_nat_rules_ids": schema.NewSet(schema.HashString, loadBalancerInboundNatRuleIds), | ||
"application_gateway_backend_address_pool_ids": applicationGatewayBackendAddressPoolIds, | ||
"application_security_group_ids": applicationSecurityGroupIds, | ||
"load_balancer_backend_address_pool_ids": loadBalancerBackendAddressPoolIds, | ||
"load_balancer_inbound_nat_rules_ids": loadBalancerInboundNatRuleIds, | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we change this to
Computed: true
?