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

rough-sunset-94098

12/02/2023, 1:34 AM
Hello - I'm facing the following error while trying to update the rest api in AWS API Gateway. Did some research and found out that by setting
create_before_destroy=true
in the lifecycle section on deployment resource, it will get rid of that problem. This solution works on terraform side but I didn't see any such option on the Pulumi side to set the lifecycle section on
aws._*apigateway*_._*Deployment*_
resource.
BadRequestException: Active stages pointing to this deployment must be moved or deleted
e

echoing-dinner-19531

12/02/2023, 11:47 AM
Pulumi doesn't support destroy before create currently (see https://github.com/pulumi/pulumi/issues/2877). You'll probably have to do this as two updates.
r

rough-sunset-94098

12/04/2023, 6:23 PM
@echoing-dinner-19531 - I'm looking for
create_before_destroy
flag on the API Gateway deployment resource so that it creates the new resource before it tries to delete the existing depploymentresource because an active stage is pointing to it.
Also, It's not very clear to me from GitHub issue how to do 2 updates to re-deploy the API Gateway related changes.
e

echoing-dinner-19531

12/04/2023, 6:26 PM
Ah right sorry got words flipped around. Pulumi's default behaviour matches terraforms of create_before_destroy=true, so you shouldn't have to do anything.
If your creating a new API gateway resource you'll need to do that in two steps though. One
pulumi up
to delete teh current gateway, then add the new gateway resource and
pulumi up
again.
r

rough-sunset-94098

12/04/2023, 6:29 PM
I'm creating a child resource of the parent resource.. so do i still need to delete the whole gateway ?
or just the resource part in the gateway ?
e

echoing-dinner-19531

12/04/2023, 6:32 PM
I don't know API gateway well enough to say for sure. I'd suspect not, but see what errors happen.
r

rough-sunset-94098

12/04/2023, 6:34 PM
ok, no worries. will try and let you know how it goes.
@echoing-dinner-19531 - is there a way to specify the json filename (instead of actual contents) as the value of a key in stack configuration file ?
e

echoing-dinner-19531

12/08/2023, 8:41 PM
Not currently, some thinking around that in https://github.com/pulumi/pulumi/issues/11872
r

rough-sunset-94098

12/08/2023, 9:01 PM
got it, thanks