little-cartoon-10569
02/20/2026, 12:57 AMlittle-cartoon-10569
02/20/2026, 12:58 AMechoing-dinner-19531
02/20/2026, 7:06 AMechoing-dinner-19531
02/20/2026, 7:08 AMlittle-cartoon-10569
02/22/2026, 11:38 PM@"${{ ... syntax. I'm trying to find something using Output.JsonSerialize<PolicyDocumentArgs> that works, but my C# is still letting me down -- too many years of TypeScript, I guess.
Even my simplest MVCE is complaining:
new RolePolicy("test", new Iam.RolePolicyArgs {
Role = role.Id,
Policy = Output.JsonSerialize<PolicyDocumentArgs>(new PolicyDocumentArgs {})
});
With
error CS1503: Argument 1: cannot convert from 'Pulumi.Aws.Iam.Inputs.PolicyDocumentArgs' to 'Pulumi.Output<Pulumi.Aws.Iam.Inputs.PolicyDocumentArgs>'
I did find the AssumeRolePolicyArgs etc. code in the example GitHub;s aws-cs-assume-role project, but that seems to be missing a trick too. Isn't AssumeRolePolicyArgs in CreateRoleStack.cs just a re-implementation of Pulumi.Aws.Iam.Inputs.PolicyDocumentArgs?little-cartoon-10569
02/22/2026, 11:45 PM["Version"] = "2012-10-17", syntax and being able to use the much nicer Version = PolicyDocumentVersion.PolicyDocumentVersion_2012_10_17 syntax.little-cartoon-10569
02/22/2026, 11:46 PMlittle-cartoon-10569
02/22/2026, 11:55 PMvar policy = Output.JsonSerialize(new
{
Version = "2012-10-17",
Statement = new[]
{
new
{
Effect = "Allow",
Action = "s3:GetObject",
Resource = Output.Format("{0}/*", bucket.Arn)
}
}
});
But that doesn't compile for me, JsonSerialize insists on having an Output as a parameter.little-cartoon-10569
02/23/2026, 12:17 AMvar policy = new Policy("test", new Iam.PolicyArgs
{
PolicyDocument = Output.JsonSerialize<Iam.GetPolicyDocumentResult>(GetPolicyDocument.Invoke(new()
{
Statements = new[]
{
new GetPolicyDocumentStatementInputArgs
{
Effect = PolicyStatementEffect.ALLOW.ToString(),
Actions = [
"dynamodb:PutItem" ,
"dynamodb:GetItem"
],
Resources = table.Arn
}
}
}))
});little-cartoon-10569
02/23/2026, 12:19 AMechoing-dinner-19531
02/23/2026, 9:07 AMBut that doesn't compile for me, JsonSerialize insists on having an Output as a parameter.Any value can be lifted up to be an Output version of that value with
Output.Create(val).echoing-dinner-19531
02/23/2026, 9:07 AM