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

Feedback on Modules #490

Closed
Wzack opened this issue Sep 15, 2020 · 6 comments
Closed

Feedback on Modules #490

Wzack opened this issue Sep 15, 2020 · 6 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@Wzack
Copy link

Wzack commented Sep 15, 2020

I recently worked on a project to create a large environment creating 36 VMs via 16 linked ARM templates.
One of the awkward things to do with ARM is passing Outputs between linked template deployments.
I would hope that the implementation of "Modules" that was mentioned would make that a lot easier.

@Wzack Wzack added the enhancement New feature or request label Sep 15, 2020
@ghost ghost added the Needs: Triage 🔍 label Sep 15, 2020
@alex-frankel
Copy link
Collaborator

Will can you provide a bit more context into what was awkward about passing outputs? Was it the syntax being too verbose? Was there not enough tooling support so you couldn't see which outputs were available for a given linked template?

@alex-frankel alex-frankel added question Further information is requested and removed Needs: Triage 🔍 labels Sep 15, 2020
@Wzack
Copy link
Author

Wzack commented Sep 16, 2020

Passing parameters (outputs) back and forth between linked templates should be like calling a subroutine in a program, passing parameters and getting return values. This should be true even though the linked deployments are run in parallel. I know that you can work with dependencies but it is a bit awkward.

@alex-frankel
Copy link
Collaborator

Can you provide a little pseudo-code to express what your ideal would look like?

Based on the current spec, passing values between modules will look something like this:

In main.bicep:

param namePrefix string
param location string

module dataTier './modules/dataTier.bicep' = {
  namePrefix: namePrefix
  location: location
  size: 'Large'
}

module backend './modules/backend.bicep' = {
  namePrefix: namePrefix
  port: 80
  size: 'Medium'
  dataConnectionString: dataTier.outputs.connectionString // passing values between modules, dependency would be automatically determined
}

output backendUrl string = backend.outputs.backendUrl

Is that close to what you would be expecting?

@Wzack
Copy link
Author

Wzack commented Sep 27, 2020 via email

@alex-frankel alex-frankel self-assigned this Oct 14, 2020
@ctolkien
Copy link

ctolkien commented May 4, 2021

I'll add my 2c to this discussion...

I'd really like modules to be able to output resources.

@alex-frankel
Copy link
Collaborator

alex-frankel commented May 4, 2021

I'd really like modules to be able to output resources.

This is planned and you can see the details of how this is going to work with this 2-part issue:

Going to close this issue as it is a bit stale. @ctolkien - feel free to continue the discussion on that issue thread.

@ghost ghost locked as resolved and limited conversation to collaborators May 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants