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

ibm_is_subnets output duplicates #1500

Closed
ChapChap opened this issue May 27, 2020 · 1 comment
Closed

ibm_is_subnets output duplicates #1500

ChapChap opened this issue May 27, 2020 · 1 comment

Comments

@ChapChap
Copy link

ChapChap commented May 27, 2020

Is this a loop bug ? Got duplactaes subnets

t$ terraform apply
var.ibmcloud_api_key
  Enter a value: XXXXXXXXXXXXXX

data.ibm_is_subnets.subnets: Refreshing state...

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

count = 6
tst = [
  {
    "available_ipv4_address_count" = "57"
    "crn" = "CRN#3"
    "id" = "ID#3"
    "ipv4_cidr_block" = "RANGE#3"
    "ipv6_cidr_block" = ""
    "name" = "NAME#3"
    "network_acl" = "NETACLID"
    "public_gateway" = ""
    "resource_group" = ""
    "status" = "available"
    "total_ipv4_address_count" = "64"
    "vpc" = "VPCID"
    "zone" = "ZONE#3"
  },
  {
    "available_ipv4_address_count" = "57"
    "crn" = "CRN#3"
    "id" = "ID#3"
    "ipv4_cidr_block" = "RANGE#3"
    "ipv6_cidr_block" = ""
    "name" = "NAME#3"
    "network_acl" = "NETACLID"
    "public_gateway" = ""
    "resource_group" = ""
    "status" = "available"
    "total_ipv4_address_count" = "64"
    "vpc" = "VPCID"
    "zone" = "ZONE#3"
  },
  {
    "available_ipv4_address_count" = "54"
    "crn" = "CRN#2"
    "id" = "ID#2"
    "ipv4_cidr_block" = "RANGE#2"
    "ipv6_cidr_block" = ""
    "name" = "NAME#2"
    "network_acl" = "NETACLID"
    "public_gateway" = ""
    "resource_group" = ""
    "status" = "available"
    "total_ipv4_address_count" = "64"
    "vpc" = "VPCID"
    "zone" = "ZONE#2"
  },
  {
    "available_ipv4_address_count" = "54"
    "crn" = "CRN#2"
    "id" = "ID#2"
    "ipv4_cidr_block" = "RANGE#2"
    "ipv6_cidr_block" = ""
    "name" = "NAME#2"
    "network_acl" = "NETACLID"
    "public_gateway" = ""
    "resource_group" = ""
    "status" = "available"
    "total_ipv4_address_count" = "64"
    "vpc" = "VPCID"
    "zone" = "ZONE#2"
  },
  {
    "available_ipv4_address_count" = "53"
    "crn" = "CRN#1"
    "id" = "ID#1"
    "ipv4_cidr_block" = "RANGE#1"
    "ipv6_cidr_block" = ""
    "name" = "NAME#1"
    "network_acl" = "NETACLID"
    "public_gateway" = ""
    "resource_group" = ""
    "status" = "available"
    "total_ipv4_address_count" = "64"
    "vpc" = "VPCID"
    "zone" = "ZONE#1"
  },
  {
    "available_ipv4_address_count" = "53"
    "crn" = "CRN#1"
    "id" = "ID#1"
    "ipv4_cidr_block" = "RANGE#1"
    "ipv6_cidr_block" = ""
    "name" = "NAME#1"
    "network_acl" = "NETACLID"
    "public_gateway" = ""
    "resource_group" = ""
    "status" = "available"
    "total_ipv4_address_count" = "64"
    "vpc" = "VPCID"
    "zone" = "ZONE#1"
  },
]
$ cat test.tf
data "ibm_is_subnets" "subnets" {}

output "tst" {
  value = data.ibm_is_subnets.subnets.subnets
}

output "count" {
  value = length(data.ibm_is_subnets.subnets.subnets)
}
$ ibmcloud is subnets
Listing subnets for generation 1 compute in region eu-de under account BP2I DEV PaaS OrgV2 VPC Gen1 as user MY_EMAIL...
ID     Name     Status      Subnet    CIDR        Addresses  ACL     Public Gateway   VPC             Zone
ID#1   NAME#1   available   RANGE#1   53/64       NETACLID   -       VPNNAME   ZONE#1
ID#2   NAME#2   available   RANGE#2   54/64       NETACLID   -       VPNNAME   ZONE#2
ID#3   NAME#3   available   RANGE#3   57/64       NETACLID   -       VPNNAME   ZONE#3
@ChapChap
Copy link
Author

For Information : distinctcount = 3

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

No branches or pull requests

1 participant