diff --git a/awsmt/resource_channel.go b/awsmt/resource_channel.go index 261d939..2d8fa2b 100644 --- a/awsmt/resource_channel.go +++ b/awsmt/resource_channel.go @@ -37,7 +37,7 @@ func (r *resourceChannel) Schema(_ context.Context, _ resource.SchemaRequest, re Attributes: map[string]schema.Attribute{ "id": computedString, "arn": computedString, - "name": requiredString, + "name": requiredStringWithRequiresReplace, // @ADR // Context: We cannot test the deletion of a running channel if we cannot set the channel_state property // through the provider @@ -233,6 +233,7 @@ func (r *resourceChannel) Update(ctx context.Context, req resource.UpdateRequest "Error while describing channel "+err.Error(), err.Error(), ) + return } err = UpdatesTags(r.client, channel.Tags, plan.Tags, *channel.Arn) @@ -241,6 +242,7 @@ func (r *resourceChannel) Update(ctx context.Context, req resource.UpdateRequest "Error while updating channel tags"+err.Error(), err.Error(), ) + return } previousState := channel.ChannelState @@ -249,9 +251,10 @@ func (r *resourceChannel) Update(ctx context.Context, req resource.UpdateRequest err = stopChannel(previousState, channelName, r.client) if err != nil { resp.Diagnostics.AddError( - "Error while stopping running channel "+*channelName+" "+err.Error(), + "Error while stopping to run channel "+*channelName+" "+err.Error(), err.Error(), ) + return } if err := handlePolicyUpdate(ctx, r.client, plan); err != nil { @@ -259,6 +262,7 @@ func (r *resourceChannel) Update(ctx context.Context, req resource.UpdateRequest "Error while updating channel policy "+err.Error(), err.Error(), ) + return } updatedChannel, err := r.client.UpdateChannel(ctx, getUpdateChannelInput(plan)) @@ -267,6 +271,7 @@ func (r *resourceChannel) Update(ctx context.Context, req resource.UpdateRequest "Error while updating channel "+*channel.ChannelName+" "+err.Error(), err.Error(), ) + return } if shouldStartChannel(previousState, newState) { diff --git a/awsmt/resource_live_source.go b/awsmt/resource_live_source.go index ac62a6a..0903440 100644 --- a/awsmt/resource_live_source.go +++ b/awsmt/resource_live_source.go @@ -143,6 +143,7 @@ func (r *resourceLiveSource) Update(ctx context.Context, req resource.UpdateRequ "Error while updating live source "+err.Error(), err.Error(), ) + return } plan = readLiveSource(plan, mediatailor.CreateLiveSourceOutput(*updatedLiveSource)) @@ -172,6 +173,7 @@ func (r *resourceLiveSource) Delete(ctx context.Context, req resource.DeleteRequ "Error while deleting live source "+err.Error(), err.Error(), ) + return } } diff --git a/awsmt/resource_playback_configuration.go b/awsmt/resource_playback_configuration.go index baa89dd..af50607 100644 --- a/awsmt/resource_playback_configuration.go +++ b/awsmt/resource_playback_configuration.go @@ -129,7 +129,7 @@ func (r *resourcePlaybackConfiguration) Schema(_ context.Context, _ resource.Sch }, }, }, - "name": requiredString, + "name": requiredStringWithRequiresReplace, "personalization_threshold_seconds": optionalInt64, "playback_configuration_arn": computedStringWithStateForUnknown, "playback_endpoint_prefix": computedStringWithStateForUnknown, @@ -248,6 +248,7 @@ func (r *resourcePlaybackConfiguration) Update(ctx context.Context, req resource "Error while updating playback configuration tags"+err.Error(), err.Error(), ) + return } p := putPlaybackConfigurationInputBuilder{input: &mediatailor.PutPlaybackConfigurationInput{}, model: plan} diff --git a/awsmt/resource_source_location.go b/awsmt/resource_source_location.go index 5bf9c89..03c06a8 100644 --- a/awsmt/resource_source_location.go +++ b/awsmt/resource_source_location.go @@ -76,7 +76,7 @@ func (r *resourceSourceLocation) Schema(_ context.Context, _ resource.SchemaRequ }, }, }, - "name": requiredString, + "name": requiredStringWithRequiresReplace, "tags": optionalMap, }, } @@ -169,6 +169,7 @@ func (r *resourceSourceLocation) Update(ctx context.Context, req resource.Update "Error while updating playback configuration tags"+err.Error(), err.Error(), ) + return } if !currentState.AccessConfiguration.Equal(plan.AccessConfiguration) { updatedSourceLocation, err := recreateSourceLocation(r.client, plan) diff --git a/awsmt/resource_vod_source.go b/awsmt/resource_vod_source.go index f8ec8bd..681278d 100644 --- a/awsmt/resource_vod_source.go +++ b/awsmt/resource_vod_source.go @@ -143,6 +143,7 @@ func (r *resourceVodSource) Update(ctx context.Context, req resource.UpdateReque "Error while updating vod source tags"+err.Error(), err.Error(), ) + return } updateInput := getUpdateVodSourceInput(plan) @@ -152,6 +153,7 @@ func (r *resourceVodSource) Update(ctx context.Context, req resource.UpdateReque "Error while updating vod source "+err.Error(), err.Error(), ) + return } plan = readVodSourceToPlan(plan, mediatailor.CreateVodSourceOutput(*updatedVodSource)) @@ -181,6 +183,7 @@ func (r *resourceVodSource) Delete(ctx context.Context, req resource.DeleteReque "Error while deleting vod source "+err.Error(), err.Error(), ) + return } }