quiet-gpu-97093
01/17/2024, 3:24 PMpulumi up
or pulumi preview
I see everything in the "plan" besides the policies, but when I approve after up
, the policies show up as added.
2. I created one of the topics outside of Pulumi. In the Pulumi code I have the resource with the same name. When I run Pulumi up, it does not complain about the inability to create the topic as it already exists, but it fails when trying to create the budget instead, saying: error: 1 error occurred:
* creating urn:pulumi:test::mimoze-kotlin-test::aws:budgets/budget:Budget::budget: 1 error occurred: * creating Budget (<account_number>:pulumi-budget) notifications: DuplicateRecordException: Unable to create notification: { notificationType: ACTUAL, comparisionOperator: EQUAL_TO, threshold: 100.0 } for budget: pulumi-budget - the notification already exists.
so the budget isn't completely created, but the creation of the topic itself is marked as succeeded. When I do a pulumi destroy
, pulumi will destroy all the resources, including the one which was initially created outside of it. Note that I didn't do any import of that resource manually or in code, but somehow it seems to have been imported during "up", otherwise I don't see how it would be added to the state and then later destroyed. I find it strange that that import would happen without warning.quiet-gpu-97093
01/17/2024, 3:24 PMadorable-house-61348
01/18/2024, 5:55 PMquiet-gpu-97093
01/19/2024, 8:51 AMaws sns create-topic --name budget_exceeded_topic --tags Key=CLI,Value=True
), then I get this error message that stops the creation: An error occurred (InvalidParameter) when calling the CreateTopic operation: Invalid parameter: Tags Reason: Topic already exists with different tags
. In the case of Pulumi, it still somehow takes over the existing topic and updates it with its specified config.adorable-house-61348
01/19/2024, 10:31 AMimport pulumi
import pulumi_aws as aws
topic = aws.sns.Topic(
"topic", aws.sns.TopicArgs(name="my-topic-vvm", tags={"tag1": "val"})
)
if pulumi.config.Config().get("change_tags"):
topic_with_different_tags = aws.sns.Topic(
"topic_with_different_tags",
aws.sns.TopicArgs(name="my-topic-vvm", tags={"tag1": "val2"}),
)
The steps to repro are:
1. pulumi up
2. pulumi config set change_tags true
3. pulumi up
If you can reproduce the behaviour with the silent failure, I'd be very grateful if you can raise an issue with that!
Edit: my repro is in Python but feel free to use whatever language you prefer!adorable-house-61348
01/19/2024, 10:34 AMquiet-gpu-97093
01/19/2024, 11:11 AMadorable-house-61348
01/19/2024, 11:12 AMquiet-gpu-97093
01/19/2024, 11:14 AMadorable-house-61348
01/19/2024, 11:15 AMadorable-house-61348
01/19/2024, 11:15 AMadorable-house-61348
01/19/2024, 11:16 AMquiet-gpu-97093
01/19/2024, 3:15 PMadorable-house-61348
01/19/2024, 3:21 PMDuring some program executions, apply doesn't run. For example, it won't run during a preview, when resource output values may be unknown. Therefore, you should avoid side-effects within the callbacks. For this reason, you should not allocate new resources inside of your callbacks either, as it could lead to pulumi preview being wrong.
adorable-house-61348
01/19/2024, 3:22 PM