https://pulumi.com logo
#aws
Title
# aws
c

creamy-knife-93354

10/13/2022, 10:50 AM
Hi guys, I needed to renumber a few subnets (effectively use a different CIDR). I was hoping Pulumi would sort everything out itself (😇) , but unfortunately that doesn't seem to be the case:
Copy code
aws:elasticache:SubnetGroup (development-redis-cluster-subnet-group)
    error: 1 error occurred:
	* updating urn:pulumi:development::infrastructure::aws:elasticache/subnetGroup:SubnetGroup::development-redis-cluster-subnet-group: 1 error occurred:
	* error updating ElastiCache Subnet Group (development-redis-cluster-subnet-group-d9a2442): SubnetInUse: The subnet ID subnet-080131aac7c84ef96 is in use.
	status code: 400, request id: 0ef21b3e-3cb0-42ac-8f71-deda19664e99
 
  aws:memorydb:SubnetGroup (development-memorydb-subnetgroup)
    error: 1 error occurred:
	* updating urn:pulumi:development::infrastructure::aws:memorydb/subnetGroup:SubnetGroup::development-memorydb-subnetgroup: 1 error occurred:
	* error updating MemoryDB Subnet Group (development-memorydb-subnetgroup-605fbe7): SubnetInUse: The subnet IDs subnet-0f6fd73e1a386d9dd,subnet-080131aac7c84ef96 are in use.
 
  aws:rds:SubnetGroup (development-postgresql-subnetgroup)
    error: 1 error occurred:
	* updating urn:pulumi:development::infrastructure::aws:rds/subnetGroup:SubnetGroup::development-postgresql-subnetgroup: 1 error occurred:
	* InvalidParameterValue: Some of the subnets to be deleted are currently in use: subnet-080131aac7c84ef96
	status code: 400, request id: bf6bd299-5566-47f5-933f-227c0a200119
What's the general recommendation to be able to perfom such changes successfully? Or more concretely, how do I fix this? 😄
So, managed to get past those errors by using
ReplaceOnChanges
on those subnet groups.
Copy code
ReplaceOnChanges = new List<string> { "*" }
But now I'm hitting the next error,
You cannot move DB instance development-postgresql5cf0ed8 to subnet group development-postgresql-subnetgroup-d532d2f. The specified DB subnet group and DB instance are in the same VPC. Choose a DB subnet group in different VPC than the specified DB instance and try again.
So apparently you can only change the subnet group of an RDS instance if you are also moving it to a different VPC. That's a bit unfortunate. 😞
Worked around that by moving the instance to the default VPC from the AWS console. Then, the second time,
pulumi up
was successful. All is well 🥳
2 Views