From bfbf31b00cae97cb1a754c1a6d95e20681e2ef10 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 11 Nov 2023 01:31:24 +0000 Subject: [PATCH] Update services based on v1.47.9 of AWS Go SDK Reference: https://github.com/aws/aws-sdk-go/releases/tag/v1.47.9 --- .latest-tag-aws-sdk-go | 2 +- src/aws_controltower.erl | 117 ++++++++++++++++++++++++------ src/aws_cost_and_usage_report.erl | 59 ++++++++++++--- src/aws_fms.erl | 49 ++++++++----- src/aws_rds.erl | 11 +-- 5 files changed, 176 insertions(+), 62 deletions(-) diff --git a/.latest-tag-aws-sdk-go b/.latest-tag-aws-sdk-go index dbd4a32d..5cdb7d65 100644 --- a/.latest-tag-aws-sdk-go +++ b/.latest-tag-aws-sdk-go @@ -1 +1 @@ -v1.47.8 +v1.47.9 diff --git a/src/aws_controltower.erl b/src/aws_controltower.erl index d7e3dd69..4530844e 100644 --- a/src/aws_controltower.erl +++ b/src/aws_controltower.erl @@ -5,7 +5,7 @@ %% controls to your organizational units, programmatically. %% %% In AWS Control Tower, the terms "control" and -%% "guardrail" are synonyms. . +%% "guardrail" are synonyms. %% %% To call these APIs, you'll need to know: %% @@ -15,6 +15,9 @@ %%
  • the ARN associated with the target organizational unit (OU), %% which we call the `targetIdentifier'. %% +%%
  • the ARN associated with a resource that you wish to tag or +%% untag. +%% %%
  • To get the `controlIdentifier' for your AWS Control Tower %% control: %% @@ -28,9 +31,9 @@ %% %% A quick-reference list of control identifers for the AWS Control Tower %% legacy Strongly recommended and Elective controls is given in Resource -%% identifiers for APIs and guardrails in the Controls reference guide -%% section of the AWS Control Tower User Guide. Remember that Mandatory -%% controls cannot be added or removed. +%% identifiers for APIs and controls in the Controls reference guide section +%% of the AWS Control Tower User Guide. Remember that Mandatory controls +%% cannot be added or removed. %% %% ARN format: `arn:aws:controltower:{REGION}::control/{CONTROL_NAME}' %% @@ -90,7 +93,14 @@ get_enabled_control/2, get_enabled_control/3, list_enabled_controls/2, - list_enabled_controls/3]). + list_enabled_controls/3, + list_tags_for_resource/2, + list_tags_for_resource/4, + list_tags_for_resource/5, + tag_resource/3, + tag_resource/4, + untag_resource/3, + untag_resource/4]). -include_lib("hackney/include/hackney_lib.hrl"). @@ -131,7 +141,7 @@ disable_control(Client, Input0, Options0) -> %% It starts an asynchronous operation that creates AWS resources on the %% specified organizational unit and the accounts it contains. The resources %% created will vary according to the control that you specify. For usage -%% examples, see the AWS Control Tower User Guide +%% examples, see the AWS Control Tower User Guide . enable_control(Client, Input) -> enable_control(Client, Input, []). enable_control(Client, Input0, Options0) -> @@ -159,7 +169,7 @@ enable_control(Client, Input0, Options0) -> %% %% Displays a message in case of error. Details for an operation are %% available for 90 days. For usage examples, see the AWS Control Tower User -%% Guide +%% Guide . get_control_operation(Client, Input) -> get_control_operation(Client, Input, []). get_control_operation(Client, Input0, Options0) -> @@ -182,22 +192,9 @@ get_control_operation(Client, Input0, Options0) -> request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). -%% @doc Provides details about the enabled control. +%% @doc Retrieves details about an enabled control. %% %% For usage examples, see the AWS Control Tower User Guide . -%% -%% == Returned values == -%% -%% get_enabled_control(Client, Input) -> get_enabled_control(Client, Input, []). get_enabled_control(Client, Input0, Options0) -> @@ -223,7 +220,7 @@ get_enabled_control(Client, Input0, Options0) -> %% @doc Lists the controls enabled by AWS Control Tower on the specified %% organizational unit and the accounts it contains. %% -%% For usage examples, see the AWS Control Tower User Guide +%% For usage examples, see the AWS Control Tower User Guide . list_enabled_controls(Client, Input) -> list_enabled_controls(Client, Input, []). list_enabled_controls(Client, Input0, Options0) -> @@ -246,6 +243,82 @@ list_enabled_controls(Client, Input0, Options0) -> request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). +%% @doc Returns a list of tags associated with the resource. +%% +%% For usage examples, see the AWS Control Tower User Guide . +list_tags_for_resource(Client, ResourceArn) + when is_map(Client) -> + list_tags_for_resource(Client, ResourceArn, #{}, #{}). + +list_tags_for_resource(Client, ResourceArn, QueryMap, HeadersMap) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> + list_tags_for_resource(Client, ResourceArn, QueryMap, HeadersMap, []). + +list_tags_for_resource(Client, ResourceArn, QueryMap, HeadersMap, Options0) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> + Path = ["/tags/", aws_util:encode_uri(ResourceArn), ""], + SuccessStatusCode = 200, + Options = [{send_body_as_binary, false}, + {receive_body_as_binary, false} + | Options0], + + Headers = [], + + Query_ = [], + + request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). + +%% @doc Applies tags to a resource. +%% +%% For usage examples, see the AWS Control Tower User Guide . +tag_resource(Client, ResourceArn, Input) -> + tag_resource(Client, ResourceArn, Input, []). +tag_resource(Client, ResourceArn, Input0, Options0) -> + Method = post, + Path = ["/tags/", aws_util:encode_uri(ResourceArn), ""], + SuccessStatusCode = 204, + Options = [{send_body_as_binary, false}, + {receive_body_as_binary, false}, + {append_sha256_content_hash, false} + | Options0], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Removes tags from a resource. +%% +%% For usage examples, see the AWS Control Tower User Guide . +untag_resource(Client, ResourceArn, Input) -> + untag_resource(Client, ResourceArn, Input, []). +untag_resource(Client, ResourceArn, Input0, Options0) -> + Method = delete, + Path = ["/tags/", aws_util:encode_uri(ResourceArn), ""], + SuccessStatusCode = 204, + Options = [{send_body_as_binary, false}, + {receive_body_as_binary, false}, + {append_sha256_content_hash, false} + | Options0], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + QueryMapping = [ + {<<"tagKeys">>, <<"tagKeys">>} + ], + {Query_, Input} = aws_request:build_headers(QueryMapping, Input2), + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + %%==================================================================== %% Internal functions %%==================================================================== diff --git a/src/aws_cost_and_usage_report.erl b/src/aws_cost_and_usage_report.erl index d777d161..f5786f73 100644 --- a/src/aws_cost_and_usage_report.erl +++ b/src/aws_cost_and_usage_report.erl @@ -1,18 +1,22 @@ %% WARNING: DO NOT EDIT, AUTO-GENERATED CODE! %% See https://github.com/aws-beam/aws-codegen for more details. -%% @doc The AWS Cost and Usage Report API enables you to programmatically -%% create, query, and delete AWS Cost and Usage report definitions. +%% @doc You can use the Amazon Web Services Cost and Usage Report API to +%% programmatically create, query, and delete Amazon Web Services Cost and +%% Usage Report definitions. %% -%% AWS Cost and Usage reports track the monthly AWS costs and usage -%% associated with your AWS account. The report contains line items for each -%% unique combination of AWS product, usage type, and operation that your AWS -%% account uses. You can configure the AWS Cost and Usage report to show only -%% the data that you want, using the AWS Cost and Usage API. +%% Amazon Web Services Cost and Usage Report track the monthly Amazon Web +%% Services costs and usage associated with your Amazon Web Services account. +%% The report contains line items for each unique combination of Amazon Web +%% Services product, usage type, and operation that your Amazon Web Services +%% account uses. You can configure the Amazon Web Services Cost and Usage +%% Report to show only the data that you want, using the Amazon Web Services +%% Cost and Usage Report API. %% %% Service Endpoint %% -%% The AWS Cost and Usage Report API provides the following endpoint: +%% The Amazon Web Services Cost and Usage Report API provides the following +%% endpoint: %% %%