Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
jocgir committed Oct 16, 2024
2 parents 1b7b46c + 4db9087 commit 7010daa
Show file tree
Hide file tree
Showing 451 changed files with 67,278 additions and 1,269 deletions.
15 changes: 15 additions & 0 deletions .changelog/39734.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```release-note:bug
data-source/aws_batch_job_definition: Properly handles ignored tags.
```

```release-note:bug
resource/aws_dynamodb_table_replica: Properly handles default and ignored tags.
```

```release-note:bug
resource/aws_cognito_user_pool: Properly handles ignored tags.
```

```release-note:bug
data-source/aws_cognito_user_pool: Properly handles ignored tags.
```
48 changes: 48 additions & 0 deletions .ci/.semgrep-test-constants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,30 @@ rules:
options:
constant_propagation: false

- id: literal-ProviderValue1Again-string-test-constant
languages: [go]
message: Use the constant `acctest.CtProviderValue1Again` for the string literal "providervalue1again" in test files
paths:
include:
- "internal/service/**/*_test.go"
pattern: '"providervalue1again"'
severity: ERROR
fix: "acctest.CtProviderValue1Again"
options:
constant_propagation: false

- id: literal-ProviderValue1Updated-string-test-constant
languages: [go]
message: Use the constant `acctest.CtProviderValue1Updated` for the string literal "providervalue1updated" in test files
paths:
include:
- "internal/service/**/*_test.go"
pattern: '"providervalue1updated"'
severity: ERROR
fix: "acctest.CtProviderValue1Updated"
options:
constant_propagation: false

- id: literal-RName-string-test-constant
languages: [go]
message: Use the constant `acctest.CtRName` for the string literal "rName" in test files
Expand Down Expand Up @@ -324,6 +348,18 @@ rules:
options:
constant_propagation: false

- id: literal-ResourceValue1Again-string-test-constant
languages: [go]
message: Use the constant `acctest.CtResourceValue1Again` for the string literal "resourcevalue1again" in test files
paths:
include:
- "internal/service/**/*_test.go"
pattern: '"resourcevalue1again"'
severity: ERROR
fix: "acctest.CtResourceValue1Again"
options:
constant_propagation: false

- id: literal-ResourceValue1Updated-string-test-constant
languages: [go]
message: Use the constant `acctest.CtResourceValue1Updated` for the string literal "resourcevalue1updated" in test files
Expand All @@ -348,6 +384,18 @@ rules:
options:
constant_propagation: false

- id: literal-ResourceValue2Updated-string-test-constant
languages: [go]
message: Use the constant `acctest.CtResourceValue2Updated` for the string literal "resourcevalue2updated" in test files
paths:
include:
- "internal/service/**/*_test.go"
pattern: '"resourcevalue2updated"'
severity: ERROR
fix: "acctest.CtResourceValue2Updated"
options:
constant_propagation: false

- id: literal-RulePound-string-test-constant
languages: [go]
message: Use the constant `acctest.CtRulePound` for the string literal "rule.#" in test files
Expand Down
8 changes: 8 additions & 0 deletions .ci/semgrep/tags/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ rules:
metavariable: "$FUNC"
regex: "^resource\\w*(Create|Put|Set|Upsert|Enable)$"
severity: WARNING

- id: attrtags-in-haschanges
languages: [go]
message: Do not include `names.AttrTags` in `HasChanges`, use `names.AttrTagsAll`
patterns:
- pattern: |
$D.HasChanges(..., names.AttrTags, ...)
severity: ERROR
2 changes: 1 addition & 1 deletion .teamcity/components/generated/services_all.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ val services = mapOf(
"appconfig" to ServiceSpec("AppConfig"),
"appfabric" to ServiceSpec("AppFabric", regionOverride = "us-east-1"),
"appflow" to ServiceSpec("AppFlow"),
"appintegrations" to ServiceSpec("AppIntegrations"),
"appintegrations" to ServiceSpec("AppIntegrations", parallelismOverride = 10),
"applicationinsights" to ServiceSpec("CloudWatch Application Insights"),
"applicationsignals" to ServiceSpec("Application Signals"),
"appmesh" to ServiceSpec("App Mesh"),
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
## 5.73.0 (Unreleased)

ENHANCEMENTS:

* resource/aws_resourceexplorer2_view: Add `scope` argument ([#39744](https://github.com/hashicorp/terraform-provider-aws/issues/39744))

BUG FIXES:

* data-source/aws_batch_job_definition: Properly handles ignored tags. ([#39734](https://github.com/hashicorp/terraform-provider-aws/issues/39734))
* data-source/aws_cognito_user_pool: Properly handles ignored tags. ([#39734](https://github.com/hashicorp/terraform-provider-aws/issues/39734))
* resource/aws_cognito_user_pool: Properly handles ignored tags. ([#39734](https://github.com/hashicorp/terraform-provider-aws/issues/39734))
* resource/aws_dynamodb_table_replica: Properly handles default and ignored tags. ([#39734](https://github.com/hashicorp/terraform-provider-aws/issues/39734))
* resource/aws_resourceexplorer2_index: Correctly mark incomplete `AGGREGATOR` indexes as [tainted](https://developer.hashicorp.com/terraform/cli/state/taint#the-tainted-status) on Create ([#39744](https://github.com/hashicorp/terraform-provider-aws/issues/39744))

## 5.72.0 (October 15, 2024)

NOTES:
Expand Down
15 changes: 13 additions & 2 deletions docs/resource-tagging.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,12 @@ Most services can use a facility we call _transparent_ (or _implicit_) _tagging_
}
```

The `identifierAttribute` argument to the `@Tags` annotation identifies the attribute in the resource's schema whose value is used in tag listing and updating API calls. Common values are `"arn"` and "`id`".
Once the annotation has been added to the resource's code, run `make gen` to register the resource for transparent tagging. This will add an entry to the `service_package_gen.go` file located in the service package folder.
The `identifierAttribute` argument to the `@Tags` annotation identifies the attribute in the resource type's schema whose value is used in tag listing and updating API calls.
Common values are `"arn"` and `"id"`.
If the resource type does not need separate `createTags`, `listTags`, or `updateTags` functions, do not specify an `identifierAttribute`.

Once the annotation has been added to the resource's code, run `make gen` to register the resource for transparent tagging.
This will add an entry to the `service_package_gen.go` file located in the service package folder.

#### Resource Create Operation

Expand Down Expand Up @@ -559,6 +563,13 @@ Use the annotation `@Testing(checkDestroyNoop=true)`.
For some resource types, tags cannot be modified without recreating the resource.
Use the annotation `@Testing(tagsUpdateForceNew=true)`.

Resource types which pass the result of `getTagsIn` directly onto their Update Input may have an error where ignored tags are not correctly excluded from the update.
Use the annotation `@Testing(tagsUpdateGetTagsIn=true)`.

Some tests read the tag values directly from the AWS API.
If the resource type does not specify `identifierAttribute` in its `@Tags` annotation, specify a `@Testing(tagsIdentifierAttribute=<attribute name>)` annotation to identify which attribute value should be used by the `listTags` function.
If a resource type is also needed for the `listTags` function, also specify the `tagsResourceType` annotation.

At least one resource type, the Service Catalog Provisioned Product, does not support removing tags.
This is likely an error on the AWS side.
Add the annotation `@Testing(noRemoveTags=true)` as a workaround.
Expand Down
4 changes: 4 additions & 0 deletions internal/acctest/consts.csv
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@ private_key_pem,PrivateKeyPEM
provider_tags,ProviderTags
providerkey1,ProviderKey1
providervalue1,ProviderValue1
providervalue1updated,ProviderValue1Updated
providervalue1again,ProviderValue1Again
rName,RName
resource_owner,ResourceOwner
resource_tags,ResourceTags
resourcekey1,ResourceKey1
resourcekey2,ResourceKey2
resourcevalue1,ResourceValue1
resourcevalue1updated,ResourceValue1Updated
resourcevalue1again,ResourceValue1Again
resourcevalue2,ResourceValue2
resourcevalue2updated,ResourceValue2Updated
rule.#,RulePound
tags.%,TagsPercent
tags.key1,TagsKey1
Expand Down
4 changes: 4 additions & 0 deletions internal/acctest/consts_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions internal/acctest/generate/const_or_quote_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7010daa

Please sign in to comment.