Comments (5)
Hi.
I think this is what you mean:
var template = new Template
{
Parameters = new Parameters
{
new Parameter
{
LogicalId = "NetworkStack",
Description = "Name of network stack",
Type = ParameterType.String
}
},
Resources = new Resources
{
new Comformation.CloudFormation.Stack.StackResource
{
LogicalId = "WebsiteAndALB",
Properties =
{
TemplateURL = "https://xxxx.yaml",
Parameters = new Dictionary<string, Union<string, IntrinsicFunction>>
{
{ "ALBSubnets", Fn.ImportValue(Fn.Sub("${NetworkStack}-PublicSubnets")) }
}
}
}
}
};
from comformation.
kinda... the part I can't get the syntax on is replicating this:
Subnets: !Ref ALBSubnets
I'm trying to recreate it like this somehow...
var loadBalancer = new Comformation.ElasticLoadBalancingV2.LoadBalancer.LoadBalancerResource()
{
Properties =
{
Name = EnvironmentName,
Subnets = new List<Dictionary<string, Union<string, IntrinsicFunction>>>
{
Fn.Ref("ALBSubnets") /// ??? broken
}
}
};
from comformation.
The syntax should be
var template = new Template
{
Parameters = new Parameters
{
new Parameter
{
LogicalId = "ALBSubnets",
Type = ParameterType.SubnetIdList,
Description = "Choose which subnets the Application Load Balancer should be deployed to"
}
},
Resources = new Resources
{
new Comformation.ElasticLoadBalancingV2.LoadBalancer.LoadBalancerResource
{
LogicalId = "LoadBalancer",
Properties =
{
Subnets = new List<Union<string, IntrinsicFunction>>
{
Fn.Ref("ALBSubnets")
}
}
}
}
};
but it will generate wrong cf template. So its a bug. Thanks for finding it.
On a fast look the Subnets property type should be Union<IntrinsicFunction, List<Union<string, IntrinsicFunction>>>.
As a workaround until I fix it you can declare new resource class
public class LoadBalancerResourceFixed : Comformation.ElasticLoadBalancingV2.LoadBalancer.LoadBalancerResource
{
public class LoadBalancerPropertiesFixed : Comformation.ElasticLoadBalancingV2.LoadBalancer.LoadBalancerResource.LoadBalancerProperties
{
public new Union<IntrinsicFunction, List<Union<string, IntrinsicFunction>>> Subnets { get; set; }
}
public new LoadBalancerResourceFixed.LoadBalancerPropertiesFixed Properties { get; } = new LoadBalancerResourceFixed.LoadBalancerPropertiesFixed();
}
and then you can use
var template = new Template
{
Parameters = new Parameters
{
new Parameter
{
LogicalId = "ALBSubnets",
Type = ParameterType.SubnetIdList,
Description = "Choose which subnets the Application Load Balancer should be deployed to"
}
},
Resources = new Resources
{
new LoadBalancerResourceFixed
{
LogicalId = "LoadBalancer",
Properties =
{
Subnets = Fn.Ref("ALBSubnets")
}
}
}
};
I have to think how to fix it globally without breaking backward compatibility.
from comformation.
from comformation.
This compiles. I'll keep testing and keep an eye out for your next release.
Cheers
from comformation.
Related Issues (2)
- s3 PolicyDocument HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from comformation.