- 
                Notifications
    
You must be signed in to change notification settings  - Fork 9.8k
 
          New resource: aws_invoicing_invoice_unit
          #44892
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
          Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
 Pull Request Authors
  | 
    
aws_invoicing_invoice_unit
      Co-authored-by: Jared Baker <jar-b@users.noreply.github.com>
| 
           Latest after changes: % make t T=TestAccInvoicingInvoiceUnit_basic K=invoicing                   
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 f-aws_invoicing_invoice_unit 🌿...
TF_ACC=1 go1.24.8 test ./internal/service/invoicing/... -v -count 1 -parallel 20 -run='TestAccInvoicingInvoiceUnit_basic'  -timeout 360m -vet=off
2025/10/31 17:35:51 Creating Terraform AWS Provider (SDKv2-style)...
2025/10/31 17:35:51 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccInvoicingInvoiceUnit_basic
=== PAUSE TestAccInvoicingInvoiceUnit_basic
=== CONT  TestAccInvoicingInvoiceUnit_basic
--- PASS: TestAccInvoicingInvoiceUnit_basic (13.90s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/invoicing	19.366s | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments
| 
               | 
          ||
| // @FrameworkResource("aws_invoicing_invoice_unit", name="Invoice Unit") | ||
| // @Tags(identifierAttribute="arn") | ||
| func newInvoiceUnitResource(_ context.Context) (resource.ResourceWithConfigure, error) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider implementing Resource Identity. Because of the environment variables used in the tests, you'll likely have to create the tests manually by setting the annotation @Testing(identityTest=false)
Co-authored-by: Graham Davison <gdavison@hashicorp.com>
Co-authored-by: Graham Davison <gdavison@hashicorp.com>
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Description
Adds support for the
aws_invoicing_invoice_unitresource to manage AWS Invoice Units for organizational billing.AWS Invoice Units are a new organizational billing feature that allows enterprises to separate invoicing within a single AWS Organization, eliminating the need for multiple separate Organizations to achieve complex funding requirements. This resource enables Terraform users to programmatically create and manage invoice units, which group specific AWS accounts together for consolidated billing while sending invoices to designated receiver accounts.
Key Features:
Example Usage:
This addresses a significant pain point for large organizations with complex cost allocation needs, as previously they had to maintain entirely separate AWS Organizations just to achieve separate invoicing.
Relations
Closes #40844
Closes #41824
Relates #40900
References
Output from Acceptance Testing
To run the acceptance test, you'll need an AWS Organizations setup with multiple accounts (can be main org and one linked):
Create member accounts (if needed):
Set environment variables:
Note: The test will be skipped if either environment variable is not set. Both accounts must be part of your AWS Organization and you must have appropriate billing permissions in the management account.