https://pulumi.com logo
#general
Title
# general
b

blue-judge-71382

06/13/2022, 11:48 PM
I am not sure if this is an reopened bug related to https://github.com/pulumi/pulumi-eks/issues/571
Copy code
+  pulumi:pulumi:Stack Galaxy-AWS_ECS-96471806 **creating failed** 1 error
 
Diagnostics:
  aws:iam:RolePolicyAttachment (task-definition-1142-execution-9a42f520):
    error: 1 error occurred:
    	* creating urn:pulumi:AWS_ECS-96471806::Galaxy::awsx:ecs:FargateTaskDefinition$aws:iam/rolePolicyAttachment:RolePolicyAttachment::task-definition-1142-execution-9a42f520: 1 error occurred:
    	* error reading IAM Role Managed Policy Attachment (task-definition-1142-execution-189233a:arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy): couldn't find resource
 
  pulumi:pulumi:Stack (Galaxy-AWS_ECS-96471806):
    error: update failed
Even though I provide the ResouceOptions.transformations like lblackstone said:
Copy code
{
          transformations: [
            // Update all RolePolicyAttachment resources to use aws-cn ARNs.
            args => {
              if (
                args.type ===
                'aws:iam/rolePolicyAttachment:RolePolicyAttachment'
              ) {
                const arn: string | undefined = args.props['policyArn'];
                if (arn && arn.startsWith('arn:aws:iam')) {
                  args.props['policyArn'] = arn.replace(
                    'arn:aws:iam',
                    'arn:aws-cn:iam'
                  );
                }
                return {
                  props: args.props,
                  opts: args.opts,
                };
              }
              return undefined;
            },
          ],
        }
Is there anyone encounter this issue during creating AWS ECS stack in cn-northwest-1 region? Thanks!
🆘 1
🙏 1
Last time I encountered this issue was when I created AWS EKS stack. But ResourceOptions.transformations solved it.
44 Views