Skip to content

Commit

Permalink
feat(client-appconfig): This release adds support for deletion protec…
Browse files Browse the repository at this point in the history
…tion, which is a safety guardrail to prevent the unintentional deletion of a recently used AWS AppConfig Configuration Profile or Environment. This also includes a change to increase the maximum length of the Name parameter in UpdateConfigurationProfile.
  • Loading branch information
awstools committed Aug 28, 2024
1 parent 5a8ca89 commit 950682d
Show file tree
Hide file tree
Showing 15 changed files with 700 additions and 45 deletions.
16 changes: 16 additions & 0 deletions clients/client-appconfig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,14 @@ DeleteHostedConfigurationVersion

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/appconfig/command/DeleteHostedConfigurationVersionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appconfig/Interface/DeleteHostedConfigurationVersionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appconfig/Interface/DeleteHostedConfigurationVersionCommandOutput/)

</details>
<details>
<summary>
GetAccountSettings
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/appconfig/command/GetAccountSettingsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appconfig/Interface/GetAccountSettingsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appconfig/Interface/GetAccountSettingsCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -639,6 +647,14 @@ UntagResource

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/appconfig/command/UntagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appconfig/Interface/UntagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appconfig/Interface/UntagResourceCommandOutput/)

</details>
<details>
<summary>
UpdateAccountSettings
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/appconfig/command/UpdateAccountSettingsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appconfig/Interface/UpdateAccountSettingsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appconfig/Interface/UpdateAccountSettingsCommandOutput/)

</details>
<details>
<summary>
Expand Down
48 changes: 48 additions & 0 deletions clients/client-appconfig/src/AppConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ import {
DeleteHostedConfigurationVersionCommandInput,
DeleteHostedConfigurationVersionCommandOutput,
} from "./commands/DeleteHostedConfigurationVersionCommand";
import {
GetAccountSettingsCommand,
GetAccountSettingsCommandInput,
GetAccountSettingsCommandOutput,
} from "./commands/GetAccountSettingsCommand";
import {
GetApplicationCommand,
GetApplicationCommandInput,
Expand Down Expand Up @@ -179,6 +184,11 @@ import {
UntagResourceCommandInput,
UntagResourceCommandOutput,
} from "./commands/UntagResourceCommand";
import {
UpdateAccountSettingsCommand,
UpdateAccountSettingsCommandInput,
UpdateAccountSettingsCommandOutput,
} from "./commands/UpdateAccountSettingsCommand";
import {
UpdateApplicationCommand,
UpdateApplicationCommandInput,
Expand Down Expand Up @@ -230,6 +240,7 @@ const commands = {
DeleteExtensionCommand,
DeleteExtensionAssociationCommand,
DeleteHostedConfigurationVersionCommand,
GetAccountSettingsCommand,
GetApplicationCommand,
GetConfigurationCommand,
GetConfigurationProfileCommand,
Expand All @@ -252,6 +263,7 @@ const commands = {
StopDeploymentCommand,
TagResourceCommand,
UntagResourceCommand,
UpdateAccountSettingsCommand,
UpdateApplicationCommand,
UpdateConfigurationProfileCommand,
UpdateDeploymentStrategyCommand,
Expand Down Expand Up @@ -494,6 +506,24 @@ export interface AppConfig {
cb: (err: any, data?: DeleteHostedConfigurationVersionCommandOutput) => void
): void;

/**
* @see {@link GetAccountSettingsCommand}
*/
getAccountSettings(): Promise<GetAccountSettingsCommandOutput>;
getAccountSettings(
args: GetAccountSettingsCommandInput,
options?: __HttpHandlerOptions
): Promise<GetAccountSettingsCommandOutput>;
getAccountSettings(
args: GetAccountSettingsCommandInput,
cb: (err: any, data?: GetAccountSettingsCommandOutput) => void
): void;
getAccountSettings(
args: GetAccountSettingsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetAccountSettingsCommandOutput) => void
): void;

/**
* @see {@link GetApplicationCommand}
*/
Expand Down Expand Up @@ -830,6 +860,24 @@ export interface AppConfig {
cb: (err: any, data?: UntagResourceCommandOutput) => void
): void;

/**
* @see {@link UpdateAccountSettingsCommand}
*/
updateAccountSettings(): Promise<UpdateAccountSettingsCommandOutput>;
updateAccountSettings(
args: UpdateAccountSettingsCommandInput,
options?: __HttpHandlerOptions
): Promise<UpdateAccountSettingsCommandOutput>;
updateAccountSettings(
args: UpdateAccountSettingsCommandInput,
cb: (err: any, data?: UpdateAccountSettingsCommandOutput) => void
): void;
updateAccountSettings(
args: UpdateAccountSettingsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateAccountSettingsCommandOutput) => void
): void;

/**
* @see {@link UpdateApplicationCommand}
*/
Expand Down
9 changes: 9 additions & 0 deletions clients/client-appconfig/src/AppConfigClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ import {
DeleteHostedConfigurationVersionCommandInput,
DeleteHostedConfigurationVersionCommandOutput,
} from "./commands/DeleteHostedConfigurationVersionCommand";
import { GetAccountSettingsCommandInput, GetAccountSettingsCommandOutput } from "./commands/GetAccountSettingsCommand";
import { GetApplicationCommandInput, GetApplicationCommandOutput } from "./commands/GetApplicationCommand";
import { GetConfigurationCommandInput, GetConfigurationCommandOutput } from "./commands/GetConfigurationCommand";
import {
Expand Down Expand Up @@ -140,6 +141,10 @@ import { StartDeploymentCommandInput, StartDeploymentCommandOutput } from "./com
import { StopDeploymentCommandInput, StopDeploymentCommandOutput } from "./commands/StopDeploymentCommand";
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
import {
UpdateAccountSettingsCommandInput,
UpdateAccountSettingsCommandOutput,
} from "./commands/UpdateAccountSettingsCommand";
import { UpdateApplicationCommandInput, UpdateApplicationCommandOutput } from "./commands/UpdateApplicationCommand";
import {
UpdateConfigurationProfileCommandInput,
Expand Down Expand Up @@ -188,6 +193,7 @@ export type ServiceInputTypes =
| DeleteExtensionAssociationCommandInput
| DeleteExtensionCommandInput
| DeleteHostedConfigurationVersionCommandInput
| GetAccountSettingsCommandInput
| GetApplicationCommandInput
| GetConfigurationCommandInput
| GetConfigurationProfileCommandInput
Expand All @@ -210,6 +216,7 @@ export type ServiceInputTypes =
| StopDeploymentCommandInput
| TagResourceCommandInput
| UntagResourceCommandInput
| UpdateAccountSettingsCommandInput
| UpdateApplicationCommandInput
| UpdateConfigurationProfileCommandInput
| UpdateDeploymentStrategyCommandInput
Expand All @@ -236,6 +243,7 @@ export type ServiceOutputTypes =
| DeleteExtensionAssociationCommandOutput
| DeleteExtensionCommandOutput
| DeleteHostedConfigurationVersionCommandOutput
| GetAccountSettingsCommandOutput
| GetApplicationCommandOutput
| GetConfigurationCommandOutput
| GetConfigurationProfileCommandOutput
Expand All @@ -258,6 +266,7 @@ export type ServiceOutputTypes =
| StopDeploymentCommandOutput
| TagResourceCommandOutput
| UntagResourceCommandOutput
| UpdateAccountSettingsCommandOutput
| UpdateApplicationCommandOutput
| UpdateConfigurationProfileCommandOutput
| UpdateDeploymentStrategyCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ export interface CreateHostedConfigurationVersionCommandOutput
__MetadataBearer {}

/**
* <p>Creates a new configuration in the AppConfig hosted configuration
* store.</p>
* <p>Creates a new configuration in the AppConfig hosted configuration store. If
* you're creating a feature flag, we recommend you familiarize yourself with the JSON schema
* for feature flag data. For more information, see <a href="https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-configuration-and-profile-feature-flags.html#appconfig-type-reference-feature-flags">Type reference for AWS.AppConfig.FeatureFlags</a> in the
* <i>AppConfig User Guide</i>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export interface DeleteApplicationCommandInput extends DeleteApplicationRequest
export interface DeleteApplicationCommandOutput extends __MetadataBearer {}

/**
* <p>Deletes an application. Deleting an application does not delete a configuration from a
* host.</p>
* <p>Deletes an application.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ export interface DeleteConfigurationProfileCommandInput extends DeleteConfigurat
export interface DeleteConfigurationProfileCommandOutput extends __MetadataBearer {}

/**
* <p>Deletes a configuration profile. Deleting a configuration profile does not delete a
* configuration from a host.</p>
* <p>Deletes a configuration profile.</p>
* <p>To prevent users from unintentionally deleting actively-used configuration profiles,
* enable <a href="https://docs.aws.amazon.com/appconfig/latest/userguide/deletion-protection.html">deletion
* protection</a>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand All @@ -39,6 +41,7 @@ export interface DeleteConfigurationProfileCommandOutput extends __MetadataBeare
* const input = { // DeleteConfigurationProfileRequest
* ApplicationId: "STRING_VALUE", // required
* ConfigurationProfileId: "STRING_VALUE", // required
* DeletionProtectionCheck: "ACCOUNT_DEFAULT" || "APPLY" || "BYPASS",
* };
* const command = new DeleteConfigurationProfileCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export interface DeleteDeploymentStrategyCommandInput extends DeleteDeploymentSt
export interface DeleteDeploymentStrategyCommandOutput extends __MetadataBearer {}

/**
* <p>Deletes a deployment strategy. Deleting a deployment strategy does not delete a
* configuration from a host.</p>
* <p>Deletes a deployment strategy.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,19 @@ export interface DeleteEnvironmentCommandInput extends DeleteEnvironmentRequest
export interface DeleteEnvironmentCommandOutput extends __MetadataBearer {}

/**
* <p>Deletes an environment. Deleting an environment does not delete a configuration from a
* host.</p>
* <p>Deletes an environment.</p>
* <p>To prevent users from unintentionally deleting actively-used environments, enable <a href="https://docs.aws.amazon.com/appconfig/latest/userguide/deletion-protection.html">deletion
* protection</a>.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AppConfigClient, DeleteEnvironmentCommand } from "@aws-sdk/client-appconfig"; // ES Modules import
* // const { AppConfigClient, DeleteEnvironmentCommand } = require("@aws-sdk/client-appconfig"); // CommonJS import
* const client = new AppConfigClient(config);
* const input = { // DeleteEnvironmentRequest
* ApplicationId: "STRING_VALUE", // required
* EnvironmentId: "STRING_VALUE", // required
* ApplicationId: "STRING_VALUE", // required
* DeletionProtectionCheck: "ACCOUNT_DEFAULT" || "APPLY" || "BYPASS",
* };
* const command = new DeleteEnvironmentCommand(input);
* const response = await client.send(command);
Expand Down
90 changes: 90 additions & 0 deletions clients/client-appconfig/src/commands/GetAccountSettingsCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { AppConfigClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AppConfigClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { AccountSettings } from "../models/models_0";
import { de_GetAccountSettingsCommand, se_GetAccountSettingsCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link GetAccountSettingsCommand}.
*/
export interface GetAccountSettingsCommandInput {}
/**
* @public
*
* The output of {@link GetAccountSettingsCommand}.
*/
export interface GetAccountSettingsCommandOutput extends AccountSettings, __MetadataBearer {}

/**
* <p>Returns information about the status of the <code>DeletionProtection</code>
* parameter.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AppConfigClient, GetAccountSettingsCommand } from "@aws-sdk/client-appconfig"; // ES Modules import
* // const { AppConfigClient, GetAccountSettingsCommand } = require("@aws-sdk/client-appconfig"); // CommonJS import
* const client = new AppConfigClient(config);
* const input = {};
* const command = new GetAccountSettingsCommand(input);
* const response = await client.send(command);
* // { // AccountSettings
* // DeletionProtection: { // DeletionProtectionSettings
* // Enabled: true || false,
* // ProtectionPeriodInMinutes: Number("int"),
* // },
* // };
*
* ```
*
* @param GetAccountSettingsCommandInput - {@link GetAccountSettingsCommandInput}
* @returns {@link GetAccountSettingsCommandOutput}
* @see {@link GetAccountSettingsCommandInput} for command's `input` shape.
* @see {@link GetAccountSettingsCommandOutput} for command's `response` shape.
* @see {@link AppConfigClientResolvedConfig | config} for AppConfigClient's `config` shape.
*
* @throws {@link BadRequestException} (client fault)
* <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>There was an internal failure in the AppConfig service.</p>
*
* @throws {@link AppConfigServiceException}
* <p>Base exception class for all service exceptions from AppConfig service.</p>
*
* @public
*/
export class GetAccountSettingsCommand extends $Command
.classBuilder<
GetAccountSettingsCommandInput,
GetAccountSettingsCommandOutput,
AppConfigClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
})
.m(function (this: any, Command: any, cs: any, config: AppConfigClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("AmazonAppConfig", "GetAccountSettings", {})
.n("AppConfigClient", "GetAccountSettingsCommand")
.f(void 0, void 0)
.ser(se_GetAccountSettingsCommand)
.de(de_GetAccountSettingsCommand)
.build() {}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface GetConfigurationCommandOutput extends GetConfigurationCommandOu
* </li>
* <li>
* <p>
* <code>GetConfiguration</code> is a priced call. For more information, see
* <a>GetConfiguration</a> is a priced call. For more information, see
* <a href="https://aws.amazon.com/systems-manager/pricing/">Pricing</a>.</p>
* </li>
* </ul>
Expand Down
Loading

0 comments on commit 950682d

Please sign in to comment.