Skip to content

Commit

Permalink
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions internal/service/elbv2/const.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package elbv2

const (
ErrValidationError = "ValidationError"

TagsOnCreationErrMessage = "cannot specify tags on creation"
)
2 changes: 1 addition & 1 deletion internal/service/elbv2/listener.go
Original file line number Diff line number Diff line change
@@ -443,7 +443,7 @@ func resourceListenerCreate(d *schema.ResourceData, meta interface{}) error {

// Tags are not supported on creation with some load balancer types (i.e. Gateway)
// Retry creation without tags
if params.Tags != nil && tfawserr.ErrMessageContains(err, "ValidationError", "cannot specify tags on creation") {
if params.Tags != nil && tfawserr.ErrMessageContains(err, ErrValidationError, TagsOnCreationErrMessage) {
log.Printf("[WARN] ELBv2 Listener (%s) create failed (%s) with tags. Trying create without tags.", lbArn, err)
params.Tags = nil
output, err = retryListenerCreate(conn, params)
2 changes: 1 addition & 1 deletion internal/service/elbv2/target_group.go
Original file line number Diff line number Diff line change
@@ -376,7 +376,7 @@ func resourceTargetGroupCreate(d *schema.ResourceData, meta interface{}) error {

// Tags are not supported on creation with some protocol types(i.e. GENEVE)
// Retry creation without tags
if params.Tags != nil && tfawserr.ErrMessageContains(err, "ValidationError", "cannot specify tags on creation") {
if params.Tags != nil && tfawserr.ErrMessageContains(err, ErrValidationError, TagsOnCreationErrMessage) {
log.Printf("[WARN] ELBv2 Target Group (%s) create failed (%s) with tags. Trying create without tags.", groupName, err)
params.Tags = nil
resp, err = conn.CreateTargetGroup(params)

0 comments on commit c7903d2

Please sign in to comment.