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

sparse-gold-10561

09/22/2022, 2:06 PM
Hello, I am reviewing: https://www.pulumi.com/registry/packages/aws/api-docs/cloudwatch/eventtarget/ based on this documentation, we need an arn parameter and the documentation specifies
ARN of the SQS queue specified as the target for the dead-letter queue.
. However, I am trying to set it as a ECS target and I'm a bit confused as to if the documentation is wrong or if I really need a SQS DQL for an ECS target? Any advice would be great. thanks!
s

stocky-restaurant-98004

09/22/2022, 2:13 PM
The docs are incorrect here, resulting from this issue: https://github.com/pulumi/pulumi-terraform-bridge/issues/529 Could you upvote the issue and also add a comment?
You're referring to this
arn
input, correct?
(There's a lot of
arn
inputs which all share the same incorrect description due to the aforementioned bug.)
s

sparse-gold-10561

09/22/2022, 2:26 PM
yes that line
out of curiosity, do you know what the parameter's object should be if youre doing a ECS target?
im a bit confused.
s

stocky-restaurant-98004

09/22/2022, 3:13 PM
I'm guessing you want the ARN of the ECS task.
I swear someone just asked about this exact use case - let me do a search.
s

sparse-gold-10561

09/22/2022, 3:19 PM
yeah its ECS cluster ARN
s

stocky-restaurant-98004

09/22/2022, 3:19 PM
The correct target is the cluster ARN, not the task ARN?
s

sparse-gold-10561

09/22/2022, 3:19 PM
yeah because the ecs_target= parameter has the task def .arn
im almost 100% certain.. im about to finish it up and deploy it, i will let you know
s

stocky-restaurant-98004

09/22/2022, 3:20 PM
Your lived experience would be the info that matters here. 😉
s

sparse-gold-10561

09/22/2022, 3:20 PM
and even looking at the console, it wants the cluster when trying to do it manually
FYI, it is the cluster ARN
basically something like this
Copy code
reaction_data_event_target = aws.cloudwatch.EventTarget(
    "reaction-data-event-target",
    arn=cluster.arn,
    rule=reaction_data_event_rule.name,
    role_arn=reaction_cloud_event_rule_role.arn,
    ecs_target=aws.cloudwatch.EventTargetEcsTargetArgs(
        task_definition_arn=reaction_data_task.arn,
        enable_execute_command=True,
        launch_type="FARGATE",
        network_configuration=aws.ecs.ServiceNetworkConfigurationArgs(
            assign_public_ip=False,
            subnets=vpc.private_subnet_ids,
            security_groups=[group.id],
        ),
        task_count=1,
    ),
)