put_inventory_configuration
¶
put_inventory_configuration(
regional_scope: RegionalScope,
account_scope: AccountScope,
status: InventoryStatus,
*,
config_overrides: Optional[ACMClientConfig] = None,
data_retention_days: Optional[int] = None,
lifecycle_management: Optional[LifecycleManagement] = None,
expiry_notification: Optional[InventoryExpiryNotification] = None,
inventory_tier: Optional[InventoryTier] = None,
) -> PutInventoryConfigurationOutput
Sets the organization's configuration for Certificate inventory for organizations, and returns it. The certificate inventory is the set of certificates observed in the organization's accounts. The first call with Status ENABLED creates the configuration. The Region of that call becomes the home Region, and later calls must be made there. Setup in the organization's accounts continues after the call returns. To follow it, read ProvisioningStatus with GetInventoryConfiguration. The caller must be the organization's management account or its delegated administrator in AWS Organizations. Otherwise, the operation returns AccessDeniedException. The first call starts the organization's AWS Certificate Manager (ACM) plan (Essentials or Pro), so only the management account can make it. A delegated administrator can make later calls as soon as it is registered. The call does not require that AWS Organizations trusted access is on, that all features are enabled in the organization, or that a delegated administrator is registered. Setup requires them. If a requirement is not met, GetInventoryConfiguration shows ProvisioningStatus FAILED, with a reason code and a message. The operation returns ConflictException for these calls: - A first call with Status DISABLED. - A call from a Region other than the home Region. - A call while a previous change is still being set up, unless it repeats the stored configuration. DataRetentionDays is not kept when you omit it. A call without it sets retention to 90 days, even if a different value is stored. LifecycleManagement turns Certificate actions for organizations on or off. Certificate actions are the operations that act on certificates and certificate authorities in the organization's member accounts. Omit LifecycleManagement to keep the stored value. The first call can turn certificate actions on, and no registered delegated administrator is needed. Status DISABLED also turns certificate actions off. Turning them on while Status is DISABLED returns ValidationException. To follow setup in the member accounts, read LifecycleManagement.ProvisioningStatus with GetInventoryConfiguration. ExpiryNotification sets certificate expiry notifications. Omit it to keep the stored setting, or set Enabled to false to turn notifications off. With Enabled true, Channel and TopicArn are required. The topic must be a standard (non-FIFO) Amazon SNS topic in the management account and the home Region. It must also be in the partition of the endpoint you call. Otherwise, the operation returns ValidationException. Each save with Enabled true verifies the topic again after the call returns. To follow it, read LastDeliveryStatus with GetInventoryConfiguration. A call that repeats the stored configuration returns it, even while a previous change is still being set up. To retry a failed setup, repeat the call with Status ENABLED after ProvisioningStatus is FAILED. With ExpiryNotification Enabled true, a repeated call also verifies the topic again. InventoryTier names the organization's ACM plan: Essentials or Pro. It is optional. Omit it to keep the current plan. While the organization has no plan, such as on the first call, a call with Status ENABLED must name one. Otherwise, it returns ValidationException. With Status ENABLED, the named plan is the plan to subscribe to. The first plan and a higher plan take effect immediately. A lower plan takes effect at the end of the billing period. With Status DISABLED, InventoryTier is ignored. Certificate actions turn off immediately. The plan ends at the end of the billing period, and collection stays on until then. Repeating the DISABLED call before then does not change the plan again. If the organization has no plan, a DISABLED call turns collection off immediately. Until the plan ends, a Status ENABLED call that omits InventoryTier leaves the end in place. To read the scheduled end, use InventoryTierConfiguration.ScheduledChange in GetInventoryConfiguration. A call that names the ending plan returns ConflictException. A call that names the other plan replaces the scheduled end with that plan. A scheduled downgrade cannot be taken back either. While one is scheduled, a call that names the plan in effect returns ConflictException. Only the management account can start, change, or end the plan. A delegated administrator call that would do so returns AccessDeniedException. A delegated administrator call succeeds when it omits InventoryTier or names the plan last requested. While the plan is scheduled to end, there is no requested plan, so a delegated administrator call that names any plan returns AccessDeniedException. The response does not include the plan. Read InventoryTierConfiguration with GetInventoryConfiguration, which can take a few seconds to show a change.
Parameters:
-
regional_scope(RegionalScope) –The Regions to collect from.
-
account_scope(AccountScope) –The accounts to collect from.
-
data_retention_days(Optional[int], default:None) –How many days inventory data is kept, 90 to 365. When omitted, retention is set to 90 days, even if a different value is stored.
-
status(InventoryStatus) –ENABLED turns collection on. DISABLED turns collection off and keeps an existing configuration. If the organization has an ACM plan, DISABLED instead ends the plan at the end of the billing period. Collection stays on until then, and the configuration's Status stays ENABLED. To see when the plan ends, read InventoryTierConfiguration.ScheduledChange with GetInventoryConfiguration. Certificate actions for organizations still turn off immediately. Without a plan, DISABLED turns collection off immediately. DISABLED cannot create the organization's first configuration.
-
lifecycle_management(Optional[LifecycleManagement], default:None) –Turns Certificate actions for organizations on or off. Certificate actions are the operations that act on certificates and certificate authorities in the organization's member accounts, such as RenewMemberCertificate. Omit it to keep the stored value.
-
expiry_notification(Optional[InventoryExpiryNotification], default:None) –Certificate expiry notifications. Omit it to keep the stored setting. Set Enabled to false to turn notifications off. Members you leave out of ExpiryNotification take their defaults.
-
inventory_tier(Optional[InventoryTier], default:None) –The organization's ACM plan: Essentials or Pro. This API calls the ACM plan the inventory tier. Omit it to keep the current plan. With Status ENABLED, this is the plan to subscribe to. While the organization has no plan, such as on the first call, a call with Status ENABLED must name one. Otherwise, it returns ValidationException. With Status DISABLED, it is ignored, and the plan ends at the end of the billing period. Only the organization's management account can start, change, or end the plan. A delegated administrator call that would do so returns AccessDeniedException, even when its IAM policy allows the action. PutInventoryConfiguration never returns the plan. A template or script that always sends the same plan undoes a plan set another way. For example, it changes an upgrade made in the console back to the plan it sends. To leave the plan as it is, omit InventoryTier.
Raises:
-
AccessDeniedException–You do not have access required to perform this action.
-
ConflictException–You are trying to update a resource or configuration that is already being created or updated. Wait for the previous operation to finish and try again.
-
InternalServerException–The request processing has failed because of an unknown error, exception, or failure.
-
ThrottlingException–The request was denied because it exceeded a quota.
-
ValidationException–The supplied input failed to satisfy constraints of an Amazon Web Services service.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Collect from two Regions and every account DataRetentionDays is omitted, so data is kept for 90 days. Setup is still running when the call returns.
>>> client.put_inventory_configuration(regional_scope={'Mode': 'INCLUDE', 'Regions': ['us-east-1', 'eu-west-1']}, account_scope={'Mode': 'ALL_ACCOUNTS'}, status='ENABLED', inventory_tier='ESSENTIALS')
Turn on collection and certificate actions
The organization's first call. Setup in the member accounts is still running when the call returns.
>>> client.put_inventory_configuration(regional_scope={'Mode': 'ALL_REGIONS'}, account_scope={'Mode': 'ALL_ACCOUNTS'}, status='ENABLED', inventory_tier='PRO', lifecycle_management={'Status': 'ENABLED'})
Turn on expiry notifications
Notifications go daily to an Amazon SNS topic in the management account and home Region. They start 30 days before a certificate expires. The topic is verified after the call returns.
>>> client.put_inventory_configuration(regional_scope={'Mode': 'ALL_REGIONS'}, account_scope={'Mode': 'ALL_ACCOUNTS'}, status='ENABLED', inventory_tier='ESSENTIALS', expiry_notification={'Enabled': True, 'Channel': 'SNS', 'TopicArn': 'arn:aws:sns:us-east-1:111122223333:cert-expiry', 'LeadTimeDays': 30, 'Frequency': 'DAILY'})
Put the configuration from another Region
The configuration's home Region is us-east-1, and this call was made in eu-west-1.
>>> client.put_inventory_configuration(regional_scope={'Mode': 'ALL_REGIONS'}, account_scope={'Mode': 'ALL_ACCOUNTS'}, status='ENABLED')
Turn off collection and end the ACM plan
The organization is on the Pro plan. The plan ends at the end of the billing period, and collection stays on until then. GetInventoryConfiguration reports the scheduled end.
>>> client.put_inventory_configuration(regional_scope={'Mode': 'ALL_REGIONS'}, account_scope={'Mode': 'ALL_ACCOUNTS'}, status='DISABLED')
Change the Regions from the delegated administrator
The delegated administrator narrows collection to two Regions. InventoryTier is omitted, so the organization's ACM plan is unchanged.
>>> client.put_inventory_configuration(regional_scope={'Mode': 'INCLUDE', 'Regions': ['us-east-1', 'eu-west-1']}, account_scope={'Mode': 'ALL_ACCOUNTS'}, status='ENABLED')
Turn on collection without an ACM plan
The organization's first call omits InventoryTier. The message calls the ACM plan a tier.
>>> client.put_inventory_configuration(regional_scope={'Mode': 'ALL_REGIONS'}, account_scope={'Mode': 'ALL_ACCOUNTS'}, status='ENABLED')
Change the ACM plan from the delegated administrator
The organization is on the Essentials plan, and the delegated administrator asks for Pro. Only the management account can change the plan. The message calls the ACM plan a tier.
>>> client.put_inventory_configuration(regional_scope={'Mode': 'ALL_REGIONS'}, account_scope={'Mode': 'ALL_ACCOUNTS'}, status='ENABLED', inventory_tier='PRO')
Turn collection back on before the ACM plan ends
The Pro plan is scheduled to end on December 1, 2026, and the call asks for Pro again before then. The message calls the ACM plan a tier.
>>> client.put_inventory_configuration(regional_scope={'Mode': 'ALL_REGIONS'}, account_scope={'Mode': 'ALL_ACCOUNTS'}, status='ENABLED', inventory_tier='PRO')
Source code in docs_src/capo_acm/_services/acm.py
2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 | |