boundless-farmer-38967
04/06/2023, 12:26 PMtaskRole
, but it keeps rejecting it:
const fargateTaskRole = new aws.iam.Role(`${appName}-fargate-task`, {
assumeRolePolicy: JSON.stringify({
Version: "2012-10-17",
Statement: [
...
],
}),
});
const appService = new awsx.ecs.FargateService(`${appName}-app-svc`, {
cluster: cluster.arn,
desiredCount: 0,
taskDefinitionArgs: {
taskRole: fargateTaskRole,
container: {
name: `${appName}-sync-container`,
image: img.imageUri,
cpu: 102,
memory: 50,
},
},
...
});
It won't allow me to assign fargateTaskRole to taskRole. The error is:
Type 'Role' has no properties in common with type 'DefaultRoleWithPolicyArgs'.Thanks!
steep-toddler-94095
04/07/2023, 2:26 AMDefaultRoleWithPolicyArgs
type if you are... it's
interface DefaultRoleWithPolicyArgs {
/**
* Args to use when creating the role and policies. Can't be specified if `roleArn` is used.
*/
args?: inputs.awsx.RoleWithPolicyArgs;
/**
* ARN of existing role to use instead of creating a new role. Cannot be used in combination with `args` or `opts`.
*/
roleArn?: pulumi.Input<string>;
/**
* Skips creation of the role if set to `true`.
*/
skip?: boolean;
}
so basically instead of
taskDefinitionArgs: {
taskRole: fargateTaskRole,
you need
taskDefinitionArgs: {
taskRole: { roleArn: fargateTaskRole.arn },
boundless-farmer-38967
04/07/2023, 6:37 AM