-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37066 from hashicorp/td-generate-tagtests-service…
…catalog Service Catalog Provisioned Product tagging issues
- Loading branch information
Showing
19 changed files
with
2,739 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
```release-note:bug | ||
resource/aws_servicecatalog_provisioned_product: Fixes error where tag values are not applied to products when tag values don't change. | ||
``` | ||
|
||
```release-note:bug | ||
resource/aws_servicecatalog_portfolio: Fixes error where deletion fails if resource was deleted out of band. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package acctest | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/hashicorp/terraform-plugin-testing/helper/resource" | ||
"github.com/hashicorp/terraform-plugin-testing/terraform" | ||
"github.com/hashicorp/terraform-provider-aws/internal/conns" | ||
tfs3 "github.com/hashicorp/terraform-provider-aws/internal/service/s3" | ||
) | ||
|
||
func S3BucketHasTag(ctx context.Context, bucketName, key, value string) resource.TestCheckFunc { | ||
return func(s *terraform.State) error { | ||
conn := Provider.Meta().(*conns.AWSClient).S3Client(ctx) | ||
|
||
tags, err := tfs3.BucketListTags(ctx, conn, bucketName) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
for k, v := range tags { | ||
if k == key { | ||
if v.ValueString() == value { | ||
return nil | ||
} else { | ||
return fmt.Errorf("expected tag %q value to be %s, got %s", key, value, v.ValueString()) | ||
} | ||
} | ||
} | ||
|
||
return fmt.Errorf("expected tag %q not found", key) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.