Skip to content
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

data source nutanix_network_security_rule expected type issue #126

Closed
acosteseque opened this issue May 21, 2020 · 0 comments · Fixed by #127
Closed

data source nutanix_network_security_rule expected type issue #126

acosteseque opened this issue May 21, 2020 · 0 comments · Fixed by #127

Comments

@acosteseque
Copy link

Nutanix Cluster Information

Please provide the version of:

  • Nutanix Cluster (Prism Element / AOS): 5.16.1
  • Nutanix Prism Central: 5.16.1.2

Terraform Version

Terraform v0.12.25

  • provider.nutanix last build from master
  • provider.template v2.1.2

Affected Resource(s)

  • nutanix_network_security_rule

Terraform Configuration Files

data "nutanix_network_security_rule" "psih_sp" {
  network_security_rule_id = "c7bbcd24-0d9d-4d89-8636-46cb752dae13"
}

Debug Output

Error: app_rule_inbound_allow_list.0.tcp_port_range_list.0.start_port: '' expected type 'string', got unconvertible type 'int64'

on securitypolicies.tf line 2, in data "nutanix_network_security_rule" "psih_sp":
2: data "nutanix_network_security_rule" "psih_sp" {

Content of the rule from API call output

{
"status": {
"state": "COMPLETE",
"execution_context": {
"task_uuids": [
"a215c888-8e42-4136-85f2-5d53873eb378"
]
},
"name": "PSIH_Security_Policy",
"resources": {
"app_rule": {
"action": "MONITOR",
"outbound_allow_list": [
{
"ip_subnet": {
"ip": "10.0.0.0",
"prefix_length": 24
},
"protocol": "UDP",
"udp_port_range_list": [
{
"end_port": 53,
"start_port": 53
}
],
"peer_specification_type": "IP_SUBNET"
}
],
"target_group": {
"filter": {
"kind_list": [
"vm"
],
"type": "CATEGORIES_MATCH_ALL",
"params": {
"AppTier": [
"PMSIpilot"
],
"AppType": [
"PSIH"
]
}
},
"default_internal_policy": "ALLOW_ALL",
"peer_specification_type": "FILTER"
},
"inbound_allow_list": [
{
"ip_subnet": {
"ip": "0.0.0.0",
"prefix_length": 0
},
"tcp_port_range_list": [
{
"end_port": 80,
"start_port": 80
},
{
"end_port": 443,
"start_port": 443
}
],
"protocol": "TCP",
"peer_specification_type": "IP_SUBNET"
},
{
"filter": {
"kind_list": [
"vm"
],
"type": "CATEGORIES_MATCH_ALL",
"params": {
"Environment": [
"AdminWorkstations"
]
}
},
"tcp_port_range_list": [
{
"end_port": 22,
"start_port": 22
}
],
"protocol": "TCP",
"peer_specification_type": "FILTER"
},
{
"filter": {
"kind_list": [
"vm"
],
"type": "CATEGORIES_MATCH_ALL",
"params": {
"Environment": [
"AdminWorkstations"
]
}
},
"protocol": "ICMP",
"peer_specification_type": "FILTER"
}
]
}
},
"description": "Secure PSIH Applications"
},
"spec": {
"description": "Secure PSIH Applications",
"resources": {
"allow_ipv6_traffic": false,
"app_rule": {
"action": "MONITOR",
"outbound_allow_list": [
{
"ip_subnet": {
"ip": "10.0.0.0",
"prefix_length": 24
},
"protocol": "UDP",
"udp_port_range_list": [
{
"end_port": 53,
"start_port": 53
}
],
"peer_specification_type": "IP_SUBNET"
}
],
"target_group": {
"filter": {
"params": {
"AppType": [
"PSIH"
],
"AppTier": [
"PMSIpilot"
]
},
"kind_list": [
"vm"
],
"type": "CATEGORIES_MATCH_ALL"
},
"default_internal_policy": "ALLOW_ALL",
"peer_specification_type": "FILTER"
},
"inbound_allow_list": [
{
"ip_subnet": {
"ip": "0.0.0.0",
"prefix_length": 0
},
"tcp_port_range_list": [
{
"end_port": 80,
"start_port": 80
},
{
"end_port": 443,
"start_port": 443
}
],
"protocol": "TCP",
"peer_specification_type": "IP_SUBNET"
},
{
"filter": {
"params": {
"Environment": [
"AdminWorkstations"
]
},
"kind_list": [
"vm"
],
"type": "CATEGORIES_MATCH_ALL"
},
"tcp_port_range_list": [
{
"end_port": 22,
"start_port": 22
}
],
"protocol": "TCP",
"peer_specification_type": "FILTER"
},
{
"filter": {
"params": {
"Environment": [
"AdminWorkstations"
]
},
"kind_list": [
"vm"
],
"type": "CATEGORIES_MATCH_ALL"
},
"protocol": "ICMP",
"peer_specification_type": "FILTER"
}
]
},
"is_policy_hitlog_enabled": false
},
"name": "PSIH_Security_Policy"
},
"metadata": {
"last_update_time": "2020-05-16T13:51:13Z",
"kind": "network_security_rule",
"uuid": "c7bbcd24-0d9d-4d89-8636-46cb752dae13",
"spec_version": 2,
"creation_time": "2020-05-16T13:43:43Z",
"categories_mapping": {},
"owner_reference": {
"kind": "user",
"uuid": "5e809300-67c9-5c28-a1b3-972b931e3d32",
"name": "anthony"
},
"categories": {}
}
},

Expected Behavior

fetching data source without error message

Actual Behavior

error on expected type

Steps to Reproduce

adding any data source nutanix_network_security_rule

yannickstruyf3 added a commit to yannickstruyf3/terraform-provider-nutanix that referenced this issue May 22, 2020
marinsalinas added a commit that referenced this issue May 22, 2020
yannickstruyf3 added a commit to yannickstruyf3/terraform-provider-nutanix that referenced this issue Nov 9, 2021
yannickstruyf3 pushed a commit to yannickstruyf3/terraform-provider-nutanix that referenced this issue Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant