UNPKG

22.2 kBTypeScriptView Raw
1import {Request} from '../lib/request';
2import {Response} from '../lib/response';
3import {AWSError} from '../lib/error';
4import {Service} from '../lib/service';
5import {ServiceConfigurationOptions} from '../lib/service';
6import {ConfigBase as Config} from '../lib/config';
7interface Blob {}
8declare class ResourceGroups extends Service {
9 /**
10 * Constructs a service object. This object has one method for each API operation.
11 */
12 constructor(options?: ResourceGroups.Types.ClientConfiguration)
13 config: Config & ResourceGroups.Types.ClientConfiguration;
14 /**
15 * Creates a group with a specified name, description, and resource query.
16 */
17 createGroup(params: ResourceGroups.Types.CreateGroupInput, callback?: (err: AWSError, data: ResourceGroups.Types.CreateGroupOutput) => void): Request<ResourceGroups.Types.CreateGroupOutput, AWSError>;
18 /**
19 * Creates a group with a specified name, description, and resource query.
20 */
21 createGroup(callback?: (err: AWSError, data: ResourceGroups.Types.CreateGroupOutput) => void): Request<ResourceGroups.Types.CreateGroupOutput, AWSError>;
22 /**
23 * Deletes a specified resource group. Deleting a resource group does not delete resources that are members of the group; it only deletes the group structure.
24 */
25 deleteGroup(params: ResourceGroups.Types.DeleteGroupInput, callback?: (err: AWSError, data: ResourceGroups.Types.DeleteGroupOutput) => void): Request<ResourceGroups.Types.DeleteGroupOutput, AWSError>;
26 /**
27 * Deletes a specified resource group. Deleting a resource group does not delete resources that are members of the group; it only deletes the group structure.
28 */
29 deleteGroup(callback?: (err: AWSError, data: ResourceGroups.Types.DeleteGroupOutput) => void): Request<ResourceGroups.Types.DeleteGroupOutput, AWSError>;
30 /**
31 * Returns information about a specified resource group.
32 */
33 getGroup(params: ResourceGroups.Types.GetGroupInput, callback?: (err: AWSError, data: ResourceGroups.Types.GetGroupOutput) => void): Request<ResourceGroups.Types.GetGroupOutput, AWSError>;
34 /**
35 * Returns information about a specified resource group.
36 */
37 getGroup(callback?: (err: AWSError, data: ResourceGroups.Types.GetGroupOutput) => void): Request<ResourceGroups.Types.GetGroupOutput, AWSError>;
38 /**
39 * Returns the resource query associated with the specified resource group.
40 */
41 getGroupQuery(params: ResourceGroups.Types.GetGroupQueryInput, callback?: (err: AWSError, data: ResourceGroups.Types.GetGroupQueryOutput) => void): Request<ResourceGroups.Types.GetGroupQueryOutput, AWSError>;
42 /**
43 * Returns the resource query associated with the specified resource group.
44 */
45 getGroupQuery(callback?: (err: AWSError, data: ResourceGroups.Types.GetGroupQueryOutput) => void): Request<ResourceGroups.Types.GetGroupQueryOutput, AWSError>;
46 /**
47 * Returns a list of tags that are associated with a resource group, specified by an ARN.
48 */
49 getTags(params: ResourceGroups.Types.GetTagsInput, callback?: (err: AWSError, data: ResourceGroups.Types.GetTagsOutput) => void): Request<ResourceGroups.Types.GetTagsOutput, AWSError>;
50 /**
51 * Returns a list of tags that are associated with a resource group, specified by an ARN.
52 */
53 getTags(callback?: (err: AWSError, data: ResourceGroups.Types.GetTagsOutput) => void): Request<ResourceGroups.Types.GetTagsOutput, AWSError>;
54 /**
55 * Returns a list of ARNs of resources that are members of a specified resource group.
56 */
57 listGroupResources(params: ResourceGroups.Types.ListGroupResourcesInput, callback?: (err: AWSError, data: ResourceGroups.Types.ListGroupResourcesOutput) => void): Request<ResourceGroups.Types.ListGroupResourcesOutput, AWSError>;
58 /**
59 * Returns a list of ARNs of resources that are members of a specified resource group.
60 */
61 listGroupResources(callback?: (err: AWSError, data: ResourceGroups.Types.ListGroupResourcesOutput) => void): Request<ResourceGroups.Types.ListGroupResourcesOutput, AWSError>;
62 /**
63 * Returns a list of existing resource groups in your account.
64 */
65 listGroups(params: ResourceGroups.Types.ListGroupsInput, callback?: (err: AWSError, data: ResourceGroups.Types.ListGroupsOutput) => void): Request<ResourceGroups.Types.ListGroupsOutput, AWSError>;
66 /**
67 * Returns a list of existing resource groups in your account.
68 */
69 listGroups(callback?: (err: AWSError, data: ResourceGroups.Types.ListGroupsOutput) => void): Request<ResourceGroups.Types.ListGroupsOutput, AWSError>;
70 /**
71 * Returns a list of AWS resource identifiers that matches a specified query. The query uses the same format as a resource query in a CreateGroup or UpdateGroupQuery operation.
72 */
73 searchResources(params: ResourceGroups.Types.SearchResourcesInput, callback?: (err: AWSError, data: ResourceGroups.Types.SearchResourcesOutput) => void): Request<ResourceGroups.Types.SearchResourcesOutput, AWSError>;
74 /**
75 * Returns a list of AWS resource identifiers that matches a specified query. The query uses the same format as a resource query in a CreateGroup or UpdateGroupQuery operation.
76 */
77 searchResources(callback?: (err: AWSError, data: ResourceGroups.Types.SearchResourcesOutput) => void): Request<ResourceGroups.Types.SearchResourcesOutput, AWSError>;
78 /**
79 * 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.
80 */
81 tag(params: ResourceGroups.Types.TagInput, callback?: (err: AWSError, data: ResourceGroups.Types.TagOutput) => void): Request<ResourceGroups.Types.TagOutput, AWSError>;
82 /**
83 * 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.
84 */
85 tag(callback?: (err: AWSError, data: ResourceGroups.Types.TagOutput) => void): Request<ResourceGroups.Types.TagOutput, AWSError>;
86 /**
87 * Deletes specified tags from a specified resource.
88 */
89 untag(params: ResourceGroups.Types.UntagInput, callback?: (err: AWSError, data: ResourceGroups.Types.UntagOutput) => void): Request<ResourceGroups.Types.UntagOutput, AWSError>;
90 /**
91 * Deletes specified tags from a specified resource.
92 */
93 untag(callback?: (err: AWSError, data: ResourceGroups.Types.UntagOutput) => void): Request<ResourceGroups.Types.UntagOutput, AWSError>;
94 /**
95 * Updates an existing group with a new or changed description. You cannot update the name of a resource group.
96 */
97 updateGroup(params: ResourceGroups.Types.UpdateGroupInput, callback?: (err: AWSError, data: ResourceGroups.Types.UpdateGroupOutput) => void): Request<ResourceGroups.Types.UpdateGroupOutput, AWSError>;
98 /**
99 * Updates an existing group with a new or changed description. You cannot update the name of a resource group.
100 */
101 updateGroup(callback?: (err: AWSError, data: ResourceGroups.Types.UpdateGroupOutput) => void): Request<ResourceGroups.Types.UpdateGroupOutput, AWSError>;
102 /**
103 * Updates the resource query of a group.
104 */
105 updateGroupQuery(params: ResourceGroups.Types.UpdateGroupQueryInput, callback?: (err: AWSError, data: ResourceGroups.Types.UpdateGroupQueryOutput) => void): Request<ResourceGroups.Types.UpdateGroupQueryOutput, AWSError>;
106 /**
107 * Updates the resource query of a group.
108 */
109 updateGroupQuery(callback?: (err: AWSError, data: ResourceGroups.Types.UpdateGroupQueryOutput) => void): Request<ResourceGroups.Types.UpdateGroupQueryOutput, AWSError>;
110}
111declare namespace ResourceGroups {
112 export interface CreateGroupInput {
113 /**
114 * The name of the group, which is the identifier of the group in other operations. A resource group name cannot be updated after it is created. A resource group name can have a maximum of 128 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with AWS or aws; these are reserved. A resource group name must be unique within your account.
115 */
116 Name: GroupName;
117 /**
118 * The description of the resource group. Descriptions can have a maximum of 511 characters, including letters, numbers, hyphens, underscores, punctuation, and spaces.
119 */
120 Description?: GroupDescription;
121 /**
122 * The resource query that determines which AWS resources are members of this group.
123 */
124 ResourceQuery: ResourceQuery;
125 /**
126 * The tags to add to the group. A tag is a string-to-string map of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
127 */
128 Tags?: Tags;
129 }
130 export interface CreateGroupOutput {
131 /**
132 * A full description of the resource group after it is created.
133 */
134 Group?: Group;
135 /**
136 * The resource query associated with the group.
137 */
138 ResourceQuery?: ResourceQuery;
139 /**
140 * The tags associated with the group.
141 */
142 Tags?: Tags;
143 }
144 export interface DeleteGroupInput {
145 /**
146 * The name of the resource group to delete.
147 */
148 GroupName: GroupName;
149 }
150 export interface DeleteGroupOutput {
151 /**
152 * A full description of the deleted resource group.
153 */
154 Group?: Group;
155 }
156 export interface GetGroupInput {
157 /**
158 * The name of the resource group.
159 */
160 GroupName: GroupName;
161 }
162 export interface GetGroupOutput {
163 /**
164 * A full description of the resource group.
165 */
166 Group?: Group;
167 }
168 export interface GetGroupQueryInput {
169 /**
170 * The name of the resource group.
171 */
172 GroupName: GroupName;
173 }
174 export interface GetGroupQueryOutput {
175 /**
176 * The resource query associated with the specified group.
177 */
178 GroupQuery?: GroupQuery;
179 }
180 export interface GetTagsInput {
181 /**
182 * The ARN of the resource group for which you want a list of tags. The resource must exist within the account you are using.
183 */
184 Arn: GroupArn;
185 }
186 export interface GetTagsOutput {
187 /**
188 * The ARN of the tagged resource group.
189 */
190 Arn?: GroupArn;
191 /**
192 * The tags associated with the specified resource group.
193 */
194 Tags?: Tags;
195 }
196 export interface Group {
197 /**
198 * The ARN of a resource group.
199 */
200 GroupArn: GroupArn;
201 /**
202 * The name of a resource group.
203 */
204 Name: GroupName;
205 /**
206 * The description of the resource group.
207 */
208 Description?: GroupDescription;
209 }
210 export type GroupArn = string;
211 export type GroupDescription = string;
212 export interface GroupFilter {
213 /**
214 * The name of the filter. Filter names are case-sensitive.
215 */
216 Name: GroupFilterName;
217 /**
218 * One or more filter values. Allowed filter values vary by group filter name, and are case-sensitive.
219 */
220 Values: GroupFilterValues;
221 }
222 export type GroupFilterList = GroupFilter[];
223 export type GroupFilterName = "resource-type"|string;
224 export type GroupFilterValue = string;
225 export type GroupFilterValues = GroupFilterValue[];
226 export interface GroupIdentifier {
227 /**
228 * The name of a resource group.
229 */
230 GroupName?: GroupName;
231 /**
232 * The ARN of a resource group.
233 */
234 GroupArn?: GroupArn;
235 }
236 export type GroupIdentifierList = GroupIdentifier[];
237 export type GroupList = Group[];
238 export type GroupName = string;
239 export interface GroupQuery {
240 /**
241 * The name of a resource group that is associated with a specific resource query.
242 */
243 GroupName: GroupName;
244 /**
245 * The resource query which determines which AWS resources are members of the associated resource group.
246 */
247 ResourceQuery: ResourceQuery;
248 }
249 export interface ListGroupResourcesInput {
250 /**
251 * The name of the resource group.
252 */
253 GroupName: GroupName;
254 /**
255 * Filters, formatted as ResourceFilter objects, that you want to apply to a ListGroupResources operation. resource-type - Filter resources by their type. Specify up to five resource types in the format AWS::ServiceCode::ResourceType. For example, AWS::EC2::Instance, or AWS::S3::Bucket.
256 */
257 Filters?: ResourceFilterList;
258 /**
259 * The maximum number of group member ARNs that are returned in a single call by ListGroupResources, in paginated output. By default, this number is 50.
260 */
261 MaxResults?: MaxResults;
262 /**
263 * The NextToken value that is returned in a paginated ListGroupResources request. To get the next page of results, run the call again, add the NextToken parameter, and specify the NextToken value.
264 */
265 NextToken?: NextToken;
266 }
267 export interface ListGroupResourcesOutput {
268 /**
269 * The ARNs and resource types of resources that are members of the group that you specified.
270 */
271 ResourceIdentifiers?: ResourceIdentifierList;
272 /**
273 * The NextToken value to include in a subsequent ListGroupResources request, to get more results.
274 */
275 NextToken?: NextToken;
276 /**
277 * A list of QueryError objects. Each error is an object that contains ErrorCode and Message structures. Possible values for ErrorCode are CLOUDFORMATION_STACK_INACTIVE and CLOUDFORMATION_STACK_NOT_EXISTING.
278 */
279 QueryErrors?: QueryErrorList;
280 }
281 export interface ListGroupsInput {
282 /**
283 * Filters, formatted as GroupFilter objects, that you want to apply to a ListGroups operation. resource-type - Filter groups by resource type. Specify up to five resource types in the format AWS::ServiceCode::ResourceType. For example, AWS::EC2::Instance, or AWS::S3::Bucket.
284 */
285 Filters?: GroupFilterList;
286 /**
287 * The maximum number of resource group results that are returned by ListGroups in paginated output. By default, this number is 50.
288 */
289 MaxResults?: MaxResults;
290 /**
291 * The NextToken value that is returned in a paginated ListGroups request. To get the next page of results, run the call again, add the NextToken parameter, and specify the NextToken value.
292 */
293 NextToken?: NextToken;
294 }
295 export interface ListGroupsOutput {
296 /**
297 * A list of GroupIdentifier objects. Each identifier is an object that contains both the GroupName and the GroupArn.
298 */
299 GroupIdentifiers?: GroupIdentifierList;
300 /**
301 * A list of resource groups.
302 */
303 Groups?: GroupList;
304 /**
305 * The NextToken value to include in a subsequent ListGroups request, to get more results.
306 */
307 NextToken?: NextToken;
308 }
309 export type MaxResults = number;
310 export type NextToken = string;
311 export type Query = string;
312 export interface QueryError {
313 /**
314 * Possible values are CLOUDFORMATION_STACK_INACTIVE and CLOUDFORMATION_STACK_NOT_EXISTING.
315 */
316 ErrorCode?: QueryErrorCode;
317 /**
318 * A message that explains the ErrorCode value. Messages might state that the specified CloudFormation stack does not exist (or no longer exists). For CLOUDFORMATION_STACK_INACTIVE, the message typically states that the CloudFormation stack has a status that is not (or no longer) active, such as CREATE_FAILED.
319 */
320 Message?: QueryErrorMessage;
321 }
322 export type QueryErrorCode = "CLOUDFORMATION_STACK_INACTIVE"|"CLOUDFORMATION_STACK_NOT_EXISTING"|string;
323 export type QueryErrorList = QueryError[];
324 export type QueryErrorMessage = string;
325 export type QueryType = "TAG_FILTERS_1_0"|"CLOUDFORMATION_STACK_1_0"|string;
326 export type ResourceArn = string;
327 export interface ResourceFilter {
328 /**
329 * The name of the filter. Filter names are case-sensitive.
330 */
331 Name: ResourceFilterName;
332 /**
333 * One or more filter values. Allowed filter values vary by resource filter name, and are case-sensitive.
334 */
335 Values: ResourceFilterValues;
336 }
337 export type ResourceFilterList = ResourceFilter[];
338 export type ResourceFilterName = "resource-type"|string;
339 export type ResourceFilterValue = string;
340 export type ResourceFilterValues = ResourceFilterValue[];
341 export interface ResourceIdentifier {
342 /**
343 * The ARN of a resource.
344 */
345 ResourceArn?: ResourceArn;
346 /**
347 * The resource type of a resource, such as AWS::EC2::Instance.
348 */
349 ResourceType?: ResourceType;
350 }
351 export type ResourceIdentifierList = ResourceIdentifier[];
352 export interface ResourceQuery {
353 /**
354 * The type of the query. The valid values in this release are TAG_FILTERS_1_0 and CLOUDFORMATION_STACK_1_0. TAG_FILTERS_1_0: A JSON syntax that lets you specify a collection of simple tag filters for resource types and tags, as supported by the AWS Tagging API GetResources operation. If you specify more than one tag key, only resources that match all tag keys, and at least one value of each specified tag key, are returned in your query. If you specify more than one value for a tag key, a resource matches the filter if it has a tag key value that matches any of the specified values. For example, consider the following sample query for resources that have two tags, Stage and Version, with two values each. ([{"Key":"Stage","Values":["Test","Deploy"]},{"Key":"Version","Values":["1","2"]}]) The results of this query might include the following. An EC2 instance that has the following two tags: {"Key":"Stage","Value":"Deploy"}, and {"Key":"Version","Value":"2"} An S3 bucket that has the following two tags: {"Key":"Stage","Value":"Test"}, and {"Key":"Version","Value":"1"} The query would not return the following results, however. The following EC2 instance does not have all tag keys specified in the filter, so it is rejected. The RDS database has all of the tag keys, but no values that match at least one of the specified tag key values in the filter. An EC2 instance that has only the following tag: {"Key":"Stage","Value":"Deploy"}. An RDS database that has the following two tags: {"Key":"Stage","Value":"Archived"}, and {"Key":"Version","Value":"4"} CLOUDFORMATION_STACK_1_0: A JSON syntax that lets you specify a CloudFormation stack ARN.
355 */
356 Type: QueryType;
357 /**
358 * The query that defines a group or a search.
359 */
360 Query: Query;
361 }
362 export type ResourceType = string;
363 export interface SearchResourcesInput {
364 /**
365 * The search query, using the same formats that are supported for resource group definition.
366 */
367 ResourceQuery: ResourceQuery;
368 /**
369 * The maximum number of group member ARNs returned by SearchResources in paginated output. By default, this number is 50.
370 */
371 MaxResults?: MaxResults;
372 /**
373 * The NextToken value that is returned in a paginated SearchResources request. To get the next page of results, run the call again, add the NextToken parameter, and specify the NextToken value.
374 */
375 NextToken?: NextToken;
376 }
377 export interface SearchResourcesOutput {
378 /**
379 * The ARNs and resource types of resources that are members of the group that you specified.
380 */
381 ResourceIdentifiers?: ResourceIdentifierList;
382 /**
383 * The NextToken value to include in a subsequent SearchResources request, to get more results.
384 */
385 NextToken?: NextToken;
386 /**
387 * A list of QueryError objects. Each error is an object that contains ErrorCode and Message structures. Possible values for ErrorCode are CLOUDFORMATION_STACK_INACTIVE and CLOUDFORMATION_STACK_NOT_EXISTING.
388 */
389 QueryErrors?: QueryErrorList;
390 }
391 export interface TagInput {
392 /**
393 * The ARN of the resource to which to add tags.
394 */
395 Arn: GroupArn;
396 /**
397 * The tags to add to the specified resource. A tag is a string-to-string map of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
398 */
399 Tags: Tags;
400 }
401 export type TagKey = string;
402 export type TagKeyList = TagKey[];
403 export interface TagOutput {
404 /**
405 * The ARN of the tagged resource.
406 */
407 Arn?: GroupArn;
408 /**
409 * The tags that have been added to the specified resource.
410 */
411 Tags?: Tags;
412 }
413 export type TagValue = string;
414 export type Tags = {[key: string]: TagValue};
415 export interface UntagInput {
416 /**
417 * The ARN of the resource from which to remove tags.
418 */
419 Arn: GroupArn;
420 /**
421 * The keys of the tags to be removed.
422 */
423 Keys: TagKeyList;
424 }
425 export interface UntagOutput {
426 /**
427 * The ARN of the resource from which tags have been removed.
428 */
429 Arn?: GroupArn;
430 /**
431 * The keys of tags that have been removed.
432 */
433 Keys?: TagKeyList;
434 }
435 export interface UpdateGroupInput {
436 /**
437 * The name of the resource group for which you want to update its description.
438 */
439 GroupName: GroupName;
440 /**
441 * The description of the resource group. Descriptions can have a maximum of 511 characters, including letters, numbers, hyphens, underscores, punctuation, and spaces.
442 */
443 Description?: GroupDescription;
444 }
445 export interface UpdateGroupOutput {
446 /**
447 * The full description of the resource group after it has been updated.
448 */
449 Group?: Group;
450 }
451 export interface UpdateGroupQueryInput {
452 /**
453 * The name of the resource group for which you want to edit the query.
454 */
455 GroupName: GroupName;
456 /**
457 * The resource query that determines which AWS resources are members of the resource group.
458 */
459 ResourceQuery: ResourceQuery;
460 }
461 export interface UpdateGroupQueryOutput {
462 /**
463 * The resource query associated with the resource group after the update.
464 */
465 GroupQuery?: GroupQuery;
466 }
467 /**
468 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
469 */
470 export type apiVersion = "2017-11-27"|"latest"|string;
471 export interface ClientApiVersions {
472 /**
473 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
474 */
475 apiVersion?: apiVersion;
476 }
477 export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
478 /**
479 * Contains interfaces for use with the ResourceGroups client.
480 */
481 export import Types = ResourceGroups;
482}
483export = ResourceGroups;