Skip to content

Commit 1be3663

Browse files
committed
fixed tag + environment update
1 parent 53d4a09 commit 1be3663

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changelog/36074.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
resource/aws_elastic_beanstalk_environment: Ensure sequential update of tags and environment properties to prevent InvalidParameterValue error
3+
```

internal/service/elasticbeanstalk/environment.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,18 @@ func resourceEnvironmentUpdate(ctx context.Context, d *schema.ResourceData, meta
451451

452452
opTime := time.Now()
453453

454-
if d.HasChangesExcept("tags", "tags_all", "wait_for_ready_timeout", "poll_interval") {
454+
if d.HasChangesExcept("wait_for_ready_timeout", "poll_interval") {
455455
input := elasticbeanstalk.UpdateEnvironmentInput{
456456
EnvironmentId: aws.String(d.Id()),
457457
}
458458

459+
if d.HasChange("tags_all") {
460+
log.Printf("[DEBUG] Waiting for Elastic Beanstalk environment %s to become ready after updating tags", d.Id())
461+
if _, err := waitEnvironmentReady(ctx, conn, d.Id(), pollInterval, waitForReadyTimeOut); err != nil {
462+
return sdkdiag.AppendErrorf(diags, "waiting for Elastic Beanstalk Environment (%s) tag update: %s", d.Id(), err)
463+
}
464+
}
465+
459466
if d.HasChange("description") {
460467
input.Description = aws.String(d.Get("description").(string))
461468
}

0 commit comments

Comments
 (0)