Skip to content

Commit

Permalink
feat(client-route53-recovery-control-config): Adds permissions for Ge…
Browse files Browse the repository at this point in the history
…tResourcePolicy to support returning details about AWS Resource Access Manager resource policies for shared resources.
  • Loading branch information
awstools committed Oct 17, 2023
1 parent c5617b0 commit 81747e4
Show file tree
Hide file tree
Showing 24 changed files with 491 additions and 43 deletions.
8 changes: 8 additions & 0 deletions clients/client-route53-recovery-control-config/README.md
Expand Up @@ -304,6 +304,14 @@ DescribeSafetyRule

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-route53-recovery-control-config/classes/describesafetyrulecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-route53-recovery-control-config/interfaces/describesafetyrulecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-route53-recovery-control-config/interfaces/describesafetyrulecommandoutput.html)

</details>
<details>
<summary>
GetResourcePolicy
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-route53-recovery-control-config/classes/getresourcepolicycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-route53-recovery-control-config/interfaces/getresourcepolicycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-route53-recovery-control-config/interfaces/getresourcepolicycommandoutput.html)

</details>
<details>
<summary>
Expand Down
Expand Up @@ -62,6 +62,11 @@ import {
DescribeSafetyRuleCommandInput,
DescribeSafetyRuleCommandOutput,
} from "./commands/DescribeSafetyRuleCommand";
import {
GetResourcePolicyCommand,
GetResourcePolicyCommandInput,
GetResourcePolicyCommandOutput,
} from "./commands/GetResourcePolicyCommand";
import {
ListAssociatedRoute53HealthChecksCommand,
ListAssociatedRoute53HealthChecksCommandInput,
Expand Down Expand Up @@ -131,6 +136,7 @@ const commands = {
DescribeControlPanelCommand,
DescribeRoutingControlCommand,
DescribeSafetyRuleCommand,
GetResourcePolicyCommand,
ListAssociatedRoute53HealthChecksCommand,
ListClustersCommand,
ListControlPanelsCommand,
Expand Down Expand Up @@ -334,6 +340,23 @@ export interface Route53RecoveryControlConfig {
cb: (err: any, data?: DescribeSafetyRuleCommandOutput) => void
): void;

/**
* @see {@link GetResourcePolicyCommand}
*/
getResourcePolicy(
args: GetResourcePolicyCommandInput,
options?: __HttpHandlerOptions
): Promise<GetResourcePolicyCommandOutput>;
getResourcePolicy(
args: GetResourcePolicyCommandInput,
cb: (err: any, data?: GetResourcePolicyCommandOutput) => void
): void;
getResourcePolicy(
args: GetResourcePolicyCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetResourcePolicyCommandOutput) => void
): void;

/**
* @see {@link ListAssociatedRoute53HealthChecksCommand}
*/
Expand Down
Expand Up @@ -74,6 +74,7 @@ import {
DescribeRoutingControlCommandOutput,
} from "./commands/DescribeRoutingControlCommand";
import { DescribeSafetyRuleCommandInput, DescribeSafetyRuleCommandOutput } from "./commands/DescribeSafetyRuleCommand";
import { GetResourcePolicyCommandInput, GetResourcePolicyCommandOutput } from "./commands/GetResourcePolicyCommand";
import {
ListAssociatedRoute53HealthChecksCommandInput,
ListAssociatedRoute53HealthChecksCommandOutput,
Expand Down Expand Up @@ -124,6 +125,7 @@ export type ServiceInputTypes =
| DescribeControlPanelCommandInput
| DescribeRoutingControlCommandInput
| DescribeSafetyRuleCommandInput
| GetResourcePolicyCommandInput
| ListAssociatedRoute53HealthChecksCommandInput
| ListClustersCommandInput
| ListControlPanelsCommandInput
Expand Down Expand Up @@ -152,6 +154,7 @@ export type ServiceOutputTypes =
| DescribeControlPanelCommandOutput
| DescribeRoutingControlCommandOutput
| DescribeSafetyRuleCommandOutput
| GetResourcePolicyCommandOutput
| ListAssociatedRoute53HealthChecksCommandOutput
| ListClustersCommandOutput
| ListControlPanelsCommandOutput
Expand Down
Expand Up @@ -68,6 +68,7 @@ export interface CreateClusterCommandOutput extends CreateClusterResponse, __Met
* // ],
* // Name: "STRING_VALUE",
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION",
* // Owner: "STRING_VALUE",
* // },
* // };
*
Expand Down
Expand Up @@ -66,6 +66,7 @@ export interface CreateControlPanelCommandOutput extends CreateControlPanelRespo
* // Name: "STRING_VALUE",
* // RoutingControlCount: Number("int"),
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION",
* // Owner: "STRING_VALUE",
* // },
* // };
*
Expand Down
Expand Up @@ -62,6 +62,7 @@ export interface CreateRoutingControlCommandOutput extends CreateRoutingControlR
* // Name: "STRING_VALUE",
* // RoutingControlArn: "STRING_VALUE",
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION",
* // Owner: "STRING_VALUE",
* // },
* // };
*
Expand Down
Expand Up @@ -100,6 +100,7 @@ export interface CreateSafetyRuleCommandOutput extends CreateSafetyRuleResponse,
* // SafetyRuleArn: "STRING_VALUE", // required
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION", // required
* // WaitPeriodMs: Number("int"), // required
* // Owner: "STRING_VALUE",
* // },
* // GatingRule: { // GatingRule
* // ControlPanelArn: "STRING_VALUE", // required
Expand All @@ -118,6 +119,7 @@ export interface CreateSafetyRuleCommandOutput extends CreateSafetyRuleResponse,
* // "STRING_VALUE",
* // ],
* // WaitPeriodMs: Number("int"), // required
* // Owner: "STRING_VALUE",
* // },
* // };
*
Expand Down
Expand Up @@ -64,6 +64,7 @@ export interface DescribeClusterCommandOutput extends DescribeClusterResponse, _
* // ],
* // Name: "STRING_VALUE",
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION",
* // Owner: "STRING_VALUE",
* // },
* // };
*
Expand Down
Expand Up @@ -61,6 +61,7 @@ export interface DescribeControlPanelCommandOutput extends DescribeControlPanelR
* // Name: "STRING_VALUE",
* // RoutingControlCount: Number("int"),
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION",
* // Owner: "STRING_VALUE",
* // },
* // };
*
Expand Down
Expand Up @@ -59,6 +59,7 @@ export interface DescribeRoutingControlCommandOutput extends DescribeRoutingCont
* // Name: "STRING_VALUE",
* // RoutingControlArn: "STRING_VALUE",
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION",
* // Owner: "STRING_VALUE",
* // },
* // };
*
Expand Down
Expand Up @@ -68,6 +68,7 @@ export interface DescribeSafetyRuleCommandOutput extends DescribeSafetyRuleRespo
* // SafetyRuleArn: "STRING_VALUE", // required
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION", // required
* // WaitPeriodMs: Number("int"), // required
* // Owner: "STRING_VALUE",
* // },
* // GatingRule: { // GatingRule
* // ControlPanelArn: "STRING_VALUE", // required
Expand All @@ -86,6 +87,7 @@ export interface DescribeSafetyRuleCommandOutput extends DescribeSafetyRuleRespo
* // "STRING_VALUE",
* // ],
* // WaitPeriodMs: Number("int"), // required
* // Owner: "STRING_VALUE",
* // },
* // };
*
Expand Down
@@ -0,0 +1,157 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { Command as $Command } from "@smithy/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
SMITHY_CONTEXT_KEY,
} from "@smithy/types";

import { GetResourcePolicyRequest, GetResourcePolicyResponse } from "../models/models_0";
import { de_GetResourcePolicyCommand, se_GetResourcePolicyCommand } from "../protocols/Aws_restJson1";
import {
Route53RecoveryControlConfigClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes,
} from "../Route53RecoveryControlConfigClient";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link GetResourcePolicyCommand}.
*/
export interface GetResourcePolicyCommandInput extends GetResourcePolicyRequest {}
/**
* @public
*
* The output of {@link GetResourcePolicyCommand}.
*/
export interface GetResourcePolicyCommandOutput extends GetResourcePolicyResponse, __MetadataBearer {}

/**
* @public
* <p>Get information about the resource policy for a cluster.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { Route53RecoveryControlConfigClient, GetResourcePolicyCommand } from "@aws-sdk/client-route53-recovery-control-config"; // ES Modules import
* // const { Route53RecoveryControlConfigClient, GetResourcePolicyCommand } = require("@aws-sdk/client-route53-recovery-control-config"); // CommonJS import
* const client = new Route53RecoveryControlConfigClient(config);
* const input = { // GetResourcePolicyRequest
* ResourceArn: "STRING_VALUE", // required
* };
* const command = new GetResourcePolicyCommand(input);
* const response = await client.send(command);
* // { // GetResourcePolicyResponse
* // Policy: "STRING_VALUE",
* // };
*
* ```
*
* @param GetResourcePolicyCommandInput - {@link GetResourcePolicyCommandInput}
* @returns {@link GetResourcePolicyCommandOutput}
* @see {@link GetResourcePolicyCommandInput} for command's `input` shape.
* @see {@link GetResourcePolicyCommandOutput} for command's `response` shape.
* @see {@link Route53RecoveryControlConfigClientResolvedConfig | config} for Route53RecoveryControlConfigClient's `config` shape.
*
* @throws {@link InternalServerException} (server fault)
* <p>500 response - InternalServiceError. Temporary service error. Retry the request.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>404 response - MalformedQueryString. The query string contains a syntax error or resource not found.</p>
*
* @throws {@link Route53RecoveryControlConfigServiceException}
* <p>Base exception class for all service exceptions from Route53RecoveryControlConfig service.</p>
*
*/
export class GetResourcePolicyCommand extends $Command<
GetResourcePolicyCommandInput,
GetResourcePolicyCommandOutput,
Route53RecoveryControlConfigClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

/**
* @public
*/
constructor(readonly input: GetResourcePolicyCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: Route53RecoveryControlConfigClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<GetResourcePolicyCommandInput, GetResourcePolicyCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, GetResourcePolicyCommand.getEndpointParameterInstructions())
);

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "Route53RecoveryControlConfigClient";
const commandName = "GetResourcePolicyCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
[SMITHY_CONTEXT_KEY]: {
service: "Route53RecoveryControlConfig",
operation: "GetResourcePolicy",
},
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

/**
* @internal
*/
private serialize(input: GetResourcePolicyCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_GetResourcePolicyCommand(input, context);
}

/**
* @internal
*/
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetResourcePolicyCommandOutput> {
return de_GetResourcePolicyCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Expand Up @@ -66,6 +66,7 @@ export interface ListClustersCommandOutput extends ListClustersResponse, __Metad
* // ],
* // Name: "STRING_VALUE",
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION",
* // Owner: "STRING_VALUE",
* // },
* // ],
* // NextToken: "STRING_VALUE",
Expand Down
Expand Up @@ -64,6 +64,7 @@ export interface ListControlPanelsCommandOutput extends ListControlPanelsRespons
* // Name: "STRING_VALUE",
* // RoutingControlCount: Number("int"),
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION",
* // Owner: "STRING_VALUE",
* // },
* // ],
* // NextToken: "STRING_VALUE",
Expand Down
Expand Up @@ -63,6 +63,7 @@ export interface ListRoutingControlsCommandOutput extends ListRoutingControlsRes
* // Name: "STRING_VALUE",
* // RoutingControlArn: "STRING_VALUE",
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION",
* // Owner: "STRING_VALUE",
* // },
* // ],
* // };
Expand Down
Expand Up @@ -73,6 +73,7 @@ export interface ListSafetyRulesCommandOutput extends ListSafetyRulesResponse, _
* // SafetyRuleArn: "STRING_VALUE", // required
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION", // required
* // WaitPeriodMs: Number("int"), // required
* // Owner: "STRING_VALUE",
* // },
* // GATING: { // GatingRule
* // ControlPanelArn: "STRING_VALUE", // required
Expand All @@ -91,6 +92,7 @@ export interface ListSafetyRulesCommandOutput extends ListSafetyRulesResponse, _
* // "STRING_VALUE",
* // ],
* // WaitPeriodMs: Number("int"), // required
* // Owner: "STRING_VALUE",
* // },
* // },
* // ],
Expand Down
Expand Up @@ -62,6 +62,7 @@ export interface UpdateControlPanelCommandOutput extends UpdateControlPanelRespo
* // Name: "STRING_VALUE",
* // RoutingControlCount: Number("int"),
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION",
* // Owner: "STRING_VALUE",
* // },
* // };
*
Expand Down
Expand Up @@ -60,6 +60,7 @@ export interface UpdateRoutingControlCommandOutput extends UpdateRoutingControlR
* // Name: "STRING_VALUE",
* // RoutingControlArn: "STRING_VALUE",
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION",
* // Owner: "STRING_VALUE",
* // },
* // };
*
Expand Down
Expand Up @@ -77,6 +77,7 @@ export interface UpdateSafetyRuleCommandOutput extends UpdateSafetyRuleResponse,
* // SafetyRuleArn: "STRING_VALUE", // required
* // Status: "PENDING" || "DEPLOYED" || "PENDING_DELETION", // required
* // WaitPeriodMs: Number("int"), // required
* // Owner: "STRING_VALUE",
* // },
* // GatingRule: { // GatingRule
* // ControlPanelArn: "STRING_VALUE", // required
Expand All @@ -95,6 +96,7 @@ export interface UpdateSafetyRuleCommandOutput extends UpdateSafetyRuleResponse,
* // "STRING_VALUE",
* // ],
* // WaitPeriodMs: Number("int"), // required
* // Owner: "STRING_VALUE",
* // },
* // };
*
Expand Down

0 comments on commit 81747e4

Please sign in to comment.