wide-activity-54187
06/04/2021, 12:55 PMbillowy-army-68599
06/04/2021, 4:26 PMwide-activity-54187
06/04/2021, 5:40 PMenvironments:
- name: stage
web:
sites:
- name: my-site
fqdns:
- <http://foo.bar.com|foo.bar.com>
- <http://bar.com|bar.com>
And then for each of those web.sites
, I want to create a deployment. Right now I’m just hard coding things in and trying to get the loop to run and I think I’m on the right path with DeploymentList. But basically I want this:
func Deployments(pCtx *pulumi.Context, envConfig config.Environment, repoConfig config.Repo) apps.DeploymentTypeArrayOutput {
var deploymentListArgs *apps.DeploymentListArgs
deployments, err := apps.NewDeploymentList(pCtx, <site.name>, deploymentListArgs)
for _ = range envConfig.Web.Sites {
deployment, _ := apps.NewDeployment(pCtx, <site.name>, &apps.DeploymentArgs{
....
})
deployments.Items.ApplyT(deployment)
}
if err != nil {
panic(err)
}
return deployments.Items
}
Deployments
function, I looped where it was called