Skip to content

Commit fd1bf8a

Browse files
authored
Merge pull request hashicorp#44892 from hashicorp/f-aws_invoicing_invoice_unit
New resource: `aws_invoicing_invoice_unit`
2 parents 72ed3e7 + c0e650a commit fd1bf8a

File tree

12 files changed

+761
-1
lines changed

12 files changed

+761
-1
lines changed

.changelog/44892.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
aws_invoicing_invoice_unit
3+
```

.ci/semgrep/smarterr/enforce.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ rules:
99
include:
1010
- "/internal/service/appsync/"
1111
- "/internal/service/cloudwatch/"
12+
- "/internal/service/invoicing/"
1213

1314
- id: go-no-sdkdiag-appendfromerr
1415
languages: [go]
@@ -20,6 +21,7 @@ rules:
2021
include:
2122
- "/internal/service/appsync/"
2223
- "/internal/service/cloudwatch/"
24+
- "/internal/service/invoicing/"
2325

2426
- id: go-no-sdkdiag-appenderrorf
2527
languages: [go]
@@ -32,6 +34,7 @@ rules:
3234
include:
3335
- "/internal/service/appsync/"
3436
- "/internal/service/cloudwatch/"
37+
- "/internal/service/invoicing/"
3538

3639
- id: go-no-create-appenddiagerror
3740
languages: [go]
@@ -42,6 +45,7 @@ rules:
4245
include:
4346
- "/internal/service/appsync/"
4447
- "/internal/service/cloudwatch/"
48+
- "/internal/service/invoicing/"
4549

4650
- id: go-no-diagnostics-adderror
4751
languages: [go]
@@ -56,6 +60,7 @@ rules:
5660
include:
5761
- "/internal/service/appsync/"
5862
- "/internal/service/cloudwatch/"
63+
- "/internal/service/invoicing/"
5964

6065
- id: go-no-create-adderror
6166
languages: [go]
@@ -66,6 +71,7 @@ rules:
6671
include:
6772
- "/internal/service/appsync/"
6873
- "/internal/service/cloudwatch/"
74+
- "/internal/service/invoicing/"
6975

7076
- id: go-no-direct-diag-adderror
7177
languages: [go]
@@ -78,6 +84,7 @@ rules:
7884
include:
7985
- "/internal/service/appsync/"
8086
- "/internal/service/cloudwatch/"
87+
- "/internal/service/invoicing/"
8188

8289
- id: go-no-direct-diag-appenderrorf
8390
languages: [go]
@@ -88,6 +95,7 @@ rules:
8895
include:
8996
- "/internal/service/appsync/"
9097
- "/internal/service/cloudwatch/"
98+
- "/internal/service/invoicing/"
9199

92100
- id: go-no-direct-diag-appendfromerr
93101
languages: [go]
@@ -98,6 +106,7 @@ rules:
98106
include:
99107
- "/internal/service/appsync/"
100108
- "/internal/service/cloudwatch/"
109+
- "/internal/service/invoicing/"
101110

102111
- id: go-no-direct-diag-append
103112
languages: [go]
@@ -111,6 +120,7 @@ rules:
111120
include:
112121
- "/internal/service/appsync/"
113122
- "/internal/service/cloudwatch/"
123+
- "/internal/service/invoicing/"
114124

115125
- id: go-no-bare-return-err
116126
languages: [go]
@@ -125,6 +135,7 @@ rules:
125135
include:
126136
- "/internal/service/appsync/"
127137
- "/internal/service/cloudwatch/"
138+
- "/internal/service/invoicing/"
128139

129140
- id: go-no-bare-return-value-err
130141
languages: [go]
@@ -141,6 +152,7 @@ rules:
141152
include:
142153
- "/internal/service/appsync/"
143154
- "/internal/service/cloudwatch/"
155+
- "/internal/service/invoicing/"
144156
exclude:
145157
- "*_test.go"
146158

@@ -157,6 +169,7 @@ rules:
157169
include:
158170
- "/internal/service/appsync/"
159171
- "/internal/service/cloudwatch/"
172+
- "/internal/service/invoicing/"
160173
exclude:
161174
- "*_test.go"
162175

@@ -172,6 +185,7 @@ rules:
172185
include:
173186
- "/internal/service/appsync/"
174187
- "/internal/service/cloudwatch/"
188+
- "/internal/service/invoicing/"
175189

176190
- id: go-no-fmt-errorf-return
177191
languages: [go]
@@ -185,6 +199,7 @@ rules:
185199
include:
186200
- "/internal/service/appsync/"
187201
- "/internal/service/cloudwatch/"
202+
- "/internal/service/invoicing/"
188203
exclude:
189204
- "*_test.go"
190205

@@ -203,6 +218,7 @@ rules:
203218
include:
204219
- "/internal/service/appsync/"
205220
- "/internal/service/cloudwatch/"
221+
- "/internal/service/invoicing/"
206222
exclude:
207223
- "*_test.go"
208224

@@ -219,6 +235,7 @@ rules:
219235
include:
220236
- "/internal/service/appsync/"
221237
- "/internal/service/cloudwatch/"
238+
- "/internal/service/invoicing/"
222239
exclude:
223240
- "*_test.go"
224241

@@ -235,6 +252,7 @@ rules:
235252
include:
236253
- "/internal/service/appsync/"
237254
- "/internal/service/cloudwatch/"
255+
- "/internal/service/invoicing/"
238256
exclude:
239257
- "*_test.go"
240258

@@ -250,3 +268,4 @@ rules:
250268
include:
251269
- "/internal/service/appsync/"
252270
- "/internal/service/cloudwatch/"
271+
- "/internal/service/invoicing/"

docs/acc-test-environment-variables.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,6 @@ Environment variables (beyond standard AWS Go SDK ones) used by acceptance testi
107107
| `TF_TEST_CLOUDFRONT_RETAIN` | Flag to disable but dangle CloudFront Distributions during testing to reduce feedback time (must be manually destroyed afterwards). |
108108
| `TF_TEST_ELASTICACHE_RESERVED_CACHE_NODE` | Flag to enable resource tests for ElastiCache reserved nodes. Set to `1` to run tests. |
109109
| `TRUST_ANCHOR_CERTIFICATE` | Trust anchor certificate for KMS custom key store acceptance tests. |
110+
| `INVOICING_INVOICE_RECEIVER_ACCOUNT_ID` | Identifier of AWS Account for Invoice Unit Invoice Receiver. |
111+
| `INVOICING_INVOICE_LINKED_ACCOUNT_ID` | Identifier of AWS Account for Invoice Unit Linked account. |
110112
| `VPC_NETWORK_INTERFACE_TEST_MULTIPLE_CARDS` | Flag to execute tests that enable to attach multiple network interfaces. |
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
package framework
5+
6+
import (
7+
"context"
8+
9+
"github.com/hashicorp/terraform-plugin-framework/path"
10+
"github.com/hashicorp/terraform-plugin-framework/resource"
11+
"github.com/hashicorp/terraform-provider-aws/names"
12+
)
13+
14+
// WithImportByARN is intended to be embedded in resources which import state via the "arn" attribute.
15+
// See https://developer.hashicorp.com/terraform/plugin/framework/resources/import.
16+
type WithImportByARN struct{}
17+
18+
func (w *WithImportByARN) ImportState(ctx context.Context, request resource.ImportStateRequest, response *resource.ImportStateResponse) {
19+
resource.ImportStatePassthroughID(ctx, path.Root(names.AttrARN), request, response)
20+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
package invoicing
5+
6+
// Exports for use in tests only.
7+
var (
8+
FindInvoiceUnitByARN = findInvoiceUnitByARN
9+
)

internal/service/invoicing/generate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: MPL-2.0
33

44
//go:generate go run ../../generate/servicepackage/main.go
5+
//go:generate go run ../../generate/tags/main.go -ListTags -ServiceTagsSlice -TagType=ResourceTag -UntagInTagsElem=ResourceTagKeys -UpdateTags -ListTagsOutTagsElem=ResourceTags -TagInTagsElem=ResourceTags
56
// ONLY generate directives and package declaration! Do not add anything else to this file.
67

78
package invoicing

0 commit comments

Comments
 (0)