MWAAServerless / Client / update_workflow

update_workflow

MWAAServerless.Client.update_workflow(**kwargs)

Updates an existing workflow with new configuration settings. This operation allows you to modify the workflow definition, role, and other settings. When you update a workflow, Amazon Managed Workflows for Apache Airflow Serverless automatically creates a new version with the updated configuration and disables scheduling on all previous versions to ensure only one version is actively scheduled at a time. The update operation maintains workflow history while providing a clean transition to the new configuration.

See also: AWS API Documentation

Request Syntax

response = client.update_workflow(
    WorkflowArn='string',
    DefinitionS3Location={
        'Bucket': 'string',
        'ObjectKey': 'string',
        'VersionId': 'string'
    },
    Code={
        'S3Location': {
            'Bucket': 'string',
            'ObjectKey': 'string',
            'VersionId': 'string'
        }
    },
    RoleArn='string',
    Description='string',
    LoggingConfiguration={
        'LogGroupName': 'string'
    },
    EngineVersion=123,
    NetworkConfiguration={
        'SecurityGroupIds': [
            'string',
        ],
        'SubnetIds': [
            'string',
        ]
    },
    Environment={
        'Variables': {
            'string': 'string'
        }
    },
    TriggerMode='string'
)
Parameters:
  • WorkflowArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the workflow you want to update.

  • DefinitionS3Location (dict) –

    [REQUIRED]

    The Amazon S3 location where the updated workflow definition file is stored.

    • Bucket (string) – [REQUIRED]

      The name of the Amazon S3 bucket that contains the workflow definition file.

    • ObjectKey (string) – [REQUIRED]

      The key (name) of the workflow definition file within the S3 bucket.

    • VersionId (string) –

      Optional. The version ID of the workflow definition file in Amazon S3. If you don’t specify a version, we use the latest version.

  • Code (dict) –

    The location of code artifacts in Amazon S3 for the updated workflow. The service copies the code from this location at the time of the request.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: S3Location.

    • S3Location (dict) –

      The Amazon S3 location of the code artifacts that your workflow tasks use during execution.

      • Bucket (string) – [REQUIRED]

        The name of the Amazon S3 bucket.

      • ObjectKey (string) – [REQUIRED]

        The key of the code artifact within the Amazon S3 bucket.

      • VersionId (string) –

        Specifies the version ID of the object in Amazon S3. If you don’t specify a version, we use the latest version.

  • RoleArn (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the IAM role that Amazon Managed Workflows for Apache Airflow Serverless assumes when it executes the updated workflow.

  • Description (string) – An updated description for the workflow.

  • LoggingConfiguration (dict) –

    Updated logging configuration for the workflow.

    • LogGroupName (string) – [REQUIRED]

      The name of the CloudWatch log group where workflow execution logs are stored.

  • EngineVersion (integer) – The version of the Amazon Managed Workflows for Apache Airflow Serverless engine that you want to use for the updated workflow.

  • NetworkConfiguration (dict) –

    Updated network configuration for the workflow execution environment.

    • SecurityGroupIds (list) –

      A list of VPC security group IDs to associate with the workflow execution environment.

      • (string) –

    • SubnetIds (list) –

      A list of VPC subnet IDs where the workflow execution environment is deployed.

      • (string) –

  • Environment (dict) –

    The environment variables to set for tasks in the workflow.

    Warning

    The variables that you specify replace all existing environment variables for the workflow. If you don’t specify this parameter, the workflow has no environment variables. To keep existing environment variables, include them in the request.

    • Variables (dict) –

      A map of environment variable names to values. Your workflow tasks use these variables while they run. You can specify up to 50 environment variables. Each name must be between 1 and 128 characters, start with a letter, and contain only letters, numbers, and underscores. Each value can be up to 255 characters.

      Names that start with AWS_ or AIRFLOW__ are reserved. You can use the following Apache Airflow secrets backend settings, which are exceptions:

      • AIRFLOW__WORKERS__SECRETS_BACKEND – The secrets backend class that workers use.

      • AIRFLOW__WORKERS__SECRETS_BACKEND_KWARGS – The keyword arguments for the secrets backend, as a JSON string.

      • AIRFLOW__WORKERS__SECRETS_BACKEND_KWARG__* – Names with this prefix, for additional secrets backend configuration.

      If you set EncryptionConfiguration to use a customer managed AWS KMS key, we encrypt the environment variables with that key. Otherwise, we store them with default encryption at rest.

      • (string) –

        • (string) –

  • TriggerMode (string) – The trigger mode for the workflow execution.

Return type:

dict

Returns:

Response Syntax

{
    'WorkflowArn': 'string',
    'ModifiedAt': datetime(2015, 1, 1),
    'WorkflowVersion': 'string',
    'Warnings': [
        'string',
    ]
}

Response Structure

  • (dict) –

    • WorkflowArn (string) –

      The Amazon Resource Name (ARN) of the updated workflow.

    • ModifiedAt (datetime) –

      The timestamp when the workflow was last modified, in ISO 8601 date-time format.

    • WorkflowVersion (string) –

      The version identifier of the updated workflow.

    • Warnings (list) –

      Warning messages generated during workflow update.

      • (string) –

Exceptions