-
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 #32371 from hashicorp/b-kms-key-remove-tags
KMS Keys: Fixes timeout when removing all tags
- Loading branch information
Showing
21 changed files
with
396 additions
and
110 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,15 @@ | ||
```release-note:bug | ||
resource/aws_kms_external_key: Correctly remove all tags | ||
``` | ||
|
||
```release-note:bug | ||
resource/aws_kms_key: Correctly remove all tags | ||
``` | ||
|
||
```release-note:bug | ||
resource/aws_kms_replica_external_key: Correctly remove all tags | ||
``` | ||
|
||
```release-note:bug | ||
resource/aws_kms_replica_key: Correctly remove all tags | ||
``` |
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
34 changes: 34 additions & 0 deletions
34
internal/generate/tags/templates/v1/wait_tags_propagated_body.tmpl
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,34 @@ | ||
// {{ .WaitTagsPropagatedFunc }} waits for {{ .ServicePackage }} service tags to be propagated. | ||
// The identifier is typically the Amazon Resource Name (ARN), although | ||
// it may also be a different identifier depending on the service. | ||
func {{ .WaitTagsPropagatedFunc }}(ctx context.Context, conn {{ .ClientType }}, id string, tags tftags.KeyValueTags) error { | ||
checkFunc := func() (bool, error) { | ||
output, err := listTags(ctx, conn, id) | ||
|
||
if tfresource.NotFound(err) { | ||
return false, nil | ||
} | ||
|
||
if err != nil { | ||
return false, err | ||
} | ||
|
||
return output.Equal(tags), nil | ||
} | ||
opts := tfresource.WaitOpts{ | ||
{{- if ne .WaitContinuousOccurence 0 }} | ||
ContinuousTargetOccurence: {{ .WaitContinuousOccurence }}, | ||
{{- end }} | ||
{{- if ne .WaitDelay "" }} | ||
Delay: {{ .WaitDelay }}, | ||
{{- end }} | ||
{{- if ne .WaitMinTimeout "" }} | ||
MinTimeout: {{ .WaitMinTimeout }}, | ||
{{- end }} | ||
{{- if ne .WaitPollInterval "" }} | ||
PollInterval: {{ .WaitPollInterval }}, | ||
{{- end }} | ||
} | ||
|
||
return tfresource.WaitUntil(ctx, {{ .WaitTimeout }}, checkFunc, opts) | ||
} |
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
34 changes: 34 additions & 0 deletions
34
internal/generate/tags/templates/v2/wait_tags_propagated_body.tmpl
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,34 @@ | ||
// {{ .WaitTagsPropagatedFunc }} waits for {{ .ServicePackage }} service tags to be propagated. | ||
// The identifier is typically the Amazon Resource Name (ARN), although | ||
// it may also be a different identifier depending on the service. | ||
func {{ .WaitTagsPropagatedFunc }}(ctx context.Context, conn {{ .ClientType }}, id string, tags tftags.KeyValueTags) error { | ||
checkFunc := func() (bool, error) { | ||
output, err := listTags(ctx, conn, id) | ||
|
||
if tfresource.NotFound(err) { | ||
return false, nil | ||
} | ||
|
||
if err != nil { | ||
return false, err | ||
} | ||
|
||
return output.Equal(tags), nil | ||
} | ||
opts := tfresource.WaitOpts{ | ||
{{- if ne .WaitContinuousOccurence 0 }} | ||
ContinuousTargetOccurence: {{ .WaitContinuousOccurence }}, | ||
{{- end }} | ||
{{- if ne .WaitDelay "" }} | ||
Delay: {{ .WaitDelay }}, | ||
{{- end }} | ||
{{- if ne .WaitMinTimeout "" }} | ||
MinTimeout: {{ .WaitMinTimeout }}, | ||
{{- end }} | ||
{{- if ne .WaitPollInterval "" }} | ||
PollInterval: {{ .WaitPollInterval }}, | ||
{{- end }} | ||
} | ||
|
||
return tfresource.WaitUntil(ctx, {{ .WaitTimeout }}, checkFunc, opts) | ||
} |
Oops, something went wrong.