Skip to content

Commit

Permalink
r/aws_elastictranscoder_[pipeline|preset]: handle NotFound errors on …
Browse files Browse the repository at this point in the history
…delete

```console
% make testacc PKG=elastictranscoder
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.5 test ./internal/service/elastictranscoder/... -v -count 1 -parallel 20   -timeout 360m

--- PASS: TestEndpointConfiguration (0.66s)
    --- PASS: TestEndpointConfiguration/no_config (0.03s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config (0.04s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_base_envvar (0.04s)
    --- PASS: TestEndpointConfiguration/service_aws_envvar_overrides_service_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/use_fips_config_with_package_name_endpoint_config (0.04s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_service_config_file (0.04s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_base_config_file (0.05s)
    --- PASS: TestEndpointConfiguration/service_aws_envvar_overrides_base_envvar (0.03s)
    --- PASS: TestEndpointConfiguration/base_endpoint_envvar (0.03s)
    --- PASS: TestEndpointConfiguration/base_endpoint_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/package_name_endpoint_config_overrides_aws_service_envvar (0.04s)
    --- PASS: TestEndpointConfiguration/service_aws_envvar_overrides_base_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/base_endpoint_envvar_overrides_service_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/use_fips_config (0.03s)
    --- PASS: TestEndpointConfiguration/service_aws_envvar (0.03s)
    --- PASS: TestEndpointConfiguration/base_endpoint_envvar_overrides_base_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/service_config_file (0.03s)
    --- PASS: TestEndpointConfiguration/service_config_file_overrides_base_config_file (0.03s)
=== CONT  TestAccElasticTranscoderPipeline_basic
=== CONT  TestAccElasticTranscoderPreset_video_noCodec
=== CONT  TestAccElasticTranscoderPipeline_withPermissions
=== CONT  TestAccElasticTranscoderPreset_Video_frameRate
=== CONT  TestAccElasticTranscoderPreset_full
=== CONT  TestAccElasticTranscoderPipeline_notifications
=== CONT  TestAccElasticTranscoderPreset_description
=== CONT  TestAccElasticTranscoderPreset_AudioCodecOptions_empty
=== CONT  TestAccElasticTranscoderPreset_disappears
=== CONT  TestAccElasticTranscoderPreset_audio_noBitRate
=== CONT  TestAccElasticTranscoderPipeline_withContent
=== CONT  TestAccElasticTranscoderPreset_basic
=== CONT  TestAccElasticTranscoderPipeline_kmsKey
=== CONT  TestAccElasticTranscoderPipeline_disappears
--- PASS: TestAccElasticTranscoderPreset_disappears (18.36s)
--- PASS: TestAccElasticTranscoderPreset_Video_frameRate (21.60s)
--- PASS: TestAccElasticTranscoderPreset_description (23.73s)
--- PASS: TestAccElasticTranscoderPreset_basic (23.86s)
--- PASS: TestAccElasticTranscoderPreset_audio_noBitRate (23.93s)
--- PASS: TestAccElasticTranscoderPipeline_disappears (25.19s)
--- PASS: TestAccElasticTranscoderPipeline_basic (26.98s)
--- PASS: TestAccElasticTranscoderPipeline_withPermissions (28.32s)
--- PASS: TestAccElasticTranscoderPreset_AudioCodecOptions_empty (28.55s)
--- PASS: TestAccElasticTranscoderPreset_video_noCodec (30.26s)
--- PASS: TestAccElasticTranscoderPreset_full (34.48s)
--- PASS: TestAccElasticTranscoderPipeline_notifications (37.32s)
--- PASS: TestAccElasticTranscoderPipeline_withContent (37.32s)
--- PASS: TestAccElasticTranscoderPipeline_kmsKey (48.26s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/elastictranscoder  54.746s
```
  • Loading branch information
jar-b committed Jul 19, 2024
1 parent 05de722 commit 11f8df3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changelog/38018.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:bug
resource/aws_elastictranscoder_pipeline: Properly handle NotFound exceptions during deletion
```
```release-note:bug
resource/aws_elastictranscoder_preset: Properly handle NotFound exceptions during deletion
```
3 changes: 3 additions & 0 deletions internal/service/elastictranscoder/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,9 @@ func resourcePipelineDelete(ctx context.Context, d *schema.ResourceData, meta in
Id: aws.String(d.Id()),
})
if err != nil {
if errs.IsA[*awstypes.ResourceNotFoundException](err) {
return diags
}
return sdkdiag.AppendErrorf(diags, "deleting Elastic Transcoder Pipeline: %s", err)
}
return diags
Expand Down
3 changes: 3 additions & 0 deletions internal/service/elastictranscoder/preset.go
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,9 @@ func resourcePresetDelete(ctx context.Context, d *schema.ResourceData, meta inte
})

if err != nil {
if errs.IsA[*awstypes.ResourceNotFoundException](err) {
return diags
}
return sdkdiag.AppendErrorf(diags, "deleting Elastic Transcoder Preset: %s", err)
}

Expand Down

0 comments on commit 11f8df3

Please sign in to comment.