create_workflow
async
¶
create_workflow(
name: NameString,
definition_s3_location: DefinitionS3Location,
role_arn: RoleARN,
*,
config_overrides: Optional[AsyncMWAAServerlessClientConfig] = None,
client_token: Optional[IdempotencyTokenString] = None,
code: Optional[Code] = None,
description: Optional[DescriptionString] = None,
encryption_configuration: Optional[EncryptionConfiguration] = None,
logging_configuration: Optional[LoggingConfiguration] = None,
engine_version: Optional[EngineVersion] = None,
network_configuration: Optional[NetworkConfiguration] = None,
environment: Optional[Environment] = None,
tags: Optional[Tags] = None,
trigger_mode: Optional[GenericString] = None,
on_behalf_of: Optional[OnBehalfOfIdentity] = None,
) -> CreateWorkflowResponse
Creates a new workflow in Amazon Managed Workflows for Apache Airflow Serverless. This operation initializes a workflow with the specified configuration including the workflow definition, execution role, and optional settings for encryption, logging, and networking. You must provide the workflow definition as a YAML file stored in Amazon S3 that defines the DAG structure using supported Amazon Web Services operators. Amazon Managed Workflows for Apache Airflow Serverless automatically creates the first version of the workflow and sets up the necessary execution environment with multi-tenant isolation and security controls.
Parameters:
-
name(NameString) –The name of the workflow. You must use unique workflow names within your Amazon Web Services account. The service generates a unique identifier that is appended to ensure temporal uniqueness across the account lifecycle.
-
client_token(Optional[IdempotencyTokenString], default:None) –A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This token prevents duplicate workflow creation requests.
-
definition_s3_location(DefinitionS3Location) –The Amazon S3 location where the workflow definition file is stored. This must point to a valid YAML file that defines the workflow structure using supported Amazon Web Services operators and tasks. Amazon Managed Workflows for Apache Airflow Serverless takes a snapshot of the definition at creation time, so subsequent changes to the Amazon S3 object will not affect the workflow unless you create a new version. In your YAML definition, include task dependencies, scheduling information, and operator configurations that are compatible with the Amazon Managed Workflows for Apache Airflow Serverless execution environment.
-
code(Optional[Code], default:None) –The location of code artifacts in Amazon S3 for the workflow. The service copies the code from this location at the time of the request.
-
role_arn(RoleARN) –The Amazon Resource Name (ARN) of the IAM role that Amazon Managed Workflows for Apache Airflow Serverless assumes when executing the workflow. This role must have the necessary permissions to access the required Amazon Web Services services and resources that your workflow tasks will interact with. The role is used for task execution in the isolated, multi-tenant environment and should follow the principle of least privilege. Amazon Managed Workflows for Apache Airflow Serverless validates role access during workflow creation but runtime permission checks are performed by the target services.
-
description(Optional[DescriptionString], default:None) –An optional description of the workflow that you can use to provide additional context about the workflow's purpose and functionality.
-
encryption_configuration(Optional[EncryptionConfiguration], default:None) –The configuration for encrypting workflow data at rest and in transit. Specifies the encryption type and optional KMS key for customer-managed encryption.
-
logging_configuration(Optional[LoggingConfiguration], default:None) –The configuration for workflow logging. Specifies the CloudWatch log group where workflow execution logs are stored. Amazon Managed Workflows for Apache Airflow Serverless automatically exports worker logs and task-level information to the specified log group in your account using remote logging functionality. This provides comprehensive observability for debugging and monitoring workflow execution across the distributed, serverless environment.
-
engine_version(Optional[EngineVersion], default:None) –The version of the Amazon Managed Workflows for Apache Airflow Serverless engine that you want to use for this workflow. This determines the feature set, supported operators, and execution environment capabilities available to your workflow. Amazon Managed Workflows for Apache Airflow Serverless maintains backward compatibility across versions while introducing new features and improvements. Currently supports version 1 with plans for additional versions as the service evolves.
-
network_configuration(Optional[NetworkConfiguration], default:None) –Network configuration for the workflow execution environment, including VPC security groups and subnets for secure network access. When specified, Amazon Managed Workflows for Apache Airflow Serverless deploys ECS worker tasks in your customer VPC to provide secure connectivity to your resources. If not specified, tasks run in the service's default worker VPC with network isolation from other customers. This configuration enables secure access to VPC-only resources like RDS databases or private endpoints.
-
environment(Optional[Environment], default:None) –The environment variables to set for tasks in the workflow. If you don't specify this parameter, the workflow has no environment variables.
-
tags(Optional[Tags], default:None) –A map of tags to assign to the workflow resource. Tags are key-value pairs that are used for resource organization and cost allocation.
-
trigger_mode(Optional[GenericString], default:None) –The trigger mode for the workflow execution.
-
on_behalf_of(Optional[OnBehalfOfIdentity], default:None) –Specifies whether scheduled runs of the workflow carry your identity context in addition to the execution role. Identity context is information about your user identity that Amazon Web Services propagates with your credentials, for example when you sign in through IAM Identity Center. Specify one of the following values:
-
EXECUTION_ROLE– If you specify this value, scheduled runs use only the execution role that you specify inRoleArn. This is the default value. -
ORIGIN_IDENTITY– If you specify this value, scheduled runs use the execution role that you specify inRoleArn, with your identity context attached. To use this value, the workflow definition must include a schedule. The credentials that you sign the request with must also include identity context.
If you don't specify this parameter, scheduled runs use
EXECUTION_ROLE. -
Raises:
-
AccessDeniedException–You do not have sufficient permission to perform this action.
-
ConflictException–You cannot create a resource that already exists, or the resource is in a state that prevents the requested operation.
-
InternalServerException–An unexpected server-side error occurred during request processing.
-
OperationTimeoutException–The operation timed out.
-
ServiceQuotaExceededException–The request exceeds the service quota for Amazon Managed Workflows for Apache Airflow Serverless resources. This can occur when you attempt to create more workflows than allowed, exceed concurrent workflow run limits, or surpass task execution limits. Amazon Managed Workflows for Apache Airflow Serverless implements admission control using DynamoDB-based counters to manage resource utilization across the multi-tenant environment. Contact Amazon Web Services Support to request quota increases if you need higher limits for your use case.
-
ThrottlingException–The request was denied because too many requests were made in a short period, exceeding the service rate limits. Amazon Managed Workflows for Apache Airflow Serverless implements throttling controls to ensure fair resource allocation across all customers in the multi-tenant environment. This helps maintain service stability and performance. If you encounter throttling, implement exponential backoff and retry logic in your applications, or consider distributing your API calls over a longer time period.
-
ValidationException–The specified request parameters are invalid, missing, or inconsistent with Amazon Managed Workflows for Apache Airflow Serverless service requirements. This can occur when workflow definitions contain unsupported operators, when required IAM permissions are missing, when S3 locations are inaccessible, or when network configurations are invalid. The service validates workflow definitions, execution roles, and resource configurations to ensure compatibility with the managed Airflow environment and security requirements.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_mwaa_serverless/_services/async_mwaa_serverless.py
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 | |