This message was deleted.
# general
s
This message was deleted.
b
hey! it's a little difficult to track what's happening here without seeing some code, are you able to share?
b
Apologies.
export interface BatchProcessingArgs {     stackName: string;     securityGroupIds: string[] | Array<Output<string>>;     subnetIds: Output<string[]> | Output<string>[];     instanceTypes: string[] | Array<Output<string>>;     maxVcpus: number | Output<number>;     minVcpus: number | Output<number>;     resourceType: "EC2" | "SPOT"; } export class BatchProcessing extends pulumi.ComponentResource {     public queueId: Output<string>;     constructor(name: string, args: BatchProcessingArgs, opts?: pulumi.CustomResourceOptions) {         super("Batch", name, args, opts);         const ecsInstanceRoleRole = new aws.iam.Role(
${args.stackName}_${name}_ecsInstanceRoleRole
, {             assumeRolePolicy: 
Copy code
{
                "Version": "2012-10-17",
                "Statement": [
                {
                    "Action": "sts:AssumeRole",
                    "Effect": "Allow",
                    "Principal": {
                    "Service": "<http://ec2.amazonaws.com|ec2.amazonaws.com>"
                    }
                }
                ]
            }
});         const ecsInstanceRoleInstanceProfile = new aws.iam.InstanceProfile(
${args.stackName}_${name}_ecsInstanceRoleInstanceProfile
, { role: ecsInstanceRoleRole.name });         const awsBatchServiceRoleRole = new aws.iam.Role(
${args.stackName}_${name}_awsBatchServiceRoleRole
, {             assumeRolePolicy: 
Copy code
{
                "Version": "2012-10-17",
                "Statement": [
                {
                    "Action": "sts:AssumeRole",
                    "Effect": "Allow",
                    "Principal": {
                    "Service": "<http://batch.amazonaws.com|batch.amazonaws.com>"
                    }
                }
                ]
            }
});         const awsBatchServiceRoleRolePolicyAttachment = new aws.iam.RolePolicyAttachment(
${args.stackName}_${name}_awsBatchServiceRoleRolePolicyAttachment
, {             role: awsBatchServiceRoleRole.name,             policyArn: "arnawsiam:awspolicy/service-role/AWSBatchServiceRole",         });         const computeEnvironment = new aws.batch.ComputeEnvironment(
${args.stackName}-${name}-sampleComputeEnvironment
, {             computeEnvironmentName: 
${args.stackName}_${name}_computeEnvironment
,             computeResources: {                 instanceRole: ecsInstanceRoleInstanceProfile.arn,                 instanceTypes: args.instanceTypes,                 maxVcpus: args.maxVcpus,                 minVcpus: args.minVcpus,                 securityGroupIds: args.securityGroupIds,                 subnets: args.subnetIds,                 type: args.resourceType,             },             serviceRole: awsBatchServiceRoleRole.arn,             type: "MANAGED",         },             {                 dependsOn: [awsBatchServiceRoleRolePolicyAttachment],             });         const queue = new aws.batch.JobQueue(
${args.stackName}_${name}_jobQueue
, {             state: "ENABLED",             priority: 1,             computeEnvironments: [                 computeEnvironment.arn             ],         });         this.queueId = queue.id;     } }
b
would be great if you could wrap it in three backticks
regarding whyyhis might be happening, you're setting `computeEnvironmentName`: I'm wondering if there's a batch already there? can you try remove this and let pulumi autoname it
b
It appears removing computeEnvironmentName resolved the issue. Is this name supposed to be something other than the actual resource name?
b
have a read of this: https://www.pulumi.com/docs/intro/concepts/resources/#names especially the part about auto-naming