Hello. I'm trying to create a cloudwatch EventTarg...
# aws
Hello. I'm trying to create a cloudwatch EventTarget and am getting this less-than-helpful error message:
Creating EventBridge Target failed: ValidationException: Parameter(s) EcsParameters not supported for target
Here's the resource code. Is there an error in the code? Or a way to get more information about the failure? Thank you.
Copy code
const eventTarget = pulumi.all([subnetIds.ids, taskDefinition.taskDefinition.arn, deadLetterQueue.arn])
    .apply(([subnetIds, taskDefinitionArn, deadLetterQueueArn]) => new aws.cloudwatch.EventTarget("event-target", {
        arn: deadLetterQueueArn,
        name: `${pulumi.getProject()}-event-target`,
        description: genericDescription,
        ecsTarget: {
            taskDefinitionArn: taskDefinitionArn,
            enableEcsManagedTags: true,
            enableExecuteCommand: true,
            group: pulumi.getProject(),
            launchType: "FARGATE",
            networkConfiguration: {
                assignPublicIp: false,
                securityGroups: [securityGroupId],
                subnets: subnetIds,
            platformVersion: "1.4.0",
            taskCount: 1,
        eventBusName: "default",
        retryPolicy: {
            maximumEventAgeInSeconds: 60,
            maximumRetryAttempts: 1,
        rule: eventRule.name,
    }, {provider: targetAwsProvider}));
The inputs are fine:
Copy code
pulumi.all([subnetIds.ids, taskDefinition.taskDefinition.arn, deadLetterQueue.arn])
    .apply(([subnetIds, taskDefinitionArn, deadLetterQueueArn]) => console.log([subnetIds, taskDefinitionArn, deadLetterQueueArn]))
Copy code
      [ 'subnet-<redacted>', 'subnet-<redacted>' ],
Can you post the event rule?
I believe the problem is the
- that should point to the target ECS cluster.
👀 1
There's an example in the TF docs that gets dropped by our conversion process for reasons we would need to investigate (and fix), but that's how I figured it out: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_target#example-ecs-run-task-w[…]and-task-override-usage
Folks running into difficulties because of dropped examples in the docs is a common issue with our users and a current area of focus for us. When you have a minute, please let me know if the solution worked for you.
Will update, thanks!
Copy code
const eventRule = new aws.cloudwatch.EventRule("event-rule", {
    name: `${pulumi.getProject()}-event-rule`,
    description: genericDescription,
    eventBusName: "default",
    scheduleExpression: "cron(1 0 * * ? *)",
}, {provider: targetAwsProvider});
Yes, the
docs define
ARN of the SQS queue specified as the target for the dead-letter queue.
success! Updating the
to the cluster arn allowed the resource creation to finish. Thank you @stocky-restaurant-98004
You're most welcome!