aws-sdk-accessanalyzer 1.85.0 → 1.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -535,6 +535,40 @@ module Aws::AccessAnalyzer
535
535
  req.send_request(options)
536
536
  end
537
537
 
538
+ # Cancels an in-progress policy preview job. Jobs that are already
539
+ # completed, failed, or canceled cannot be canceled.
540
+ #
541
+ # @option params [required, String] :job_id
542
+ # The unique identifier of the policy preview job to cancel.
543
+ #
544
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
545
+ #
546
+ #
547
+ # @example Example: Successfully canceled policy preview job
548
+ #
549
+ # resp = client.cancel_policy_preview_job({
550
+ # job_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
551
+ # })
552
+ #
553
+ # resp.to_h outputs the following:
554
+ # {
555
+ # }
556
+ #
557
+ # @example Request syntax with placeholder values
558
+ #
559
+ # resp = client.cancel_policy_preview_job({
560
+ # job_id: "PolicyPreviewJobId", # required
561
+ # })
562
+ #
563
+ # @see http://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/CancelPolicyPreviewJob AWS API Documentation
564
+ #
565
+ # @overload cancel_policy_preview_job(params = {})
566
+ # @param [Hash] params ({})
567
+ def cancel_policy_preview_job(params = {}, options = {})
568
+ req = build_request(:cancel_policy_preview_job, params)
569
+ req.send_request(options)
570
+ end
571
+
538
572
  # Checks whether the specified access isn't allowed by a policy.
539
573
  #
540
574
  # @option params [required, String] :policy_document
@@ -1135,6 +1169,62 @@ module Aws::AccessAnalyzer
1135
1169
  req.send_request(options)
1136
1170
  end
1137
1171
 
1172
+ # Creates a policy preview configuration for your account. The
1173
+ # configuration enables IAM Access Analyzer to collect and store
1174
+ # CloudTrail authorization events needed for policy preview analysis.
1175
+ #
1176
+ # @option params [String] :client_token
1177
+ # A unique, case-sensitive identifier that you provide to ensure the
1178
+ # idempotency of the request. Idempotency ensures that an API request
1179
+ # completes only once. With an idempotent request, if the original
1180
+ # request completes successfully, subsequent retries with the same
1181
+ # client token return the result from the original successful request
1182
+ # and have no additional effect.
1183
+ #
1184
+ # **A suitable default value is auto-generated.** You should normally
1185
+ # not need to pass this option.**
1186
+ #
1187
+ # @option params [String] :scope
1188
+ # The scope of the policy preview configuration. Currently only `GLOBAL`
1189
+ # is supported.
1190
+ #
1191
+ # @return [Types::CreatePolicyPreviewConfigurationResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1192
+ #
1193
+ # * {Types::CreatePolicyPreviewConfigurationResponse#status #status} => String
1194
+ #
1195
+ #
1196
+ # @example Example: Successfully created policy preview configuration
1197
+ #
1198
+ # resp = client.create_policy_preview_configuration({
1199
+ # client_token: "unique-token-123",
1200
+ # scope: "GLOBAL",
1201
+ # })
1202
+ #
1203
+ # resp.to_h outputs the following:
1204
+ # {
1205
+ # status: "PENDING_CREATION",
1206
+ # }
1207
+ #
1208
+ # @example Request syntax with placeholder values
1209
+ #
1210
+ # resp = client.create_policy_preview_configuration({
1211
+ # client_token: "String",
1212
+ # scope: "GLOBAL", # accepts GLOBAL
1213
+ # })
1214
+ #
1215
+ # @example Response structure
1216
+ #
1217
+ # resp.status #=> String, one of "ACTIVE", "PENDING_CREATION", "FAILED"
1218
+ #
1219
+ # @see http://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/CreatePolicyPreviewConfiguration AWS API Documentation
1220
+ #
1221
+ # @overload create_policy_preview_configuration(params = {})
1222
+ # @param [Hash] params ({})
1223
+ def create_policy_preview_configuration(params = {}, options = {})
1224
+ req = build_request(:create_policy_preview_configuration, params)
1225
+ req.send_request(options)
1226
+ end
1227
+
1138
1228
  # Deletes the specified analyzer. When you delete an analyzer, IAM
1139
1229
  # Access Analyzer is disabled for the account or organization in the
1140
1230
  # current or specific Region. All findings that were generated by the
@@ -1201,6 +1291,49 @@ module Aws::AccessAnalyzer
1201
1291
  req.send_request(options)
1202
1292
  end
1203
1293
 
1294
+ # Deletes the policy preview configuration for your account. After
1295
+ # deletion, IAM Access Analyzer will stop collecting CloudTrail
1296
+ # authorization events for policy preview analysis.
1297
+ #
1298
+ # @option params [String] :client_token
1299
+ # A unique, case-sensitive identifier that you provide to ensure the
1300
+ # idempotency of the request. Idempotency ensures that an API request
1301
+ # completes only once. With an idempotent request, if the original
1302
+ # request completes successfully, subsequent retries with the same
1303
+ # client token return the result from the original successful request
1304
+ # and have no additional effect.
1305
+ #
1306
+ # **A suitable default value is auto-generated.** You should normally
1307
+ # not need to pass this option.**
1308
+ #
1309
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
1310
+ #
1311
+ #
1312
+ # @example Example: Successfully deleted policy preview configuration
1313
+ #
1314
+ # resp = client.delete_policy_preview_configuration({
1315
+ # client_token: "unique-token-456",
1316
+ # })
1317
+ #
1318
+ # resp.to_h outputs the following:
1319
+ # {
1320
+ # }
1321
+ #
1322
+ # @example Request syntax with placeholder values
1323
+ #
1324
+ # resp = client.delete_policy_preview_configuration({
1325
+ # client_token: "String",
1326
+ # })
1327
+ #
1328
+ # @see http://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/DeletePolicyPreviewConfiguration AWS API Documentation
1329
+ #
1330
+ # @overload delete_policy_preview_configuration(params = {})
1331
+ # @param [Hash] params ({})
1332
+ def delete_policy_preview_configuration(params = {}, options = {})
1333
+ req = build_request(:delete_policy_preview_configuration, params)
1334
+ req.send_request(options)
1335
+ end
1336
+
1204
1337
  # Creates a recommendation for an unused permissions finding.
1205
1338
  #
1206
1339
  # @option params [required, String] :analyzer_arn
@@ -1915,7 +2048,7 @@ module Aws::AccessAnalyzer
1915
2048
  # resp.job_details.status #=> String, one of "IN_PROGRESS", "SUCCEEDED", "FAILED", "CANCELED"
1916
2049
  # resp.job_details.started_on #=> Time
1917
2050
  # resp.job_details.completed_on #=> Time
1918
- # resp.job_details.job_error.code #=> String, one of "AUTHORIZATION_ERROR", "RESOURCE_NOT_FOUND_ERROR", "SERVICE_QUOTA_EXCEEDED_ERROR", "SERVICE_ERROR"
2051
+ # resp.job_details.job_error.code #=> String, one of "AUTHORIZATION_ERROR", "RESOURCE_NOT_FOUND_ERROR", "SERVICE_QUOTA_EXCEEDED_ERROR", "SERVICE_ERROR", "CANCELED_JOB_ERROR", "INVALID_SERVICE_LINKED_ROLE", "INSUFFICIENT_PERMISSIONS_ERROR", "ORGANIZATION_ACCESS_DENIED_ERROR", "INVALID_TARGET_ERROR", "INVALID_POLICY_PREVIEW_CONFIGURATION", "INVALID_ORGANIZATION_CONFIGURATION", "S3_BUCKET_NOT_FOUND_ERROR", "S3_BUCKET_PERMISSION_ERROR"
1919
2052
  # resp.job_details.job_error.message #=> String
1920
2053
  # resp.generated_policy_result.properties.is_complete #=> Boolean
1921
2054
  # resp.generated_policy_result.properties.principal_arn #=> String
@@ -1938,6 +2071,177 @@ module Aws::AccessAnalyzer
1938
2071
  req.send_request(options)
1939
2072
  end
1940
2073
 
2074
+ # Retrieves the policy preview configuration for your account.
2075
+ #
2076
+ # @return [Types::GetPolicyPreviewConfigurationResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2077
+ #
2078
+ # * {Types::GetPolicyPreviewConfigurationResponse#policy_preview_configurations #policy_preview_configurations} => Array<Types::PolicyPreviewConfiguration>
2079
+ #
2080
+ #
2081
+ # @example Example: Successfully retrieved policy preview configuration
2082
+ #
2083
+ # resp = client.get_policy_preview_configuration({
2084
+ # })
2085
+ #
2086
+ # resp.to_h outputs the following:
2087
+ # {
2088
+ # policy_preview_configurations: [
2089
+ # {
2090
+ # created_at: Time.parse("2023-05-01T10:00:00Z"),
2091
+ # scope: "GLOBAL",
2092
+ # status: "ACTIVE",
2093
+ # updated_at: Time.parse("2023-05-01T10:30:00Z"),
2094
+ # },
2095
+ # ],
2096
+ # }
2097
+ #
2098
+ # @example Response structure
2099
+ #
2100
+ # resp.policy_preview_configurations #=> Array
2101
+ # resp.policy_preview_configurations[0].scope #=> String, one of "GLOBAL"
2102
+ # resp.policy_preview_configurations[0].status #=> String, one of "ACTIVE", "PENDING_CREATION", "FAILED"
2103
+ # resp.policy_preview_configurations[0].created_at #=> Time
2104
+ # resp.policy_preview_configurations[0].updated_at #=> Time
2105
+ #
2106
+ #
2107
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
2108
+ #
2109
+ # * policy_preview_configuration_active
2110
+ #
2111
+ # @see http://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/GetPolicyPreviewConfiguration AWS API Documentation
2112
+ #
2113
+ # @overload get_policy_preview_configuration(params = {})
2114
+ # @param [Hash] params ({})
2115
+ def get_policy_preview_configuration(params = {}, options = {})
2116
+ req = build_request(:get_policy_preview_configuration, params)
2117
+ req.send_request(options)
2118
+ end
2119
+
2120
+ # Retrieves the metadata, parameters, and status for a policy preview
2121
+ # job. Use this operation to monitor job progress and retrieve the
2122
+ # Amazon S3 location of the completed analysis report.
2123
+ #
2124
+ # <note markdown="1"> Job data has a time-to-live (TTL) of 14 days and will be deleted after
2125
+ # expiration.
2126
+ #
2127
+ # </note>
2128
+ #
2129
+ # @option params [required, String] :job_id
2130
+ # The unique identifier of the policy preview job to retrieve. This is
2131
+ # the job ID returned by `StartPolicyPreviewJob`.
2132
+ #
2133
+ # @return [Types::GetPolicyPreviewJobResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2134
+ #
2135
+ # * {Types::GetPolicyPreviewJobResponse#job_id #job_id} => String
2136
+ # * {Types::GetPolicyPreviewJobResponse#job_parameters #job_parameters} => Types::PolicyPreviewJobParameters
2137
+ # * {Types::GetPolicyPreviewJobResponse#job_details #job_details} => Types::PolicyPreviewJobDetails
2138
+ # * {Types::GetPolicyPreviewJobResponse#output_s3_uri #output_s3_uri} => String
2139
+ #
2140
+ #
2141
+ # @example Example: Successfully fetched completed policy preview job
2142
+ #
2143
+ # resp = client.get_policy_preview_job({
2144
+ # job_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
2145
+ # })
2146
+ #
2147
+ # resp.to_h outputs the following:
2148
+ # {
2149
+ # job_details: {
2150
+ # completed_at: Time.parse("2023-05-01T10:30:00Z"),
2151
+ # job_status: "COMPLETED",
2152
+ # started_at: Time.parse("2023-05-01T10:01:00Z"),
2153
+ # submitted_at: Time.parse("2023-05-01T10:00:00Z"),
2154
+ # },
2155
+ # job_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
2156
+ # job_parameters: {
2157
+ # end_time: Time.parse("2023-12-31T23:59:59Z"),
2158
+ # policy_configurations: [
2159
+ # {
2160
+ # job_type: "SCP",
2161
+ # policy_documents_list: [
2162
+ # "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"AllowS3Access\",\"Effect\":\"Allow\",\"Action\":[\"s3:GetObject\",\"s3:PutObject\",\"s3:ListBucket\"],\"Resource\":[\"arn:aws:s3:::example-bucket\",\"arn:aws:s3:::example-bucket/*\"]}]}",
2163
+ # ],
2164
+ # target_id: "123456789012",
2165
+ # },
2166
+ # ],
2167
+ # start_time: Time.parse("2023-01-01T00:00:00Z"),
2168
+ # },
2169
+ # output_s3_uri: "s3://bucket/path",
2170
+ # }
2171
+ #
2172
+ # @example Example: Failed policy preview job
2173
+ #
2174
+ # resp = client.get_policy_preview_job({
2175
+ # job_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
2176
+ # })
2177
+ #
2178
+ # resp.to_h outputs the following:
2179
+ # {
2180
+ # job_details: {
2181
+ # completed_at: Time.parse("2023-05-01T10:05:00Z"),
2182
+ # job_error: {
2183
+ # code: "SERVICE_ERROR",
2184
+ # message: "Service error occurred during job execution.",
2185
+ # },
2186
+ # job_status: "FAILED",
2187
+ # started_at: Time.parse("2023-05-01T10:01:00Z"),
2188
+ # submitted_at: Time.parse("2023-05-01T10:00:00Z"),
2189
+ # },
2190
+ # job_id: "b2c3d4e5-f6a7-8901-bcde-f12345678901",
2191
+ # job_parameters: {
2192
+ # end_time: Time.parse("2023-12-31T23:59:59Z"),
2193
+ # policy_configurations: [
2194
+ # {
2195
+ # job_type: "SCP",
2196
+ # policy_documents_list: [
2197
+ # "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"AllowS3Access\",\"Effect\":\"Allow\",\"Action\":[\"s3:GetObject\",\"s3:PutObject\",\"s3:ListBucket\"],\"Resource\":[\"arn:aws:s3:::example-bucket\",\"arn:aws:s3:::example-bucket/*\"]}]}",
2198
+ # ],
2199
+ # target_id: "123456789012",
2200
+ # },
2201
+ # ],
2202
+ # start_time: Time.parse("2023-01-01T00:00:00Z"),
2203
+ # },
2204
+ # output_s3_uri: "s3://bucket/path",
2205
+ # }
2206
+ #
2207
+ # @example Request syntax with placeholder values
2208
+ #
2209
+ # resp = client.get_policy_preview_job({
2210
+ # job_id: "PolicyPreviewJobId", # required
2211
+ # })
2212
+ #
2213
+ # @example Response structure
2214
+ #
2215
+ # resp.job_id #=> String
2216
+ # resp.job_parameters.start_time #=> Time
2217
+ # resp.job_parameters.end_time #=> Time
2218
+ # resp.job_parameters.policy_configurations #=> Array
2219
+ # resp.job_parameters.policy_configurations[0].job_type #=> String, one of "SCP"
2220
+ # resp.job_parameters.policy_configurations[0].target_id #=> String
2221
+ # resp.job_parameters.policy_configurations[0].policy_documents_list #=> Array
2222
+ # resp.job_parameters.policy_configurations[0].policy_documents_list[0] #=> String
2223
+ # resp.job_details.job_status #=> String, one of "SUBMITTED", "IN_PROGRESS", "COMPLETED", "FAILED", "CANCELED"
2224
+ # resp.job_details.submitted_at #=> Time
2225
+ # resp.job_details.started_at #=> Time
2226
+ # resp.job_details.completed_at #=> Time
2227
+ # resp.job_details.job_error.code #=> String, one of "AUTHORIZATION_ERROR", "RESOURCE_NOT_FOUND_ERROR", "SERVICE_QUOTA_EXCEEDED_ERROR", "SERVICE_ERROR", "CANCELED_JOB_ERROR", "INVALID_SERVICE_LINKED_ROLE", "INSUFFICIENT_PERMISSIONS_ERROR", "ORGANIZATION_ACCESS_DENIED_ERROR", "INVALID_TARGET_ERROR", "INVALID_POLICY_PREVIEW_CONFIGURATION", "INVALID_ORGANIZATION_CONFIGURATION", "S3_BUCKET_NOT_FOUND_ERROR", "S3_BUCKET_PERMISSION_ERROR"
2228
+ # resp.job_details.job_error.message #=> String
2229
+ # resp.output_s3_uri #=> String
2230
+ #
2231
+ #
2232
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
2233
+ #
2234
+ # * policy_preview_job_completed
2235
+ #
2236
+ # @see http://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/GetPolicyPreviewJob AWS API Documentation
2237
+ #
2238
+ # @overload get_policy_preview_job(params = {})
2239
+ # @param [Hash] params ({})
2240
+ def get_policy_preview_job(params = {}, options = {})
2241
+ req = build_request(:get_policy_preview_job, params)
2242
+ req.send_request(options)
2243
+ end
2244
+
1941
2245
  # Retrieves a list of access preview findings generated by the specified
1942
2246
  # access preview.
1943
2247
  #
@@ -2468,6 +2772,94 @@ module Aws::AccessAnalyzer
2468
2772
  req.send_request(options)
2469
2773
  end
2470
2774
 
2775
+ # Lists all policy preview jobs with optional filtering by job status or
2776
+ # target ID. Results are paginated for efficient retrieval of large
2777
+ # result sets.
2778
+ #
2779
+ # @option params [Hash<String,String>] :filters
2780
+ # Optional filter criteria to narrow the list of returned jobs. You can
2781
+ # filter by job status or target ID. Maximum of one filter can be
2782
+ # specified.
2783
+ #
2784
+ # @option params [Integer] :max_results
2785
+ # The maximum number of results to return in a single page. Minimum
2786
+ # value is 1.
2787
+ #
2788
+ # @option params [String] :next_token
2789
+ # A token used for pagination of results. Use the token returned in the
2790
+ # previous response to retrieve the next page of results.
2791
+ #
2792
+ # @return [Types::ListPolicyPreviewJobsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2793
+ #
2794
+ # * {Types::ListPolicyPreviewJobsResponse#analysis_reports #analysis_reports} => Array&lt;Types::PolicyPreviewAnalysisReport&gt;
2795
+ # * {Types::ListPolicyPreviewJobsResponse#next_token #next_token} => String
2796
+ #
2797
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
2798
+ #
2799
+ #
2800
+ # @example Example: Successfully listed policy preview jobs with filters
2801
+ #
2802
+ # resp = client.list_policy_preview_jobs({
2803
+ # filters: {
2804
+ # "jobStatus" => "COMPLETED",
2805
+ # },
2806
+ # max_results: 10,
2807
+ # next_token: "token-123",
2808
+ # })
2809
+ #
2810
+ # resp.to_h outputs the following:
2811
+ # {
2812
+ # analysis_reports: [
2813
+ # {
2814
+ # completed_at: Time.parse("2023-05-01T10:30:00Z"),
2815
+ # job_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
2816
+ # output_s3_uri: "s3://bucket/path",
2817
+ # started_at: Time.parse("2023-05-01T10:01:00Z"),
2818
+ # status: "COMPLETED",
2819
+ # submitted_at: Time.parse("2023-05-01T10:00:00Z"),
2820
+ # },
2821
+ # {
2822
+ # completed_at: Time.parse("2023-05-02T10:30:00Z"),
2823
+ # job_id: "c3d4e5f6-a7b8-9012-cdef-123456789012",
2824
+ # output_s3_uri: "s3://bucket/path",
2825
+ # started_at: Time.parse("2023-05-02T10:01:00Z"),
2826
+ # status: "COMPLETED",
2827
+ # submitted_at: Time.parse("2023-05-02T10:00:00Z"),
2828
+ # },
2829
+ # ],
2830
+ # next_token: "token-456",
2831
+ # }
2832
+ #
2833
+ # @example Request syntax with placeholder values
2834
+ #
2835
+ # resp = client.list_policy_preview_jobs({
2836
+ # filters: {
2837
+ # "jobStatus" => "String",
2838
+ # },
2839
+ # max_results: 1,
2840
+ # next_token: "Token",
2841
+ # })
2842
+ #
2843
+ # @example Response structure
2844
+ #
2845
+ # resp.analysis_reports #=> Array
2846
+ # resp.analysis_reports[0].job_id #=> String
2847
+ # resp.analysis_reports[0].status #=> String, one of "SUBMITTED", "IN_PROGRESS", "COMPLETED", "FAILED", "CANCELED"
2848
+ # resp.analysis_reports[0].submitted_at #=> Time
2849
+ # resp.analysis_reports[0].started_at #=> Time
2850
+ # resp.analysis_reports[0].completed_at #=> Time
2851
+ # resp.analysis_reports[0].output_s3_uri #=> String
2852
+ # resp.next_token #=> String
2853
+ #
2854
+ # @see http://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/ListPolicyPreviewJobs AWS API Documentation
2855
+ #
2856
+ # @overload list_policy_preview_jobs(params = {})
2857
+ # @param [Hash] params ({})
2858
+ def list_policy_preview_jobs(params = {}, options = {})
2859
+ req = build_request(:list_policy_preview_jobs, params)
2860
+ req.send_request(options)
2861
+ end
2862
+
2471
2863
  # Retrieves a list of tags applied to the specified resource.
2472
2864
  #
2473
2865
  # @option params [required, String] :resource_arn
@@ -2559,6 +2951,120 @@ module Aws::AccessAnalyzer
2559
2951
  req.send_request(options)
2560
2952
  end
2561
2953
 
2954
+ # Creates a policy preview analysis job to evaluate the impact of
2955
+ # Service Control Policies (SCPs) before deployment. The analysis uses
2956
+ # historical CloudTrail authorization events to identify potential
2957
+ # access denials, helping you prevent service disruptions.
2958
+ #
2959
+ # The job analyzes CloudTrail events within a specified time window and
2960
+ # generates a report identifying which events would be denied by the
2961
+ # proposed policy. The report is stored in the specified Amazon S3
2962
+ # location.
2963
+ #
2964
+ # @option params [required, Array<Types::PolicyConfiguration>] :policy_configurations
2965
+ # A list of policy configurations to analyze. Currently limited to one
2966
+ # configuration per request. Each configuration specifies the job type,
2967
+ # target ID, and policy documents to test.
2968
+ #
2969
+ # @option params [required, Time,DateTime,Date,Integer,String] :start_time
2970
+ # The start of the CloudTrail event analysis window. The analysis will
2971
+ # evaluate events from this time forward.
2972
+ #
2973
+ # @option params [Time,DateTime,Date,Integer,String] :end_time
2974
+ # The end of the analysis window. If not specified, defaults to the time
2975
+ # of the request. The analysis will evaluate CloudTrail events up to
2976
+ # this time.
2977
+ #
2978
+ # @option params [required, String] :output_s3_uri
2979
+ # The Amazon S3 URI where the completed analysis report will be stored.
2980
+ # The Amazon S3 bucket must grant access to the IAM Access Analyzer
2981
+ # service principal in its resource policy. The report will be stored at
2982
+ # the path: `outputS3Uri/jobId/timestamp/`.
2983
+ #
2984
+ # @option params [String] :client_token
2985
+ # A unique, case-sensitive identifier that you provide to ensure the
2986
+ # idempotency of the request. Idempotency ensures that an API request
2987
+ # completes only once. With an idempotent request, if the original
2988
+ # request completes successfully, subsequent retries with the same
2989
+ # client token return the result from the original successful request
2990
+ # and have no additional effect.
2991
+ #
2992
+ # **A suitable default value is auto-generated.** You should normally
2993
+ # not need to pass this option.**
2994
+ #
2995
+ # @return [Types::StartPolicyPreviewJobResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2996
+ #
2997
+ # * {Types::StartPolicyPreviewJobResponse#job_id #job_id} => String
2998
+ #
2999
+ #
3000
+ # @example Example: Successfully started policy preview job
3001
+ #
3002
+ # resp = client.start_policy_preview_job({
3003
+ # client_token: "unique-token-123",
3004
+ # end_time: Time.parse("2023-12-31T23:59:59Z"),
3005
+ # output_s3_uri: "s3://bucket/path",
3006
+ # policy_configurations: [
3007
+ # {
3008
+ # job_type: "SCP",
3009
+ # policy_documents_list: [
3010
+ # "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"AllowS3Access\",\"Effect\":\"Allow\",\"Action\":[\"s3:GetObject\",\"s3:PutObject\",\"s3:ListBucket\"],\"Resource\":[\"arn:aws:s3:::example-bucket\",\"arn:aws:s3:::example-bucket/*\"]}]}",
3011
+ # ],
3012
+ # target_id: "123456789012",
3013
+ # },
3014
+ # ],
3015
+ # start_time: Time.parse("2023-01-01T00:00:00Z"),
3016
+ # })
3017
+ #
3018
+ # resp.to_h outputs the following:
3019
+ # {
3020
+ # job_id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
3021
+ # }
3022
+ #
3023
+ # @example Example: Failed field validation for invalid targetId
3024
+ #
3025
+ # resp = client.start_policy_preview_job({
3026
+ # output_s3_uri: "s3://bucket/path",
3027
+ # policy_configurations: [
3028
+ # {
3029
+ # job_type: "SCP",
3030
+ # policy_documents_list: [
3031
+ # "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Deny\",\"Action\":\"s3:*\",\"Resource\":\"*\"}]}",
3032
+ # ],
3033
+ # target_id: "invalid",
3034
+ # },
3035
+ # ],
3036
+ # start_time: Time.parse("2023-01-01T00:00:00Z"),
3037
+ # })
3038
+ #
3039
+ # @example Request syntax with placeholder values
3040
+ #
3041
+ # resp = client.start_policy_preview_job({
3042
+ # policy_configurations: [ # required
3043
+ # {
3044
+ # job_type: "SCP", # required, accepts SCP
3045
+ # target_id: "PolicyPreviewTargetId", # required
3046
+ # policy_documents_list: ["String"], # required
3047
+ # },
3048
+ # ],
3049
+ # start_time: Time.now, # required
3050
+ # end_time: Time.now,
3051
+ # output_s3_uri: "S3Uri", # required
3052
+ # client_token: "String",
3053
+ # })
3054
+ #
3055
+ # @example Response structure
3056
+ #
3057
+ # resp.job_id #=> String
3058
+ #
3059
+ # @see http://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/StartPolicyPreviewJob AWS API Documentation
3060
+ #
3061
+ # @overload start_policy_preview_job(params = {})
3062
+ # @param [Hash] params ({})
3063
+ def start_policy_preview_job(params = {}, options = {})
3064
+ req = build_request(:start_policy_preview_job, params)
3065
+ req.send_request(options)
3066
+ end
3067
+
2562
3068
  # Immediately starts a scan of the policies applied to the specified
2563
3069
  # resource.
2564
3070
  #
@@ -2936,14 +3442,129 @@ module Aws::AccessAnalyzer
2936
3442
  tracer: tracer
2937
3443
  )
2938
3444
  context[:gem_name] = 'aws-sdk-accessanalyzer'
2939
- context[:gem_version] = '1.85.0'
3445
+ context[:gem_version] = '1.87.0'
2940
3446
  Seahorse::Client::Request.new(handlers, context)
2941
3447
  end
2942
3448
 
3449
+ # Polls an API operation until a resource enters a desired state.
3450
+ #
3451
+ # ## Basic Usage
3452
+ #
3453
+ # A waiter will call an API operation until:
3454
+ #
3455
+ # * It is successful
3456
+ # * It enters a terminal state
3457
+ # * It makes the maximum number of attempts
3458
+ #
3459
+ # In between attempts, the waiter will sleep.
3460
+ #
3461
+ # # polls in a loop, sleeping between attempts
3462
+ # client.wait_until(waiter_name, params)
3463
+ #
3464
+ # ## Configuration
3465
+ #
3466
+ # You can configure the maximum number of polling attempts, and the
3467
+ # delay (in seconds) between each polling attempt. You can pass
3468
+ # configuration as the final arguments hash.
3469
+ #
3470
+ # # poll for ~25 seconds
3471
+ # client.wait_until(waiter_name, params, {
3472
+ # max_attempts: 5,
3473
+ # delay: 5,
3474
+ # })
3475
+ #
3476
+ # ## Callbacks
3477
+ #
3478
+ # You can be notified before each polling attempt and before each
3479
+ # delay. If you throw `:success` or `:failure` from these callbacks,
3480
+ # it will terminate the waiter.
3481
+ #
3482
+ # started_at = Time.now
3483
+ # client.wait_until(waiter_name, params, {
3484
+ #
3485
+ # # disable max attempts
3486
+ # max_attempts: nil,
3487
+ #
3488
+ # # poll for 1 hour, instead of a number of attempts
3489
+ # before_wait: -> (attempts, response) do
3490
+ # throw :failure if Time.now - started_at > 3600
3491
+ # end
3492
+ # })
3493
+ #
3494
+ # ## Handling Errors
3495
+ #
3496
+ # When a waiter is unsuccessful, it will raise an error.
3497
+ # All of the failure errors extend from
3498
+ # {Aws::Waiters::Errors::WaiterFailed}.
3499
+ #
3500
+ # begin
3501
+ # client.wait_until(...)
3502
+ # rescue Aws::Waiters::Errors::WaiterFailed
3503
+ # # resource did not enter the desired state in time
3504
+ # end
3505
+ #
3506
+ # ## Valid Waiters
3507
+ #
3508
+ # The following table lists the valid waiter names, the operations they call,
3509
+ # and the default `:delay` and `:max_attempts` values.
3510
+ #
3511
+ # | waiter_name | params | :delay | :max_attempts |
3512
+ # | ----------------------------------- | ----------------------------------------- | -------- | ------------- |
3513
+ # | policy_preview_configuration_active | {Client#get_policy_preview_configuration} | 5 | 24 |
3514
+ # | policy_preview_job_completed | {Client#get_policy_preview_job} | 30 | 5 |
3515
+ #
3516
+ # @raise [Errors::FailureStateError] Raised when the waiter terminates
3517
+ # because the waiter has entered a state that it will not transition
3518
+ # out of, preventing success.
3519
+ #
3520
+ # @raise [Errors::TooManyAttemptsError] Raised when the configured
3521
+ # maximum number of attempts have been made, and the waiter is not
3522
+ # yet successful.
3523
+ #
3524
+ # @raise [Errors::UnexpectedError] Raised when an error is encounted
3525
+ # while polling for a resource that is not expected.
3526
+ #
3527
+ # @raise [Errors::NoSuchWaiterError] Raised when you request to wait
3528
+ # for an unknown state.
3529
+ #
3530
+ # @return [Boolean] Returns `true` if the waiter was successful.
3531
+ # @param [Symbol] waiter_name
3532
+ # @param [Hash] params ({})
3533
+ # @param [Hash] options ({})
3534
+ # @option options [Integer] :max_attempts
3535
+ # @option options [Integer] :delay
3536
+ # @option options [Proc] :before_attempt
3537
+ # @option options [Proc] :before_wait
3538
+ def wait_until(waiter_name, params = {}, options = {})
3539
+ w = waiter(waiter_name, options)
3540
+ yield(w.waiter) if block_given? # deprecated
3541
+ w.wait(params)
3542
+ end
3543
+
2943
3544
  # @api private
2944
3545
  # @deprecated
2945
3546
  def waiter_names
2946
- []
3547
+ waiters.keys
3548
+ end
3549
+
3550
+ private
3551
+
3552
+ # @param [Symbol] waiter_name
3553
+ # @param [Hash] options ({})
3554
+ def waiter(waiter_name, options = {})
3555
+ waiter_class = waiters[waiter_name]
3556
+ if waiter_class
3557
+ waiter_class.new(options.merge(client: self))
3558
+ else
3559
+ raise Aws::Waiters::Errors::NoSuchWaiterError.new(waiter_name, waiters.keys)
3560
+ end
3561
+ end
3562
+
3563
+ def waiters
3564
+ {
3565
+ policy_preview_configuration_active: Waiters::PolicyPreviewConfigurationActive,
3566
+ policy_preview_job_completed: Waiters::PolicyPreviewJobCompleted
3567
+ }
2947
3568
  end
2948
3569
 
2949
3570
  class << self