diff --git a/.changelog/34530.txt b/.changelog/34530.txt new file mode 100644 index 00000000000..4e1e22cd7f1 --- /dev/null +++ b/.changelog/34530.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_glue_trigger: Fix `ConcurrentModificationException: Workflow was modified while adding trigger ` errors +``` diff --git a/internal/service/glue/trigger.go b/internal/service/glue/trigger.go index b7da9473eaa..d6aeff8a86b 100644 --- a/internal/service/glue/trigger.go +++ b/internal/service/glue/trigger.go @@ -258,13 +258,19 @@ func resourceTriggerCreate(ctx context.Context, d *schema.ResourceData, meta int if v, ok := d.GetOk("start_on_creation"); ok { input.StartOnCreation = aws.Bool(v.(bool)) } + log.Printf("[DEBUG] Creating Glue Trigger: %s", input) err := retry.RetryContext(ctx, propagationTimeout, func() *retry.RetryError { _, err := conn.CreateTriggerWithContext(ctx, input) if err != nil { + // Retry IAM propagation errors if tfawserr.ErrMessageContains(err, glue.ErrCodeInvalidInputException, "Service is unable to assume provided role") { return retry.RetryableError(err) } + // Retry concurrent workflow modification errors + if tfawserr.ErrMessageContains(err, glue.ErrCodeConcurrentModificationException, "was modified while adding trigger") { + return retry.RetryableError(err) + } return retry.NonRetryableError(err) }