pulumi-aws
pulumi-aws copied to clipboard
cannot import existing TargetGroupAttachment
i'm working on splitting a project into two, using stack dependencies, and stuck on a TargetGroupAttachment which doesn't seem to want to import.
$ pulumi up
[...]
Diagnostics:
aws:lb:TargetGroupAttachment (helloTargetGroupAttachment):
error: Preview failed: refreshing urn:pulumi:dev::hello::aws:lb/targetGroupAttachment:TargetGroupAttachment::helloTargetGroupAttachment: 1 error occurred:
* Error reading Target Health: ValidationError: A target group ARN must be specified
status code: 400, request id: 3f607063-dfa1-46c7-983e-4c63849c6066
My code looks like this:
lb.TargetGroupAttachment("helloTargetGroupAttachment",
target_group_arn=hello_target_group.arn,
target_id=hello_fn.arn,
opts=pulumi.resource.ResourceOptions(
# depends_on=[hello_target_group, hello_fn],
import_='arn:aws:elasticloadbalancing:<REGION>:<ACCOUNT>:targetgroup/helloTargetGroup-7e81281/<...>'
)
)
Removing the _import
argument, pulumi up
previews an identical state to the state in the original stack (aside from the ID, which doesn't exist yet), so i know the target_group_arn
and target_id
values are correct. All the related infra is imported successfully.
i also tried a pulumi refresh
on the whole stack, but that didn't change the behavior.
At this time, the provider doesn't support importing target group attachments (https://www.pulumi.com/docs/reference/pkg/aws/lb/targetgroupattachment/#import)
@leezen so to split a stack into two stacks, i could do this bit by manually updating the state?
@smcoll Yes, I think that's likely the best way to go about it right now.