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

clever-kite-79772

10/17/2023, 2:57 PM
Hi All, Can someone help with
Copy code
retain_on_delete
I have the code:
Copy code
aws_db_parameter_group = aws.rds.ParameterGroup(
    resource_name="aws_db_parameter_group",
    name=parameter_group_name,
    description=f"{parameter_group_name} parameter group",
    family=f"postgres{rds_config['engine_version'].split('.')[0]}",
    parameters=[aws.rds.ParameterGroupParameterArgs(
        name=parameter["name"],
        value=parameter["value"],
        apply_method=parameter.get("apply_method", None)
    ) for parameter in parameter_group_parameters
    ],
    tags={
             "Name": parameter_group_name
         } | tags,
    opts=pulumi.ResourceOptions(
        retain_on_delete=True
    )
)
But when I'd like to replace it I have the error:
Copy code
deleting RDS DB Parameter Group (test-postgres-postgres-12): operation error RDS: DeleteDBParameterGroup, https response error StatusCode: 400, RequestID: ......, InvalidDBParameterGroupState: One or more database instances are still members of this parameter group test-postgres-postgres-12, so the group cannot be deleted
How is it possible if the resource is marked as retain?
The problem was solved. I had to update the state without changes.