Skip to content

Commit

Permalink
feat(client-mwaa): Amazon MWAA now supports Airflow web server auto s…
Browse files Browse the repository at this point in the history
…caling to automatically handle increased demand from REST APIs, Command Line Interface (CLI), or more Airflow User Interface (UI) users. Customers can specify maximum and minimum web server instances during environment creation and update workflow.
  • Loading branch information
awstools committed May 16, 2024
1 parent 5e19279 commit 9a65822
Show file tree
Hide file tree
Showing 6 changed files with 158 additions and 13 deletions.
2 changes: 2 additions & 0 deletions clients/client-mwaa/src/commands/CreateEnvironmentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ export interface CreateEnvironmentCommandOutput extends CreateEnvironmentOutput,
* MinWorkers: Number("int"),
* Schedulers: Number("int"),
* EndpointManagement: "STRING_VALUE",
* MinWebservers: Number("int"),
* MaxWebservers: Number("int"),
* };
* const command = new CreateEnvironmentCommand(input);
* const response = await client.send(command);
Expand Down
2 changes: 2 additions & 0 deletions clients/client-mwaa/src/commands/GetEnvironmentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ export interface GetEnvironmentCommandOutput extends GetEnvironmentOutput, __Met
* // DatabaseVpcEndpointService: "STRING_VALUE",
* // CeleryExecutorQueue: "STRING_VALUE",
* // EndpointManagement: "STRING_VALUE",
* // MinWebservers: Number("int"),
* // MaxWebservers: Number("int"),
* // },
* // };
*
Expand Down
2 changes: 2 additions & 0 deletions clients/client-mwaa/src/commands/UpdateEnvironmentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ export interface UpdateEnvironmentCommandOutput extends UpdateEnvironmentOutput,
* WebserverAccessMode: "STRING_VALUE",
* MinWorkers: Number("int"),
* Schedulers: Number("int"),
* MinWebservers: Number("int"),
* MaxWebservers: Number("int"),
* };
* const command = new UpdateEnvironmentCommand(input);
* const response = await client.send(command);
Expand Down
95 changes: 88 additions & 7 deletions clients/client-mwaa/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export interface CreateEnvironmentInput {
AirflowConfigurationOptions?: Record<string, string>;

/**
* <p>The environment class type. Valid values: <code>mw1.small</code>, <code>mw1.medium</code>, <code>mw1.large</code>. For more information, see <a href="https://docs.aws.amazon.com/mwaa/latest/userguide/environment-class.html">Amazon MWAA environment class</a>.</p>
* <p>The environment class type. Valid values: <code>mw1.small</code>, <code>mw1.medium</code>, <code>mw1.large</code>, <code>mw1.xlarge</code>, and <code>mw1.2xlarge</code>. For more information, see <a href="https://docs.aws.amazon.com/mwaa/latest/userguide/environment-class.html">Amazon MWAA environment class</a>.</p>
* @public
*/
EnvironmentClass?: string;
Expand Down Expand Up @@ -345,10 +345,10 @@ export interface CreateEnvironmentInput {
* <p>The number of Apache Airflow schedulers to run in your environment. Valid values:</p>
* <ul>
* <li>
* <p>v2 - Accepts between 2 to 5. Defaults to 2.</p>
* <p>v2 - Accepts between <code>2</code> to <code>5</code>. Defaults to <code>2</code>.</p>
* </li>
* <li>
* <p>v1 - Accepts 1.</p>
* <p>v1 - Accepts <code>1</code>.</p>
* </li>
* </ul>
* @public
Expand All @@ -363,6 +363,33 @@ export interface CreateEnvironmentInput {
* @public
*/
EndpointManagement?: EndpointManagement;

/**
* <p>
* The minimum number of web servers that you want to run in your environment.
* Amazon MWAA scales the number of Apache Airflow web servers up to the number you specify for <code>MaxWebservers</code>
* when you interact with your Apache Airflow environment using Apache Airflow REST API, or
* the Apache Airflow CLI. As the transaction-per-second rate, and the network load, decrease,
* Amazon MWAA disposes of the additional web servers, and scales down to the number set in <code>MinxWebserers</code>.
* </p>
* <p>Valid values: Accepts between <code>2</code> and <code>5</code>. Defaults to <code>2</code>.</p>
* @public
*/
MinWebservers?: number;

/**
* <p>
* The maximum number of web servers that you want to run in your environment.
* Amazon MWAA scales the number of Apache Airflow web servers up to the number you specify for <code>MaxWebservers</code>
* when you interact with your Apache Airflow environment using Apache Airflow REST API, or
* the Apache Airflow CLI. For example, in scenarios where your workload requires network calls to the Apache Airflow REST API with a high transaction-per-second (TPS)
* rate, Amazon MWAA will increase the number of web servers up to the number set in <code>MaxWebserers</code>. As TPS rates decrease
* Amazon MWAA disposes of the additional web servers, and scales down to the number set in <code>MinxWebserers</code>.
* </p>
* <p>Valid values: Accepts between <code>2</code> and <code>5</code>. Defaults to <code>2</code>.</p>
* @public
*/
MaxWebservers?: number;
}

/**
Expand Down Expand Up @@ -742,7 +769,7 @@ export interface Environment {

/**
* <p>The Apache Airflow version on your environment.</p>
* <p>Valid values: <code>1.10.12</code>, <code>2.0.2</code>, <code>2.2.2</code>, <code>2.4.3</code>, <code>2.5.1</code>, <code>2.6.3</code>, <code>2.7.2</code>.</p>
* <p>Valid values: <code>1.10.12</code>, <code>2.0.2</code>, <code>2.2.2</code>, <code>2.4.3</code>, <code>2.5.1</code>, <code>2.6.3</code>, <code>2.7.2</code>, <code>2.8.1</code>.</p>
* @public
*/
AirflowVersion?: string;
Expand Down Expand Up @@ -833,7 +860,7 @@ export interface Environment {
AirflowConfigurationOptions?: Record<string, string>;

/**
* <p>The environment class type. Valid values: <code>mw1.small</code>, <code>mw1.medium</code>, <code>mw1.large</code>. For more information, see <a href="https://docs.aws.amazon.com/mwaa/latest/userguide/environment-class.html">Amazon MWAA environment class</a>.</p>
* <p>The environment class type. Valid values: <code>mw1.small</code>, <code>mw1.medium</code>, <code>mw1.large</code>, <code>mw1.xlarge</code>, and <code>mw1.2xlarge</code>. For more information, see <a href="https://docs.aws.amazon.com/mwaa/latest/userguide/environment-class.html">Amazon MWAA environment class</a>.</p>
* @public
*/
EnvironmentClass?: string;
Expand Down Expand Up @@ -917,6 +944,33 @@ export interface Environment {
* @public
*/
EndpointManagement?: EndpointManagement;

/**
* <p>
* The minimum number of web servers that you want to run in your environment.
* Amazon MWAA scales the number of Apache Airflow web servers up to the number you specify for <code>MaxWebservers</code>
* when you interact with your Apache Airflow environment using Apache Airflow REST API, or
* the Apache Airflow CLI. As the transaction-per-second rate, and the network load, decrease,
* Amazon MWAA disposes of the additional web servers, and scales down to the number set in <code>MinxWebserers</code>.
* </p>
* <p>Valid values: Accepts between <code>2</code> and <code>5</code>. Defaults to <code>2</code>.</p>
* @public
*/
MinWebservers?: number;

/**
* <p>
* The maximum number of web servers that you want to run in your environment.
* Amazon MWAA scales the number of Apache Airflow web servers up to the number you specify for <code>MaxWebservers</code>
* when you interact with your Apache Airflow environment using Apache Airflow REST API, or
* the Apache Airflow CLI. For example, in scenarios where your workload requires network calls to the Apache Airflow REST API with a high transaction-per-second (TPS)
* rate, Amazon MWAA will increase the number of web servers up to the number set in <code>MaxWebserers</code>. As TPS rates decrease
* Amazon MWAA disposes of the additional web servers, and scales down to the number set in <code>MinxWebserers</code>.
* </p>
* <p>Valid values: Accepts between <code>2</code> and <code>5</code>. Defaults to <code>2</code>.</p>
* @public
*/
MaxWebservers?: number;
}

/**
Expand Down Expand Up @@ -1242,7 +1296,7 @@ export interface UpdateEnvironmentInput {
* <p>The Apache Airflow version for your environment. To upgrade your environment, specify a newer version of Apache Airflow supported by Amazon MWAA.</p>
* <p>Before you upgrade an environment, make sure your requirements, DAGs, plugins, and other resources used in your workflows are compatible with the new Apache Airflow version. For more information about updating
* your resources, see <a href="https://docs.aws.amazon.com/mwaa/latest/userguide/upgrading-environment.html">Upgrading an Amazon MWAA environment</a>.</p>
* <p>Valid values: <code>1.10.12</code>, <code>2.0.2</code>, <code>2.2.2</code>, <code>2.4.3</code>, <code>2.5.1</code>, <code>2.6.3</code>, <code>2.7.2</code>.</p>
* <p>Valid values: <code>1.10.12</code>, <code>2.0.2</code>, <code>2.2.2</code>, <code>2.4.3</code>, <code>2.5.1</code>, <code>2.6.3</code>, <code>2.7.2</code>, <code>2.8.1</code>.</p>
* @public
*/
AirflowVersion?: string;
Expand Down Expand Up @@ -1319,7 +1373,7 @@ export interface UpdateEnvironmentInput {
AirflowConfigurationOptions?: Record<string, string>;

/**
* <p>The environment class type. Valid values: <code>mw1.small</code>, <code>mw1.medium</code>, <code>mw1.large</code>. For more information, see <a href="https://docs.aws.amazon.com/mwaa/latest/userguide/environment-class.html">Amazon MWAA environment class</a>.</p>
* <p>The environment class type. Valid values: <code>mw1.small</code>, <code>mw1.medium</code>, <code>mw1.large</code>, <code>mw1.xlarge</code>, and <code>mw1.2xlarge</code>. For more information, see <a href="https://docs.aws.amazon.com/mwaa/latest/userguide/environment-class.html">Amazon MWAA environment class</a>.</p>
* @public
*/
EnvironmentClass?: string;
Expand Down Expand Up @@ -1365,6 +1419,33 @@ export interface UpdateEnvironmentInput {
* @public
*/
Schedulers?: number;

/**
* <p>
* The minimum number of web servers that you want to run in your environment.
* Amazon MWAA scales the number of Apache Airflow web servers up to the number you specify for <code>MaxWebservers</code>
* when you interact with your Apache Airflow environment using Apache Airflow REST API, or
* the Apache Airflow CLI. As the transaction-per-second rate, and the network load, decrease,
* Amazon MWAA disposes of the additional web servers, and scales down to the number set in <code>MinxWebserers</code>.
* </p>
* <p>Valid values: Accepts between <code>2</code> and <code>5</code>. Defaults to <code>2</code>.</p>
* @public
*/
MinWebservers?: number;

/**
* <p>
* The maximum number of web servers that you want to run in your environment.
* Amazon MWAA scales the number of Apache Airflow web servers up to the number you specify for <code>MaxWebservers</code>
* when you interact with your Apache Airflow environment using Apache Airflow REST API, or
* the Apache Airflow CLI. For example, in scenarios where your workload requires network calls to the Apache Airflow REST API with a high transaction-per-second (TPS)
* rate, Amazon MWAA will increase the number of web servers up to the number set in <code>MaxWebserers</code>. As TPS rates decrease
* Amazon MWAA disposes of the additional web servers, and scales down to the number set in <code>MinxWebserers</code>.
* </p>
* <p>Valid values: Accepts between <code>2</code> and <code>5</code>. Defaults to <code>2</code>.</p>
* @public
*/
MaxWebservers?: number;
}

/**
Expand Down
6 changes: 6 additions & 0 deletions clients/client-mwaa/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ export const se_CreateEnvironmentCommand = async (
ExecutionRoleArn: [],
KmsKey: [],
LoggingConfiguration: (_) => _json(_),
MaxWebservers: [],
MaxWorkers: [],
MinWebservers: [],
MinWorkers: [],
NetworkConfiguration: (_) => _json(_),
PluginsS3ObjectVersion: [],
Expand Down Expand Up @@ -376,7 +378,9 @@ export const se_UpdateEnvironmentCommand = async (
EnvironmentClass: [],
ExecutionRoleArn: [],
LoggingConfiguration: (_) => _json(_),
MaxWebservers: [],
MaxWorkers: [],
MinWebservers: [],
MinWorkers: [],
NetworkConfiguration: (_) => _json(_),
PluginsS3ObjectVersion: [],
Expand Down Expand Up @@ -810,7 +814,9 @@ const de_Environment = (output: any, context: __SerdeContext): Environment => {
KmsKey: __expectString,
LastUpdate: (_: any) => de_LastUpdate(_, context),
LoggingConfiguration: _json,
MaxWebservers: __expectInt32,
MaxWorkers: __expectInt32,
MinWebservers: __expectInt32,
MinWorkers: __expectInt32,
Name: __expectString,
NetworkConfiguration: _json,
Expand Down

0 comments on commit 9a65822

Please sign in to comment.