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

On adding existing_vpc_id under vpcs map of landing-zone module, got vpc_data output issue #687

Open
nupurg-ibm opened this issue Dec 13, 2023 · 7 comments
Assignees
Labels
bug 🐞 Something isn't working internal-synced

Comments

@nupurg-ibm
Copy link

  • Did terraform init which downloaded the landing-zone code
  • Then locally updated landing-zone-vpc module version to 7.13.1
  • Now tried adding existing_vpc_id under vpcs map of landing-zone module like below:
vpcs = var.vpc == null ? [
   {
     prefix                       = local.name
     existing_vpc_id              = "r010-b9904587-1eec-43bc-83ce-140abb22534d"
     resource_group               = var.resource_group == null ? "workload-rg" : var.resource_group
     clean_default_security_group = true
     clean_default_acl            = true
     flow_logs_bucket_name        = var.enable_vpc_flow_logs ? "vpc-flow-logs-bucket" : null
     network_acls = [
       {
         name              = "hpc-acl"
         add_cluster_rules = false
         rules             = local.network_acl_rules
       }
     ],
     subnets             = local.subnets
     use_public_gateways = local.use_public_gateways
     address_prefixes    = local.address_prefixes
   }
 ] : []
  • This gave error:
│ Error: Unsupported attribute
│ 
│   on .terraform/modules/hpc.landing_zone.landing_zone/outputs.tf line 210, in output "vpc_resource_list":
│  210:       name              = vpc.vpc_data.name
│     ├────────────────
│     │ vpc.vpc_data is tuple with 1 element
│ 
│ This value does not have any attributes.
╵
╷
│ Error: Unsupported attribute
│ 
│   on .terraform/modules/hpc.landing_zone.landing_zone/outputs.tf line 211, in output "vpc_resource_list":
│  211:       resource_group_id = vpc.vpc_data.resource_group
│     ├────────────────
│     │ vpc.vpc_data is tuple with 1 element
│ 
│ This value does not have any attributes.
╵
╷
│ Error: Unsupported attribute
│ 
│   on .terraform/modules/hpc.landing_zone.landing_zone/outputs.tf line 214, in output "vpc_resource_list":
│  214:         cluster.id if cluster.vpc_id == vpc.vpc_data.id
│     ├────────────────
│     │ vpc.vpc_data is tuple with 1 element
│ 
│ This value does not have any attributes. 
@nupurg-ibm nupurg-ibm added the bug 🐞 Something isn't working label Dec 13, 2023
@ocofaigh
Copy link
Member

Thanks, we are aware of the issue and already working on this fix

@nupurg-ibm
Copy link
Author

Just to validate I commented:

# output "vpc_resource_list" {
#   description = "List of VPC with VSI and Cluster deployed on the VPC."
#   value = [
#     for vpc in module.vpc :
#     {
#       id                = vpc.vpc_data.id
#       name              = vpc.vpc_data.name
#       resource_group_id = vpc.vpc_data.resource_group
#       region            = var.region
#       clusters = flatten([for cluster in ibm_container_vpc_cluster.cluster :
#         cluster.id if cluster.vpc_id == vpc.vpc_data.id
#       ])
#       vsi = distinct(flatten([
#         [
#           for group in keys(local.vsi_map) :
#           [
#             for deployment in module.vsi[group].list :
#             module.vsi[group].ids if vpc.vpc_data.id == deployment.vpc_id
#           ]
#         ]
#       ]))
#     }
#   ]
# }

Now deployment happened but the existing_vpc_id which I passed with vpcs is not considered and it created new vpc and considered that one only for othe resources creation.

@ocofaigh
Copy link
Member

PR -> #688

@nupurg-ibm
Copy link
Author

Thanks, Any timeline when we are planning to integrate existing vpc and existing subnet with landing-zone root module as discussed?

@toddgiguere
Copy link
Contributor

@nupurg-ibm The feature to add "existing_vpc_id" parameter to landing_zone inputs has not been released yet, and is still in development. We will need a new release of landing_zone for this feature.

@nupurg-ibm
Copy link
Author

I understand @toddgiguere . Do we have any tentative timeline when we are planning to release new version of landing_zone with this feature?

@toddgiguere
Copy link
Contributor

Do not have timeline yet, but I'm getting closer. When I have something working on my fork I could use some extra testing? I'll let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working internal-synced
Projects
None yet
Development

No branches or pull requests

4 participants