I am using sceptre and troposphere to generate my architecture.
In AWS Batch Job Definition, I want to parameterize the Environment of the job definition's container properties:
The environment is a list of https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-environment.html.
But in the context of sceptre, it doesn't seem like I can declare something like this:
self.JobDefinitionEnvironment = t.add_parameter(Parameter(
'JobDefinitionEnvironment',
Type='List<AWS::Batch::JobDefinition::Environment>'
))
In sceptre:
Do I have to write my own resolver to solve this problem? Even if I write my own resolver to resolve JobDefintion::Environment, the resolver returns only a string, not a list of objects.
Am I not supposed to parameterize the container properties and hardcode the values in the job-definition.py?
I am currently working around by "flatten" out the object, so I can supply the values. Kinda ugly.
Please help!
I'm not sure what you can do with sceptre, but with stacker (http://stacker.readthedocs.io/en/latest) you would just make the definition list a variable, and then use that variable in your blueprint (which is written in troposphere).
An example that might make sense is the open source ECS blueprint:
https://github.com/cloudtools/stacker_blueprints/blob/master/stacker_blueprints/ecs.py#L69-L74 (Where the variable is defined)
https://github.com/cloudtools/stacker_blueprints/blob/master/stacker_blueprints/ecs.py#L69-L74 (where we turn the variable dictionary into a list of objects like ECS expects)
https://github.com/cloudtools/stacker_blueprints/blob/master/stacker_blueprints/ecs.py#L296 (where that is used in the container definition)
Sorry I don't know sceptre well though. Not sure if you're stuck using it, or if stacker is potentially useful to you.