/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace ResourceGroups { /** *

Resource Groups lets you organize Amazon Web Services resources such as * Amazon Elastic Compute Cloud instances, Amazon Relational Database Service * databases, and Amazon Simple Storage Service buckets into groups using criteria * that you define as tags. A resource group is a collection of resources that * match the resource types specified in a query, and share one or more tags or * portions of tags. You can create a group of resources based on their roles in * your cloud infrastructure, lifecycle stages, regions, application layers, or * virtually any criteria. Resource Groups enable you to automate management tasks, * such as those in Amazon Web Services Systems Manager Automation documents, on * tag-related resources in Amazon Web Services Systems Manager. Groups of tagged * resources also let you quickly view a custom console in Amazon Web Services * Systems Manager that shows Config compliance and other monitoring data about * member resources.

To create a resource group, build a resource query, and * specify tags that identify the criteria that members of the group have in * common. Tags are key-value pairs.

For more information about Resource * Groups, see the Resource * Groups User Guide.

Resource Groups uses a REST-compliant API that you * can use to perform the following types of operations.

  • Create, * Read, Update, and Delete (CRUD) operations on resource groups and resource query * entities

  • Applying, editing, and removing tags from resource * groups

  • Resolving resource group member ARNs so they can be * returned as search results

  • Getting data about resources that * are members of a group

  • Searching Amazon Web Services resources * based on a resource query

*/ class AWS_RESOURCEGROUPS_API ResourceGroupsClient : public Aws::Client::AWSJsonClient, public Aws::Client::ClientWithAsyncTemplateMethods { public: typedef Aws::Client::AWSJsonClient BASECLASS; static const char* SERVICE_NAME; static const char* ALLOCATION_TAG; typedef ResourceGroupsClientConfiguration ClientConfigurationType; typedef ResourceGroupsEndpointProvider EndpointProviderType; /** * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ ResourceGroupsClient(const Aws::ResourceGroups::ResourceGroupsClientConfiguration& clientConfiguration = Aws::ResourceGroups::ResourceGroupsClientConfiguration(), std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG)); /** * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ ResourceGroupsClient(const Aws::Auth::AWSCredentials& credentials, std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG), const Aws::ResourceGroups::ResourceGroupsClientConfiguration& clientConfiguration = Aws::ResourceGroups::ResourceGroupsClientConfiguration()); /** * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, * the default http client factory will be used */ ResourceGroupsClient(const std::shared_ptr& credentialsProvider, std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG), const Aws::ResourceGroups::ResourceGroupsClientConfiguration& clientConfiguration = Aws::ResourceGroups::ResourceGroupsClientConfiguration()); /* Legacy constructors due deprecation */ /** * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ ResourceGroupsClient(const Aws::Client::ClientConfiguration& clientConfiguration); /** * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ ResourceGroupsClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration); /** * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, * the default http client factory will be used */ ResourceGroupsClient(const std::shared_ptr& credentialsProvider, const Aws::Client::ClientConfiguration& clientConfiguration); /* End of legacy constructors due deprecation */ virtual ~ResourceGroupsClient(); /** *

Creates a resource group with the specified name and description. You can * optionally include either a resource query or a service configuration. For more * information about constructing a resource query, see Build * queries and groups in Resource Groups in the Resource Groups User * Guide. For more information about service-linked groups and service * configurations, see Service * configurations for Resource Groups.

Minimum permissions

*

To run this command, you must have the following permissions:

  • *

    resource-groups:CreateGroup

See * Also:

AWS * API Reference

*/ virtual Model::CreateGroupOutcome CreateGroup(const Model::CreateGroupRequest& request) const; /** * A Callable wrapper for CreateGroup that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::CreateGroupOutcomeCallable CreateGroupCallable(const CreateGroupRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::CreateGroup, request); } /** * An Async wrapper for CreateGroup that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void CreateGroupAsync(const CreateGroupRequestT& request, const CreateGroupResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::CreateGroup, request, handler, context); } /** *

Deletes the specified resource group. Deleting a resource group does not * delete any resources that are members of the group; it only deletes the group * structure.

Minimum permissions

To run this command, you * must have the following permissions:

  • * resource-groups:DeleteGroup

See Also:

* AWS * API Reference

*/ virtual Model::DeleteGroupOutcome DeleteGroup(const Model::DeleteGroupRequest& request) const; /** * A Callable wrapper for DeleteGroup that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::DeleteGroupOutcomeCallable DeleteGroupCallable(const DeleteGroupRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::DeleteGroup, request); } /** * An Async wrapper for DeleteGroup that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void DeleteGroupAsync(const DeleteGroupRequestT& request, const DeleteGroupResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::DeleteGroup, request, handler, context); } /** *

Retrieves the current status of optional features in Resource * Groups.

See Also:

AWS * API Reference

*/ virtual Model::GetAccountSettingsOutcome GetAccountSettings() const; /** * A Callable wrapper for GetAccountSettings that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GetAccountSettingsOutcomeCallable GetAccountSettingsCallable() const { return SubmitCallable(&ResourceGroupsClient::GetAccountSettings); } /** * An Async wrapper for GetAccountSettings that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GetAccountSettingsAsync(const GetAccountSettingsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::GetAccountSettings, handler, context); } /** *

Returns information about a specified resource group.

Minimum * permissions

To run this command, you must have the following * permissions:

  • resource-groups:GetGroup

  • *

See Also:

AWS * API Reference

*/ virtual Model::GetGroupOutcome GetGroup(const Model::GetGroupRequest& request) const; /** * A Callable wrapper for GetGroup that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GetGroupOutcomeCallable GetGroupCallable(const GetGroupRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::GetGroup, request); } /** * An Async wrapper for GetGroup that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GetGroupAsync(const GetGroupRequestT& request, const GetGroupResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::GetGroup, request, handler, context); } /** *

Retrieves the service configuration associated with the specified resource * group. For details about the service configuration syntax, see Service * configurations for Resource Groups.

Minimum permissions

*

To run this command, you must have the following permissions:

  • *

    resource-groups:GetGroupConfiguration

  • *

See Also:

AWS * API Reference

*/ virtual Model::GetGroupConfigurationOutcome GetGroupConfiguration(const Model::GetGroupConfigurationRequest& request) const; /** * A Callable wrapper for GetGroupConfiguration that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GetGroupConfigurationOutcomeCallable GetGroupConfigurationCallable(const GetGroupConfigurationRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::GetGroupConfiguration, request); } /** * An Async wrapper for GetGroupConfiguration that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GetGroupConfigurationAsync(const GetGroupConfigurationRequestT& request, const GetGroupConfigurationResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::GetGroupConfiguration, request, handler, context); } /** *

Retrieves the resource query associated with the specified resource group. * For more information about resource queries, see Create * a tag-based group in Resource Groups.

Minimum permissions *

To run this command, you must have the following permissions:

    *
  • resource-groups:GetGroupQuery

See * Also:

AWS * API Reference

*/ virtual Model::GetGroupQueryOutcome GetGroupQuery(const Model::GetGroupQueryRequest& request) const; /** * A Callable wrapper for GetGroupQuery that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GetGroupQueryOutcomeCallable GetGroupQueryCallable(const GetGroupQueryRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::GetGroupQuery, request); } /** * An Async wrapper for GetGroupQuery that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GetGroupQueryAsync(const GetGroupQueryRequestT& request, const GetGroupQueryResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::GetGroupQuery, request, handler, context); } /** *

Returns a list of tags that are associated with a resource group, specified * by an ARN.

Minimum permissions

To run this command, you * must have the following permissions:

  • * resource-groups:GetTags

See Also:

AWS * API Reference

*/ virtual Model::GetTagsOutcome GetTags(const Model::GetTagsRequest& request) const; /** * A Callable wrapper for GetTags that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GetTagsOutcomeCallable GetTagsCallable(const GetTagsRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::GetTags, request); } /** * An Async wrapper for GetTags that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GetTagsAsync(const GetTagsRequestT& request, const GetTagsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::GetTags, request, handler, context); } /** *

Adds the specified resources to the specified group.

You * can use this operation with only resource groups that are configured with the * following types:

  • AWS::EC2::HostManagement

    *
  • AWS::EC2::CapacityReservationPool

*

Other resource group type and resource types aren't currently supported by * this operation.

Minimum permissions

To run * this command, you must have the following permissions:

  • * resource-groups:GroupResources

See * Also:

AWS * API Reference

*/ virtual Model::GroupResourcesOutcome GroupResources(const Model::GroupResourcesRequest& request) const; /** * A Callable wrapper for GroupResources that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GroupResourcesOutcomeCallable GroupResourcesCallable(const GroupResourcesRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::GroupResources, request); } /** * An Async wrapper for GroupResources that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GroupResourcesAsync(const GroupResourcesRequestT& request, const GroupResourcesResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::GroupResources, request, handler, context); } /** *

Returns a list of ARNs of the resources that are members of a specified * resource group.

Minimum permissions

To run this command, * you must have the following permissions:

  • * resource-groups:ListGroupResources

  • * cloudformation:DescribeStacks

  • * cloudformation:ListStackResources

  • * tag:GetResources

See Also:

AWS * API Reference

*/ virtual Model::ListGroupResourcesOutcome ListGroupResources(const Model::ListGroupResourcesRequest& request) const; /** * A Callable wrapper for ListGroupResources that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ListGroupResourcesOutcomeCallable ListGroupResourcesCallable(const ListGroupResourcesRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::ListGroupResources, request); } /** * An Async wrapper for ListGroupResources that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ListGroupResourcesAsync(const ListGroupResourcesRequestT& request, const ListGroupResourcesResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::ListGroupResources, request, handler, context); } /** *

Returns a list of existing Resource Groups in your account.

* Minimum permissions

To run this command, you must have the * following permissions:

  • resource-groups:ListGroups *

See Also:

AWS * API Reference

*/ virtual Model::ListGroupsOutcome ListGroups(const Model::ListGroupsRequest& request) const; /** * A Callable wrapper for ListGroups that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ListGroupsOutcomeCallable ListGroupsCallable(const ListGroupsRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::ListGroups, request); } /** * An Async wrapper for ListGroups that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ListGroupsAsync(const ListGroupsRequestT& request, const ListGroupsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::ListGroups, request, handler, context); } /** *

Attaches a service configuration to the specified group. This occurs * asynchronously, and can take time to complete. You can use * GetGroupConfiguration to check the status of the update.

* Minimum permissions

To run this command, you must have the * following permissions:

  • * resource-groups:PutGroupConfiguration

See * Also:

AWS * API Reference

*/ virtual Model::PutGroupConfigurationOutcome PutGroupConfiguration(const Model::PutGroupConfigurationRequest& request) const; /** * A Callable wrapper for PutGroupConfiguration that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::PutGroupConfigurationOutcomeCallable PutGroupConfigurationCallable(const PutGroupConfigurationRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::PutGroupConfiguration, request); } /** * An Async wrapper for PutGroupConfiguration that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void PutGroupConfigurationAsync(const PutGroupConfigurationRequestT& request, const PutGroupConfigurationResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::PutGroupConfiguration, request, handler, context); } /** *

Returns a list of Amazon Web Services resource identifiers that matches the * specified query. The query uses the same format as a resource query in a * CreateGroup or UpdateGroupQuery operation.

Minimum * permissions

To run this command, you must have the following * permissions:

  • resource-groups:SearchResources

    *
  • cloudformation:DescribeStacks

  • * cloudformation:ListStackResources

  • * tag:GetResources

See Also:

AWS * API Reference

*/ virtual Model::SearchResourcesOutcome SearchResources(const Model::SearchResourcesRequest& request) const; /** * A Callable wrapper for SearchResources that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::SearchResourcesOutcomeCallable SearchResourcesCallable(const SearchResourcesRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::SearchResources, request); } /** * An Async wrapper for SearchResources that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void SearchResourcesAsync(const SearchResourcesRequestT& request, const SearchResourcesResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::SearchResources, request, handler, context); } /** *

Adds tags to a resource group with the specified ARN. Existing tags on a * resource group are not changed if they are not specified in the request * parameters.

Do not store personally identifiable information * (PII) or other confidential or sensitive information in tags. We use tags to * provide you with billing and administration services. Tags are not intended to * be used for private or sensitive data.

Minimum * permissions

To run this command, you must have the following * permissions:

  • resource-groups:Tag

  • *

See Also:

AWS * API Reference

*/ virtual Model::TagOutcome Tag(const Model::TagRequest& request) const; /** * A Callable wrapper for Tag that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::TagOutcomeCallable TagCallable(const TagRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::Tag, request); } /** * An Async wrapper for Tag that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void TagAsync(const TagRequestT& request, const TagResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::Tag, request, handler, context); } /** *

Removes the specified resources from the specified group. This operation * works only with static groups that you populated using the GroupResources * operation. It doesn't work with any resource groups that are automatically * populated by tag-based or CloudFormation stack-based queries.

Minimum * permissions

To run this command, you must have the following * permissions:

  • resource-groups:UngroupResources *

See Also:

AWS * API Reference

*/ virtual Model::UngroupResourcesOutcome UngroupResources(const Model::UngroupResourcesRequest& request) const; /** * A Callable wrapper for UngroupResources that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::UngroupResourcesOutcomeCallable UngroupResourcesCallable(const UngroupResourcesRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::UngroupResources, request); } /** * An Async wrapper for UngroupResources that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void UngroupResourcesAsync(const UngroupResourcesRequestT& request, const UngroupResourcesResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::UngroupResources, request, handler, context); } /** *

Deletes tags from a specified resource group.

Minimum * permissions

To run this command, you must have the following * permissions:

  • resource-groups:Untag

  • *

See Also:

AWS * API Reference

*/ virtual Model::UntagOutcome Untag(const Model::UntagRequest& request) const; /** * A Callable wrapper for Untag that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::UntagOutcomeCallable UntagCallable(const UntagRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::Untag, request); } /** * An Async wrapper for Untag that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void UntagAsync(const UntagRequestT& request, const UntagResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::Untag, request, handler, context); } /** *

Turns on or turns off optional features in Resource Groups.

The * preceding example shows that the request to turn on group lifecycle events is * IN_PROGRESS. You can call the GetAccountSettings operation * to check for completion by looking for GroupLifecycleEventsStatus * to change to ACTIVE.

See Also:

AWS * API Reference

*/ virtual Model::UpdateAccountSettingsOutcome UpdateAccountSettings(const Model::UpdateAccountSettingsRequest& request) const; /** * A Callable wrapper for UpdateAccountSettings that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::UpdateAccountSettingsOutcomeCallable UpdateAccountSettingsCallable(const UpdateAccountSettingsRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::UpdateAccountSettings, request); } /** * An Async wrapper for UpdateAccountSettings that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void UpdateAccountSettingsAsync(const UpdateAccountSettingsRequestT& request, const UpdateAccountSettingsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::UpdateAccountSettings, request, handler, context); } /** *

Updates the description for an existing group. You cannot update the name of * a resource group.

Minimum permissions

To run this * command, you must have the following permissions:

  • * resource-groups:UpdateGroup

See Also:

* AWS * API Reference

*/ virtual Model::UpdateGroupOutcome UpdateGroup(const Model::UpdateGroupRequest& request) const; /** * A Callable wrapper for UpdateGroup that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::UpdateGroupOutcomeCallable UpdateGroupCallable(const UpdateGroupRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::UpdateGroup, request); } /** * An Async wrapper for UpdateGroup that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void UpdateGroupAsync(const UpdateGroupRequestT& request, const UpdateGroupResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::UpdateGroup, request, handler, context); } /** *

Updates the resource query of a group. For more information about resource * queries, see Create * a tag-based group in Resource Groups.

Minimum permissions *

To run this command, you must have the following permissions:

    *
  • resource-groups:UpdateGroupQuery

  • *

See Also:

AWS * API Reference

*/ virtual Model::UpdateGroupQueryOutcome UpdateGroupQuery(const Model::UpdateGroupQueryRequest& request) const; /** * A Callable wrapper for UpdateGroupQuery that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::UpdateGroupQueryOutcomeCallable UpdateGroupQueryCallable(const UpdateGroupQueryRequestT& request) const { return SubmitCallable(&ResourceGroupsClient::UpdateGroupQuery, request); } /** * An Async wrapper for UpdateGroupQuery that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void UpdateGroupQueryAsync(const UpdateGroupQueryRequestT& request, const UpdateGroupQueryResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&ResourceGroupsClient::UpdateGroupQuery, request, handler, context); } void OverrideEndpoint(const Aws::String& endpoint); std::shared_ptr& accessEndpointProvider(); private: friend class Aws::Client::ClientWithAsyncTemplateMethods; void init(const ResourceGroupsClientConfiguration& clientConfiguration); ResourceGroupsClientConfiguration m_clientConfiguration; std::shared_ptr m_executor; std::shared_ptr m_endpointProvider; }; } // namespace ResourceGroups } // namespace Aws