sparse-intern-71089
10/06/2020, 12:47 AMworried-city-86458
10/06/2020, 3:08 AMPolicyDocument
in .NET/C# using Output.Tuple
as follows:
private static Output<string> AssumeRoleForServiceAccount(Output<string> oidcArn, Output<string> oidcUrl, string saNamespace, string saName) =>
Output.Tuple(oidcArn, oidcUrl).Apply(((string OidcArn, string OidcUrl)tuple) => GetPolicyDocument.InvokeAsync(
new GetPolicyDocumentArgs
{
Statements =
{
new GetPolicyDocumentStatementArgs
{
Effect = "Allow",
Principals =
{
new GetPolicyDocumentStatementPrincipalArgs
{
Type = "Federated",
Identifiers = { tuple.OidcArn }
}
},
Actions = { "sts:AssumeRoleWithWebIdentity" },
Conditions =
{
new GetPolicyDocumentStatementConditionArgs
{
Test = "StringEquals",
Values = { $"system:serviceaccount:{saNamespace}:{saName}" },
Variable = $"{tuple.OidcUrl}:sub"
}
}
}
}
})).Apply(policy => policy.Json);
The sample principle would apply to TypeScriptkind-mechanic-53546
10/06/2020, 10:52 AMkind-mechanic-53546
10/06/2020, 10:53 AMconst assumeDevelopersRolePolicyData = devRole.name.apply((name) => {
return aws.iam.getPolicyDocument({
version: "2012-10-17",
statements: [
{
effect: "Allow",
actions: ["sts:AssumeRole"],
resources: [`arn:aws:iam::${dev_account_id}:role/${name}`],
},
],
});
});
kind-mechanic-53546
10/06/2020, 10:55 AMkind-mechanic-53546
10/06/2020, 10:56 AMkind-mechanic-53546
10/06/2020, 10:56 AMkind-mechanic-53546
10/06/2020, 10:56 AMmillions-furniture-75402
10/06/2020, 12:56 PMmillions-furniture-75402
10/06/2020, 12:58 PMmillions-furniture-75402
10/06/2020, 12:59 PMdevRole.arn
โ in which case you should be able to just specify that,kind-mechanic-53546
10/06/2020, 9:07 PMkind-mechanic-53546
10/06/2020, 9:07 PM