-
Notifications
You must be signed in to change notification settings - Fork 21
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
Error: Exactly one of [container]
or [containers]
must be provided
#1325
Comments
Thanks for reporting this @pawelprazak. I'm going to transfer this to pulumi-java as I think the fix probably lies there. |
I believe this is the same issue: pulumi/pulumi-awsx#820 |
What is interesting, is that doing this: var tg = loadBalancer.defaultTargetGroup()
.apply(
t -> t.name().applyValue(
n -> TargetGroup.get(n, t.id(), null, null)
)
); Results in the following error:
Not sure if this is related but I've noticed this while trying to find a workaround, and if it's related it could help pinpoint the exact cause. |
found another problem while working on a workaround, this is a promising workaround: var cluster = new Cluster("cluster");
var loadBalancer = new ApplicationLoadBalancer("lb");
var taskDef = new FargateTaskDefinition("app-task", FargateTaskDefinitionArgs.builder()
.containers(Map.of(
"test", TaskDefinitionContainerDefinitionArgs.builder()
.name("test")
.image("nginx:latest")
.cpu(256)
.memory(512)
.portMappings(
Output.of(loadBalancer.defaultTargetGroup().apply(t -> Output.of(List.of(
TaskDefinitionPortMappingArgs.builder()
.containerPort(80)
.targetGroup(t)
.build()
)))).apply(o -> o)
)
.build()
))
.build()
);
var service = new FargateService("app-service", FargateServiceArgs.builder()
.cluster(cluster.arn())
.assignPublicIp(true)
.taskDefinition(taskDef.taskDefinition().apply(TaskDefinition::arn))
.desiredCount(1)
.build(),
ComponentResourceOptions.builder()
.customTimeouts(CustomTimeouts.builder()
.create(Duration.ofMinutes(60))
.build()
)
.build()
); but results in:
But it looks lika separate issue in the serde implementation on the Java SDK side. |
What happened?
The same Pulumi program that succeeds in TS fails in Java:
I believe this might be because TS (and all other SDKs use the new serializer path, the
keepOutputValues
(specialOutputValueSig
) and Java uses the old output serializer.We can also see this is Besom Scala SDK, that uses the old serializer.
Example
The failing Java program:
And the working TypeScript:
Output of
pulumi about
TypeScript
Java
Additional context
None.
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: