Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/44892.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
aws_invoicing_invoice_unit
```
19 changes: 19 additions & 0 deletions .ci/semgrep/smarterr/enforce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"

- id: go-no-sdkdiag-appendfromerr
languages: [go]
Expand All @@ -20,6 +21,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"

- id: go-no-sdkdiag-appenderrorf
languages: [go]
Expand All @@ -32,6 +34,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"

- id: go-no-create-appenddiagerror
languages: [go]
Expand All @@ -42,6 +45,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"

- id: go-no-diagnostics-adderror
languages: [go]
Expand All @@ -56,6 +60,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"

- id: go-no-create-adderror
languages: [go]
Expand All @@ -66,6 +71,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"

- id: go-no-direct-diag-adderror
languages: [go]
Expand All @@ -78,6 +84,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"

- id: go-no-direct-diag-appenderrorf
languages: [go]
Expand All @@ -88,6 +95,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"

- id: go-no-direct-diag-appendfromerr
languages: [go]
Expand All @@ -98,6 +106,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"

- id: go-no-direct-diag-append
languages: [go]
Expand All @@ -111,6 +120,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"

- id: go-no-bare-return-err
languages: [go]
Expand All @@ -125,6 +135,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"

- id: go-no-bare-return-value-err
languages: [go]
Expand All @@ -141,6 +152,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"
exclude:
- "*_test.go"

Expand All @@ -157,6 +169,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"
exclude:
- "*_test.go"

Expand All @@ -172,6 +185,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"

- id: go-no-fmt-errorf-return
languages: [go]
Expand All @@ -185,6 +199,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"
exclude:
- "*_test.go"

Expand All @@ -203,6 +218,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"
exclude:
- "*_test.go"

Expand All @@ -219,6 +235,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"
exclude:
- "*_test.go"

Expand All @@ -235,6 +252,7 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"
exclude:
- "*_test.go"

Expand All @@ -250,3 +268,4 @@ rules:
include:
- "/internal/service/appsync/"
- "/internal/service/cloudwatch/"
- "/internal/service/invoicing/"
2 changes: 2 additions & 0 deletions docs/acc-test-environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,6 @@ Environment variables (beyond standard AWS Go SDK ones) used by acceptance testi
| `TF_TEST_CLOUDFRONT_RETAIN` | Flag to disable but dangle CloudFront Distributions during testing to reduce feedback time (must be manually destroyed afterwards). |
| `TF_TEST_ELASTICACHE_RESERVED_CACHE_NODE` | Flag to enable resource tests for ElastiCache reserved nodes. Set to `1` to run tests. |
| `TRUST_ANCHOR_CERTIFICATE` | Trust anchor certificate for KMS custom key store acceptance tests. |
| `INVOICING_INVOICE_RECEIVER_ACCOUNT_ID` | Identifier of AWS Account for Invoice Unit Invoice Receiver. |
| `INVOICING_INVOICE_LINKED_ACCOUNT_ID` | Identifier of AWS Account for Invoice Unit Linked account. |
| `VPC_NETWORK_INTERFACE_TEST_MULTIPLE_CARDS` | Flag to execute tests that enable to attach multiple network interfaces. |
20 changes: 20 additions & 0 deletions internal/framework/with_import_by_arn.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package framework

import (
"context"

"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-provider-aws/names"
)

// WithImportByARN is intended to be embedded in resources which import state via the "arn" attribute.
// See https://developer.hashicorp.com/terraform/plugin/framework/resources/import.
type WithImportByARN struct{}

func (w *WithImportByARN) ImportState(ctx context.Context, request resource.ImportStateRequest, response *resource.ImportStateResponse) {
resource.ImportStatePassthroughID(ctx, path.Root(names.AttrARN), request, response)
}
9 changes: 9 additions & 0 deletions internal/service/invoicing/exports_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package invoicing

// Exports for use in tests only.
var (
FindInvoiceUnitByARN = findInvoiceUnitByARN
)
1 change: 1 addition & 0 deletions internal/service/invoicing/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: MPL-2.0

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

package invoicing
Loading
Loading