Soto icon

Soto

ResourceGroups

Service object for interacting with AWS ResourceGroups service.

public struct ResourceGroups: AWSService
AWS Resource Groups

AWS Resource Groups lets you organize AWS resources such as Amazon EC2 instances, Amazon Relational Database Service databases, and Amazon S3 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 AWS Systems Manager Automation documents, on tag-related resources in AWS Systems Manager. Groups of tagged resources also let you quickly view a custom console in AWS Systems Manager that shows AWS 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 AWS Resource Groups User Guide.

AWS 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 AWS resources based on a resource query

Inheritance

AWSService

Initializers

init(client:region:partition:endpoint:timeout:byteBufferAllocator:options:)

Initialize the ResourceGroups client

public init(client: AWSClient, region: SotoCore.Region? = nil, partition: AWSPartition = .aws, endpoint: String? = nil, timeout: TimeAmount? = nil, byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(), options: AWSServiceConfig.Options = [])

Parameters

  • client: AWSClient used to process requests
  • region: Region of server you want to communicate with. This will override the partition parameter.
  • partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
  • endpoint: Custom endpoint URL to use instead of standard AWS servers
  • timeout: Timeout value for HTTP requests

init(from:patch:)

Initializer required by AWSService.with(middlewares:​timeout:​byteBufferAllocator:​options). You are not able to use this initializer directly as there are no public initializers for AWSServiceConfig.Patch. Please use AWSService.with(middlewares:​timeout:​byteBufferAllocator:​options) instead.

public init(from: ResourceGroups, patch: AWSServiceConfig.Patch)

Properties

client

Client used for communication with AWS

let client: AWSClient

config

Service configuration

let config: AWSServiceConfig

Methods

createGroup(_:logger:on:)

public func createGroup(_ input: CreateGroupInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<CreateGroupOutput>

Creates a resource group with the specified name and description. You can optionally include a resource query, or a service configuration. For more information about constructing a resource query, see Create a tag-based group in Resource Groups. For more information about service configurations, see Service configurations for resource groups.

Minimum permissions

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

  • resource-groups:CreateGroup

deleteGroup(_:logger:on:)

public func deleteGroup(_ input: DeleteGroupInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<DeleteGroupOutput>

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

getGroup(_:logger:on:)

public func getGroup(_ input: GetGroupInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<GetGroupOutput>

Returns information about a specified resource group.

Minimum permissions

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

  • resource-groups:GetGroup

getGroupConfiguration(_:logger:on:)

public func getGroupConfiguration(_ input: GetGroupConfigurationInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<GetGroupConfigurationOutput>

Returns 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

getGroupQuery(_:logger:on:)

public func getGroupQuery(_ input: GetGroupQueryInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<GetGroupQueryOutput>

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

getTags(_:logger:on:)

public func getTags(_ input: GetTagsInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<GetTagsOutput>

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

groupResources(_:logger:on:)

public func groupResources(_ input: GroupResourcesInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<GroupResourcesOutput>

Adds the specified resources to the specified group.

Minimum permissions

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

  • resource-groups:GroupResources

listGroupResources(_:logger:on:)

public func listGroupResources(_ input: ListGroupResourcesInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<ListGroupResourcesOutput>

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

listGroups(_:logger:on:)

public func listGroups(_ input: ListGroupsInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<ListGroupsOutput>

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

putGroupConfiguration(_:logger:on:)

public func putGroupConfiguration(_ input: PutGroupConfigurationInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<PutGroupConfigurationOutput>

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

searchResources(_:logger:on:)

public func searchResources(_ input: SearchResourcesInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<SearchResourcesOutput>

Returns a list of AWS 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

tag(_:logger:on:)

public func tag(_ input: TagInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<TagOutput>

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

ungroupResources(_:logger:on:)

public func ungroupResources(_ input: UngroupResourcesInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<UngroupResourcesOutput>

Removes the specified resources from the specified group.

Minimum permissions

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

  • resource-groups:UngroupResources

untag(_:logger:on:)

public func untag(_ input: UntagInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<UntagOutput>

Deletes tags from a specified resource group.

Minimum permissions

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

  • resource-groups:Untag

updateGroup(_:logger:on:)

public func updateGroup(_ input: UpdateGroupInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<UpdateGroupOutput>

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

updateGroupQuery(_:logger:on:)

public func updateGroupQuery(_ input: UpdateGroupQueryInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<UpdateGroupQueryOutput>

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

listGroupResourcesPaginator(_:_:logger:on:onPage:)

public func listGroupResourcesPaginator<Result>(_ input: ListGroupResourcesInput, _ initialValue: Result, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil, onPage: @escaping (Result, ListGroupResourcesOutput, EventLoop) -> EventLoopFuture<(Bool, Result)>) -> EventLoopFuture<Result>

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

Provide paginated results to closure onPage for it to combine them into one result. This works in a similar manner to Array.reduce<Result>(_:_:) -> Result.

Parameters:

  • input: Input for request
  • initialValue: The value to use as the initial accumulating value. initialValue is passed to onPage the first time it is called.
  • logger: Logger used for logging output
  • eventLoop: EventLoop to run this process on
  • onPage: closure called with each paginated response. It combines an accumulating result with the contents of response. This combined result is then returned along with a boolean indicating if the paginate operation should continue.

listGroupResourcesPaginator(_:logger:on:onPage:)

Provide paginated results to closure onPage.

public func listGroupResourcesPaginator(_ input: ListGroupResourcesInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil, onPage: @escaping (ListGroupResourcesOutput, EventLoop) -> EventLoopFuture<Bool>) -> EventLoopFuture<Void>

Parameters

  • input: Input for request
  • logger: Logger used for logging output
  • eventLoop: EventLoop to run this process on
  • onPage: closure called with each block of entries. Returns boolean indicating whether we should continue.

listGroupsPaginator(_:_:logger:on:onPage:)

public func listGroupsPaginator<Result>(_ input: ListGroupsInput, _ initialValue: Result, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil, onPage: @escaping (Result, ListGroupsOutput, EventLoop) -> EventLoopFuture<(Bool, Result)>) -> EventLoopFuture<Result>

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

Provide paginated results to closure onPage for it to combine them into one result. This works in a similar manner to Array.reduce<Result>(_:_:) -> Result.

Parameters:

  • input: Input for request
  • initialValue: The value to use as the initial accumulating value. initialValue is passed to onPage the first time it is called.
  • logger: Logger used for logging output
  • eventLoop: EventLoop to run this process on
  • onPage: closure called with each paginated response. It combines an accumulating result with the contents of response. This combined result is then returned along with a boolean indicating if the paginate operation should continue.

listGroupsPaginator(_:logger:on:onPage:)

Provide paginated results to closure onPage.

public func listGroupsPaginator(_ input: ListGroupsInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil, onPage: @escaping (ListGroupsOutput, EventLoop) -> EventLoopFuture<Bool>) -> EventLoopFuture<Void>

Parameters

  • input: Input for request
  • logger: Logger used for logging output
  • eventLoop: EventLoop to run this process on
  • onPage: closure called with each block of entries. Returns boolean indicating whether we should continue.

searchResourcesPaginator(_:_:logger:on:onPage:)

public func searchResourcesPaginator<Result>(_ input: SearchResourcesInput, _ initialValue: Result, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil, onPage: @escaping (Result, SearchResourcesOutput, EventLoop) -> EventLoopFuture<(Bool, Result)>) -> EventLoopFuture<Result>

Returns a list of AWS 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

Provide paginated results to closure onPage for it to combine them into one result. This works in a similar manner to Array.reduce<Result>(_:_:) -> Result.

Parameters:

  • input: Input for request
  • initialValue: The value to use as the initial accumulating value. initialValue is passed to onPage the first time it is called.
  • logger: Logger used for logging output
  • eventLoop: EventLoop to run this process on
  • onPage: closure called with each paginated response. It combines an accumulating result with the contents of response. This combined result is then returned along with a boolean indicating if the paginate operation should continue.

searchResourcesPaginator(_:logger:on:onPage:)

Provide paginated results to closure onPage.

public func searchResourcesPaginator(_ input: SearchResourcesInput, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil, onPage: @escaping (SearchResourcesOutput, EventLoop) -> EventLoopFuture<Bool>) -> EventLoopFuture<Void>

Parameters

  • input: Input for request
  • logger: Logger used for logging output
  • eventLoop: EventLoop to run this process on
  • onPage: closure called with each block of entries. Returns boolean indicating whether we should continue.