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

jolly-hairdresser-94931

02/15/2024, 12:30 AM
Hello! Spent more than 8 hours on this issue - or I am not sure of its intension if it was intended. Q: How to avoid replacement of AWS API Gateway Integration (awsapigatewayIntegration) when there are NO changes to its configuration? Everytime I run pulumi up command (with no changes to the code), these Integrations seem to replace. Due to this, or for some reason, the Integration Responses are deleted from AWS and not from the Pulumi state file. When this happens on OPTIONS method, it breaks my CORS setting and the site cannot be reached. Subsequent pulumi up runs are of no use to bring those Integration Responses up. As a workaround, I have to run pulumi preview - after which Pulumi then correctly identifies that Integration Responses have been deleted from AWS, and need to adjust the state accordingly - which I do by selecting "yes". Then I run pulumi up again and the Integration Responses are back there. Works well until I run pulumi up again for some other changes or no changes. How to ensure: 1. either, not to replace Integration resource everytime 2. or, not to delete Integration Responses even after replacement?
l

little-cartoon-10569

02/15/2024, 12:40 AM
What reason is Pulumi giving for replacing the Integrations?
pulumi preview --diff
can help with that. Also you might post this, with code (use the code snippet) over in #aws.
j

jolly-hairdresser-94931

02/15/2024, 12:50 AM
The --diff says integrationHttpMethod and uri are newly added. But thats not true. Although, I should mention that the uri is being read from another pulumi stack reference. But the value is always same. Sure I will post it on #aws as well with code snippet soon. Thank you..
l

little-cartoon-10569

02/15/2024, 1:23 AM
That may well be the issue. I'll check the code over there.
j

jolly-hairdresser-94931

02/20/2024, 10:19 PM
RESOLVED: I was able to solve this. The replacement was caused because I was using IntegrationHttpMethod attribute for configuring OPTIONS method as well which is not required. Once removed, there were no replacements.