Skip to content

Commit 5e85d6d

Browse files
temblekingjar-b
andauthored
fix(codebuild): return error on delete only when is not nil (#29042)
* fix(codebuild): return error on delete only when is not nil Signed-off-by: Federico Barcelona <fede_rico_94@hotmail.com> * chore: changelog --------- Signed-off-by: Federico Barcelona <fede_rico_94@hotmail.com> Co-authored-by: Jared Baker <jared.baker@hashicorp.com>
1 parent 87856e8 commit 5e85d6d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changelog/29042.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
resource/aws_codebuild_project: Fix err check on delete
3+
```

internal/service/codebuild/project.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,10 @@ func resourceProjectDelete(ctx context.Context, d *schema.ResourceData, meta int
16081608
_, err := conn.DeleteProjectWithContext(ctx, &codebuild.DeleteProjectInput{
16091609
Name: aws.String(d.Id()),
16101610
})
1611-
return sdkdiag.AppendErrorf(diags, "deleting CodeBuild project (%s): %s", d.Id(), err)
1611+
if err != nil {
1612+
return sdkdiag.AppendErrorf(diags, "deleting CodeBuild project (%s): %s", d.Id(), err)
1613+
}
1614+
return diags
16121615
}
16131616

16141617
func flattenProjectFileSystemLocations(apiObjects []*codebuild.ProjectFileSystemLocation) []interface{} {

0 commit comments

Comments
 (0)