invoice_units
Creates, updates, deletes, gets or lists an invoice_units resource.
Overview
| Name | invoice_units |
| Type | Resource |
| Id | aws.invoicing.invoice_units |
Fields
The following fields are returned by SELECT queries:
- get_invoice_unit
- list_invoice_units
| Name | Datatype | Description |
|---|---|---|
description | string | The assigned description for an invoice unit. (pattern: <code>[\S\s]*</code>) |
invoice_receiver | string | The Amazon Web Services account ID chosen to be the receiver of an invoice unit. All invoices generated for that invoice unit will be sent to this account ID. (pattern: <code>\d{12}</code>) |
invoice_unit_arn | string | The ARN to identify an invoice unit. This information can't be modified or deleted. (pattern: <code>arn:aws[-a-z0-9]:[a-z0-9]+:[-a-z0-9]:[0-9]{12}:[-a-zA-Z0-9/:_]+</code>) |
last_modified | string (date-time) | The most recent date the invoice unit response was updated. |
name | string | The unique name of the invoice unit that is shown on the generated invoice. (pattern: <code>(?! )[\p{L}\p{N}\p{Z}-_]*(?<! )</code>) |
rule | object | This is used to categorize the invoice unit. Values are Amazon Web Services account IDs. Currently, the only supported rule is LINKED_ACCOUNT. |
tax_inheritance_disabled | boolean | Whether the invoice unit based tax inheritance is/ should be enabled or disabled. |
| Name | Datatype | Description |
|---|---|---|
description | string | The assigned description for an invoice unit. This information can't be modified or deleted. (pattern: <code>[\S\s]*</code>) |
invoice_receiver | string | The account that receives invoices related to the invoice unit. (pattern: <code>\d{12}</code>) |
invoice_unit_arn | string | ARN to identify an invoice unit. This information can't be modified or deleted. (pattern: <code>arn:aws[-a-z0-9]:[a-z0-9]+:[-a-z0-9]:[0-9]{12}:[-a-zA-Z0-9/:_]+</code>) |
last_modified | string (date-time) | The last time the invoice unit was updated. This is important to determine the version of invoice unit configuration used to create the invoices. Any invoice created after this modified time will use this invoice unit configuration. |
name | string | A unique name that is distinctive within your Amazon Web Services. (pattern: <code>(?! )[\p{L}\p{N}\p{Z}-_]*(?<! )</code>) |
rule | object | This is used to categorize the invoice unit. Values are Amazon Web Services account IDs. Currently, the only supported rule is LINKED_ACCOUNT. |
tax_inheritance_disabled | boolean | Whether the invoice unit based tax inheritance is/ should be enabled or disabled. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_invoice_unit | select | region | This retrieves the invoice unit definition. | |
list_invoice_units | select | region | This fetches a list of all invoice unit definitions for a given account, as of the provided AsOf date. | |
create_invoice_unit | insert | region, InvoiceReceiver | This creates a new invoice unit with the provided definition. | |
update_invoice_unit | update | region, InvoiceUnitArn | You can update the invoice unit configuration at any time, and Amazon Web Services will use the latest configuration at the end of the month. | |
delete_invoice_unit | delete | region | This deletes an invoice unit with the provided invoice unit ARN. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_invoice_unit
- list_invoice_units
This retrieves the invoice unit definition.
SELECT
description,
invoice_receiver,
invoice_unit_arn,
last_modified,
name,
rule,
tax_inheritance_disabled
FROM aws.invoicing.invoice_units
WHERE region = '{{ region }}' -- required
;
This fetches a list of all invoice unit definitions for a given account, as of the provided AsOf date.
SELECT
description,
invoice_receiver,
invoice_unit_arn,
last_modified,
name,
rule,
tax_inheritance_disabled
FROM aws.invoicing.invoice_units
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_invoice_unit
- Manifest
This creates a new invoice unit with the provided definition.
INSERT INTO aws.invoicing.invoice_units (
Name,
InvoiceReceiver,
Description,
TaxInheritanceDisabled,
Rule,
ResourceTags,
ClientToken,
region
)
SELECT
'{{ Name }}',
'{{ InvoiceReceiver }}' /* required */,
'{{ Description }}',
{{ TaxInheritanceDisabled }},
'{{ Rule }}',
'{{ ResourceTags }}',
'{{ ClientToken }}',
'{{ region }}'
RETURNING
invoice_unit_arn
;
# Description fields are for documentation purposes
- name: invoice_units
props:
- name: region
value: "{{ region }}"
description: Required parameter for the invoice_units resource.
- name: Name
value: "{{ Name }}"
description: |
The unique name of the invoice unit that is shown on the generated invoice. This can't be changed once it is set. To change this name, you must delete the invoice unit recreate.
- name: InvoiceReceiver
value: "{{ InvoiceReceiver }}"
description: |
The Amazon Web Services account ID chosen to be the receiver of an invoice unit. All invoices generated for that invoice unit will be sent to this account ID.
- name: Description
value: "{{ Description }}"
description: |
The invoice unit's description. This can be changed at a later time.
- name: TaxInheritanceDisabled
value: {{ TaxInheritanceDisabled }}
description: |
Whether the invoice unit based tax inheritance is/ should be enabled or disabled.
- name: Rule
description: |
The InvoiceUnitRule object used to create invoice units.
value:
LinkedAccounts:
- "{{ LinkedAccounts }}"
BillSourceAccounts:
- "{{ BillSourceAccounts }}"
- name: ResourceTags
description: |
The tag structure that contains a tag key and value.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: ClientToken
value: "{{ ClientToken }}"
description: |
A unique, case-sensitive identifier that you provide to ensure idempotency of the request.
UPDATE examples
- update_invoice_unit
You can update the invoice unit configuration at any time, and Amazon Web Services will use the latest configuration at the end of the month.
UPDATE aws.invoicing.invoice_units
SET
InvoiceUnitArn = '{{ InvoiceUnitArn }}',
Description = '{{ Description }}',
TaxInheritanceDisabled = {{ TaxInheritanceDisabled }},
Rule = '{{ Rule }}',
ClientToken = '{{ ClientToken }}'
WHERE
region = '{{ region }}' --required
AND InvoiceUnitArn = '{{ InvoiceUnitArn }}' --required
RETURNING
invoice_unit_arn;
DELETE examples
- delete_invoice_unit
This deletes an invoice unit with the provided invoice unit ARN.
DELETE FROM aws.invoicing.invoice_units
WHERE region = '{{ region }}' --required
;