Closed oanhnn closed 3 years ago
Hello, I just encountered the same issue on EC2, probably setting it the way below should accept it? hope this helps
linux_parameters = {
"capabilities" = {
add = []
drop = []
}
"devices" = []
"initProcessEnabled" = true
"maxSwap" = null
"sharedMemorySize" = null
"swappiness" = null
"tmpfs" = []
}
In terraform, optional arguments are still not GA and so if we set an input variable as a defined object type, like we do with linux_parameters, then every key has to be defined unfortunately.
The only other option is to set an object type of simply map but then we don't get the plan time validation of correct inputs. The ideal would be both optional object arguments and plan time validation.
The solution @gannino pointed out is unsatisfyingly verbose but correct.
Describe the Feature
Allow set parameter
Expected Behavior
Generate json with:
Use Case
When using ECS Fargate, some options like
sharedMemorySize
is not supported. If i set onlyinitProcessEnabled
then this module will throw errorBut if i set full options,
aws_ecs_task_definition
resource will throw errorhttps://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LinuxParameters.html